style: enable clippy::doc_markdown

Put identifiers and Wayland protocol names in doc comments in backticks
(`wl_output`, `zwp_tablet_v2`). Product names that docs write plainly
(GLib, HarfBuzz, HiDPI, JetBrains, MSBuild, StatusNotifierItem, VSync)
go in `doc-valid-idents` in clippy.toml, next to Clippy's default list.

Mechanical, with the lint enabled in Cargo.toml:

    cargo clippy --fix --workspace --all-targets --all-features
    cargo clippy --fix --workspace --all-targets --no-default-features
    cargo fmt --all

Two comments that the fix could not mark up cleanly were reworded by
hand: the surface module summary and the zoom-chip invariant.
This commit is contained in:
devmobasa committed 2026-10-26 12:46:35 +01:00
1 parent 9c4336c645
commit 2b21ff1d80
50 files changed
+77 -72

No files matched your search

+1
View File
@@ -35,6 +35,7 @@ wildcard_imports = "warn"
# Pedantic lints, adopted one at a time. Most of them have machine-applicable
# fixes, so `cargo clippy --fix` can apply them.
cast_lossless = "warn"
doc_markdown = "warn"
map_unwrap_or = "warn"
uninlined_format_args = "warn"
+4
View File
@@ -14,3 +14,7 @@ disallowed-methods = [
{ path = "std::sync::Mutex::clear_poison", reason = "a poisoned lock may hold broken invariants" },
{ path = "std::sync::RwLock::clear_poison", reason = "a poisoned lock may hold broken invariants" },
]
# Product and library names that docs may write without backticks. The `..`
# keeps Clippy's default list.
doc-valid-idents = ["GLib", "HarfBuzz", "HiDPI", "JetBrains", "MSBuild", "StatusNotifierItem", "VSync", ".."]
+1 -1
View File
@@ -40,7 +40,7 @@ fn load_app_stylesheet() {
}
}
/// GApplication id. A valid dotted id is required by GLib; the window still
/// `GApplication` id. A valid dotted id is required by GLib; the window still
/// advertises this as its Wayland app-id, so compositor rules and the
/// `.desktop` `StartupWMClass` must match it.
const APP_ID: &str = "org.wayscriber.Configurator";
@@ -77,7 +77,7 @@ pub(super) fn connect_clicked(
});
}
/// GtkPopover widgets created with `set_parent` are not ordinary children.
/// `GtkPopover` widgets created with `set_parent` are not ordinary children.
/// If they are still attached when the parent is destroyed, GTK warns on
/// finalize. Unparent in the destroy handler so shutdown stays quiet.
pub(super) fn unparent_on_destroy(parent: &impl IsA<gtk::Widget>, popover: &gtk::Popover) {
+1 -1
View File
@@ -51,7 +51,7 @@ pub(in crate::backend::wayland) fn validate_shm_buffer_layout(
}
impl FrozenImage {
/// Apply the wl_output transform advertised for the captured output.
/// Apply the `wl_output` transform advertised for the captured output.
///
/// WLR screencopy buffers are returned in output framebuffer coordinates.
/// Frozen/zoom rendering paints them onto a logical surface, so rotated or
+1 -1
View File
@@ -547,7 +547,7 @@ impl OutputGeometry {
/// Crop origin inside a portal/desktop screenshot of `image_width` ×
/// `image_height`.
///
/// Prefer the walked layout origin. If optional zxdg_output metadata is
/// Prefer the walked layout origin. If optional `zxdg_output` metadata is
/// missing, `(0, 0)` is inferred only when topology proves there is a
/// single output and the image is that output's physical size.
pub fn portal_crop_origin(&self, image_width: u32, image_height: u32) -> Option<(u32, u32)> {
+1 -1
View File
@@ -1,4 +1,4 @@
//! Wayland tablet/stylus protocol handling (zwp_tablet_v2).
//! Wayland tablet/stylus protocol handling (`zwp_tablet_v2`).
use std::os::fd::OwnedFd;
use std::sync::Arc;
@@ -123,7 +123,7 @@ fn default_keymap() -> Option<xkb::Keymap> {
xkb::Keymap::new_from_names(&context, "", "", "", "", None, xkb::KEYMAP_COMPILE_NO_FLAGS)
}
/// evdev KEY_LEFTCTRL.
/// evdev `KEY_LEFTCTRL`.
const CTRL_KEYCODE: u32 = 29;
/// A press/release pair is reported to xkb once per *keycode*, not once
+1 -1
View File
@@ -1,7 +1,7 @@
//! Session persistence bookkeeping for per-output snapshots.
//!
//! Tracks the current session options and whether a snapshot has been loaded
//! so WaylandState can coordinate persistence without storing extra fields.
//! so `WaylandState` can coordinate persistence without storing extra fields.
use std::mem;
+5 -5
View File
@@ -5,7 +5,7 @@
//! last displayed - not just regions from the current frame.
//!
//! This module tracks damage per buffer slot, identified by the canvas memory address.
//! SlotPool reuses the same memory regions for released buffers, so the pointer
//! `SlotPool` reuses the same memory regions for released buffers, so the pointer
//! serves as a stable slot identifier across buffer reuse.
//!
//! A pool generation counter handles pool recreation (due to resize, scale change,
@@ -105,7 +105,7 @@ pub(in crate::backend::wayland) struct BufferDamageReport {
/// Tracks dirty regions for each buffer slot independently.
///
/// Buffers are identified by their canvas memory address, which is stable
/// across SlotPool buffer reuse (the same memory slot gets the same pointer).
/// across `SlotPool` buffer reuse (the same memory slot gets the same pointer).
/// Pool identity (generation + size) detects when the pool is recreated or
/// grows, which invalidates all previous canvas pointers.
///
@@ -141,7 +141,7 @@ impl BufferDamageTracker {
/// Checks pool identity and resets tracking if pool was recreated or grew.
///
/// When the SlotPool is recreated (generation changes) or grows (size increases),
/// When the `SlotPool` is recreated (generation changes) or grows (size increases),
/// all previous canvas pointers become invalid due to memory remapping.
fn check_pool_identity(&mut self, generation: u64, pool_size: usize) {
let pool_changed = generation != self.pool_generation;
@@ -217,12 +217,12 @@ impl BufferDamageTracker {
/// Takes damage regions for the buffer identified by its canvas pointer.
///
/// The canvas pointer (memory address of the first byte) serves as a stable
/// slot identifier - SlotPool reuses the same memory for released buffers.
/// slot identifier - `SlotPool` reuses the same memory for released buffers.
///
/// Pool identity (generation + size) is checked first - if the pool was
/// recreated or grew, all tracking is reset since previous pointers are invalid.
///
/// If this is a new slot (or global_full_damage is set), returns full damage.
/// If this is a new slot (or `global_full_damage` is set), returns full damage.
/// Otherwise returns and clears the slot's accumulated damage.
pub fn take_buffer_damage_report(
&mut self,
+1 -1
View File
@@ -157,7 +157,7 @@ impl WaylandState {
self.exit_overlay_suppression(OverlaySuppression::DesktopBackdrop);
}
/// Handles capture actions by delegating to the CaptureManager.
/// Handles capture actions by delegating to the `CaptureManager`.
pub(in crate::backend::wayland) fn handle_capture_action(&mut self, action: Action) {
if action.is_region_capture() {
if let Some(opening_action) = self.capture.active_region_action() {
@@ -211,7 +211,7 @@ impl WaylandState {
/// Submit the whole displayed image and retire any in-flight drag owner.
///
/// Keeping this transaction on WaylandState leaves the keyboard protocol
/// Keeping this transaction on `WaylandState` leaves the keyboard protocol
/// callback responsible only for translating Ctrl+A into one state action.
pub(in crate::backend::wayland) fn submit_whole_region_capture(&mut self) {
let Some(RegionSelectionFinalize::Selected { purpose, rect }) =
+1 -1
View File
@@ -9,7 +9,7 @@ pub(super) enum ProfileMode {
CanvasAndUi,
}
/// The selected profile is a frame value; reusable baseline storage stays in RenderRuntime.
/// The selected profile is a frame value; reusable baseline storage stays in `RenderRuntime`.
#[derive(Debug)]
pub(super) struct FrameProfile {
profile: Option<RenderColorProfile>,
@@ -315,7 +315,7 @@ mod tests {
assert!(by + bubble_h <= 600.0, "clamped within bottom edge");
}
/// Little-endian ARgb32 stores premultiplied BGRA in memory.
/// Little-endian `ARgb32` stores premultiplied BGRA in memory.
fn has_strong_green_pixel(pixels: &[u8]) -> bool {
pixels.as_chunks::<4>().0.iter().any(|px| {
let (b, g, r, a) = (px[0], px[1], px[2], px[3]);
+4 -4
View File
@@ -1,7 +1,7 @@
//! Layer-surface management for the Wayland backend.
//!
//! This module owns the wl_surface/layer surface handle and the shm slot
//! pool. WaylandState asks SurfaceState for buffers and size information
//! This module owns the `wl_surface`, its layer-surface handle, and the shm slot
//! pool. `WaylandState` asks `SurfaceState` for buffers and size information
//! instead of juggling the raw objects directly.
use anyhow::{Context, Result};
@@ -152,12 +152,12 @@ impl SurfaceState {
self.frame_callbacks.clear();
}
/// Returns the active wl_surface, if initialized.
/// Returns the active `wl_surface`, if initialized.
pub fn wl_surface(&self) -> Option<&wl_surface::WlSurface> {
self.wl_surface.as_ref()
}
/// Returns true if the provided wl_surface belongs to this overlay surface state.
/// Returns true if the provided `wl_surface` belongs to this overlay surface state.
pub fn is_surface(&self, surface: &wl_surface::WlSurface) -> bool {
self.wl_surface
.as_ref()
+3 -3
View File
@@ -1,8 +1,8 @@
use wayland_protocols::wp::tablet::zv2::client::zwp_tablet_tool_v2::Type;
/// Physical tool types as defined by the zwp_tablet_tool_v2 protocol.
/// Physical tool types as defined by the `zwp_tablet_tool_v2` protocol.
///
/// See: https://wayland.app/protocols/tablet-v2#zwp_tablet_tool_v2:enum:type
/// See: <https://wayland.app/protocols/tablet-v2#zwp_tablet_tool_v2:enum:type>
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum TabletToolType {
/// Pen tool (0x140)
@@ -43,7 +43,7 @@ impl TabletToolType {
/// Protocol value for lens tool
const LENS_VALUE: u32 = 0x147;
/// Converts from the raw u32 protocol value to TabletToolType.
/// Converts from the raw u32 protocol value to `TabletToolType`.
pub fn from_raw(value: u32) -> Self {
match value {
Self::PEN_VALUE => TabletToolType::Pen,
+1 -1
View File
@@ -27,7 +27,7 @@ pub struct HitRegion {
const ROW_HIT_LENGTH: f64 = MIN_HIT_TARGET * 3.0;
/// Shared pointer-target predicate: true when (x, y) lands inside `rect`
/// inflated to the minimum target size. Used by both the legacy HitRegion
/// inflated to the minimum target size. Used by both the legacy `HitRegion`
/// path and the view-engine tree so the two can never disagree.
pub fn rect_contains_with_min_target(rect: (f64, f64, f64, f64), x: f64, y: f64) -> bool {
let (rx, ry, rw, rh) = rect_with_min_target(rect);
+1 -1
View File
@@ -15,7 +15,7 @@ pub fn top_size(engine: &UiTextEngine, snapshot: &ToolbarSnapshot) -> (u32, u32)
}
/// Scroll bounds for the open Canvas/Session/Settings popover on the top strip as
/// (natural_height, viewport_height), both in pre-scale spec units; `None`
/// (`natural_height`, `viewport_height`), both in pre-scale spec units; `None`
/// while no menu popover is open.
pub fn top_popover_scroll_bounds(
engine: &UiTextEngine,
@@ -16,7 +16,7 @@ use crate::ui_text::{UiTextEngine, UiTextStyle};
use std::f64::consts::PI;
/// Faint white glow behind a hovered flat button (quieter than
/// COLOR_ICON_HOVER_BG; value-coincides with COLOR_DIVIDER but is a hover
/// `COLOR_ICON_HOVER_BG`; value-coincides with `COLOR_DIVIDER` but is a hover
/// affordance, not a separator).
const COLOR_BUTTON_HOVER_GLOW: Rgba = (1.0, 1.0, 1.0, 0.08);
/// Warning-tinted glow behind a hovered destructive button (destructive
@@ -56,7 +56,7 @@ impl ToolbarSurface {
self.configured = false;
}
/// Resize an already-mapped surface in place via layer_surface.set_size
/// Resize an already-mapped surface in place via `layer_surface.set_size`
/// instead of destroy/recreate, so size changes (shape picker, drawer,
/// contextual sections) don't flicker. Rendering pauses until the
/// compositor acks with a new configure.
+1 -1
View File
@@ -357,7 +357,7 @@ pub fn top_extra_height(engine: &UiTextEngine, snapshot: &ToolbarSnapshot) -> f6
}
/// Scroll bounds for the open Canvas/Session/Settings popover as
/// (natural_height, viewport_height), both in pre-scale spec units; `None`
/// (`natural_height`, `viewport_height`), both in pre-scale spec units; `None`
/// while no menu popover is open. The wheel path and scrollbar drag use these
/// same bounds.
pub fn top_popover_scroll_bounds(
@@ -125,7 +125,7 @@ fn menu_viewport_cap(snapshot: &ToolbarSnapshot, plan: &super::TopStripPlan) ->
}
/// Scroll bounds for the open Canvas/Session/Settings popover as
/// (natural_height, viewport_height), both in pre-scale spec units; `None`
/// (`natural_height`, `viewport_height`), both in pre-scale spec units; `None`
/// while no menu popover is open. Max scroll = (natural - viewport).max(0).
pub(super) fn menu_scroll_bounds_planned(
engine: &UiTextEngine,
+1 -1
View File
@@ -10,7 +10,7 @@ impl ToolbarIntent {
}
}
/// Translate a backend intent into the UI-facing ToolbarEvent. Snapshot is
/// Translate a backend intent into the UI-facing `ToolbarEvent`. Snapshot is
/// available for future context-sensitive mapping.
pub fn intent_to_event(intent: ToolbarIntent, _snapshot: Option<&ToolbarSnapshot>) -> ToolbarEvent {
let _ = _snapshot;
+1 -1
View File
@@ -2500,7 +2500,7 @@ enabled = true
/// The historical `full` alias for the regular mode table must keep its
/// authored spelling on an unrelated save, and the retired nested field must
/// classify under the path serde_ignored actually emits.
/// classify under the path `serde_ignored` actually emits.
#[test]
fn retired_full_alias_show_settings_section_is_diagnosed_and_spelling_preserved() {
let temp = TempConfig::new("retired-full-alias");
+2 -2
View File
@@ -55,11 +55,11 @@ pub struct TabletInputConfig {
#[serde(default = "default_pressure_thickness_scale_step")]
pub pressure_thickness_scale_step: f64,
/// Binding for the primary barrel button (BTN_STYLUS / button 331).
/// Binding for the primary barrel button (`BTN_STYLUS` / button 331).
#[serde(default = "default_stylus_button")]
pub stylus_button: StylusButtonBinding,
/// Binding for the secondary barrel button (BTN_STYLUS2 / button 332).
/// Binding for the secondary barrel button (`BTN_STYLUS2` / button 332).
#[serde(default = "default_stylus_button2")]
pub stylus_button2: StylusButtonBinding,
}
+1 -1
View File
@@ -94,7 +94,7 @@ pub struct UiConfig {
pub show_floating_badge: bool,
/// Show the board/page badge even when the status bar is visible
/// (renamed from show_page_badge_with_status_bar for clarity)
/// (renamed from `show_page_badge_with_status_bar` for clarity)
#[serde(
default = "default_show_page_badge_with_status_bar",
alias = "show_page_badge_with_status_bar"
+1 -1
View File
@@ -75,7 +75,7 @@ pub(crate) fn open(invocation: &DesktopOpenInvocation) -> Result<()> {
}
/// Spawn a desktop opener without blocking the Wayland or tray callback that
/// requested it. The broker still authorizes the argv; DetachedAfterExec keeps
/// requested it. The broker still authorizes the argv; `DetachedAfterExec` keeps
/// the launched application alive after this process exits.
///
/// Callers that own the process broker must join the returned worker before
+1 -1
View File
@@ -85,7 +85,7 @@ impl Frame {
frame
}
/// Copy exactly the newest undo/redo entries retained by clamp_history_depth,
/// Copy exactly the newest undo/redo entries retained by `clamp_history_depth`,
/// without first allocating copies of discarded actions or their payloads.
#[must_use]
pub fn clone_with_history_limit(&self, limit: usize) -> Self {
+1 -1
View File
@@ -40,7 +40,7 @@ impl InputState {
/// Handles all keyboard input including:
/// - Drawing color selection (configurable keybindings)
/// - Tool actions (text mode, clear, undo - configurable)
/// - Text input (when in TextInput state)
/// - Text input (when in `TextInput` state)
/// - Exit commands (configurable)
/// - Thickness adjustment (configurable)
/// - Help toggle (configurable)
@@ -1,4 +1,4 @@
//! Color picker popup state methods for InputState.
//! Color picker popup state methods for `InputState`.
use crate::draw::TextMeasurer;
use std::borrow::Cow;
+1 -1
View File
@@ -1,4 +1,4 @@
//! Canvas mutation transactions. InputState applies UI and persistence effects.
//! Canvas mutation transactions. `InputState` applies UI and persistence effects.
use std::collections::HashSet;
use crate::draw::frame::{Frame, ShapeSnapshot, UndoAction};
+4 -4
View File
@@ -32,16 +32,16 @@ enum CellCoverage {
Global,
}
/// Spatial grid for efficient hit-testing using ShapeId instead of indices.
/// Spatial grid for efficient hit-testing using `ShapeId` instead of indices.
///
/// This allows incremental updates when shapes are added, removed, or modified
/// without needing to rebuild the entire grid.
#[derive(Debug, Clone)]
pub(in crate::input::state::core) struct SpatialGrid {
cell_size: i32,
/// Maps cell coordinates to the ShapeIds contained in that cell.
/// Maps cell coordinates to the `ShapeIds` contained in that cell.
cells: HashMap<(i32, i32), Vec<ShapeId>>,
/// Reverse mapping from ShapeId to the cells it occupies for efficient removal.
/// Reverse mapping from `ShapeId` to the cells it occupies for efficient removal.
shape_cells: HashMap<ShapeId, Vec<(i32, i32)>>,
/// Shapes kept as global candidates because their coverage is unsafe or
/// oversized, or because the aggregate membership budget is exhausted.
@@ -199,7 +199,7 @@ impl SpatialGrid {
}
}
/// Queries for all ShapeIds in cells near the given point with tolerance-aware radius.
/// Queries for all `ShapeIds` in cells near the given point with tolerance-aware radius.
///
/// The search radius is expanded based on tolerance to ensure shapes that could
/// be hit within the tolerance distance are not missed.
+1 -1
View File
@@ -60,7 +60,7 @@ pub enum RadialMenuState {
/// Identifies a segment in the radial menu for hit-testing.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum RadialSegmentId {
/// Primary compass-ring segment (index 0..TOOL_SEGMENT_COUNT, N = 0,
/// Primary compass-ring segment (index `0..TOOL_SEGMENT_COUNT`, N = 0,
/// clockwise).
Tool(u8),
/// Sub-ring child segment (parent index, child index).
+3 -3
View File
@@ -25,7 +25,7 @@ enum SelectionState {
None,
Active {
shape_ids: Vec<ShapeId>,
/// Cached HashSet for O(1) membership tests during rendering.
/// Cached `HashSet` for O(1) membership tests during rendering.
shape_ids_set: HashSet<ShapeId>,
},
}
@@ -156,8 +156,8 @@ impl InputState {
self.selection_interaction.selected_shape_ids()
}
/// Returns a reference to the cached HashSet of selected shape IDs.
/// Use this for O(1) membership tests instead of creating a new HashSet.
/// Returns a reference to the cached `HashSet` of selected shape IDs.
/// Use this for O(1) membership tests instead of creating a new `HashSet`.
pub fn selected_shape_ids_set(&self) -> Option<&HashSet<ShapeId>> {
self.selection_interaction.selected_shape_ids_set()
}
+2 -2
View File
@@ -10,7 +10,7 @@ use crate::input::boards::PendingBoardRuntimeUiAction;
impl InputState {
/// Test convenience for inspecting shortcut edits. Production drains the
/// ordered InputEffect stream and forwards edits to the config worker.
/// ordered `InputEffect` stream and forwards edits to the config worker.
pub(crate) fn take_pending_keybinding_edits(&mut self) -> Vec<KeybindingEditRequest> {
self.input_effects
.drain_all(InputEffectKind::KeybindingEdit)
@@ -22,7 +22,7 @@ impl InputState {
.collect()
}
/// Test convenience for inspecting board actions in the InputEffect stream.
/// Test convenience for inspecting board actions in the `InputEffect` stream.
pub(crate) fn take_pending_board_runtime_ui_actions(
&mut self,
) -> Vec<PendingBoardRuntimeUiAction> {
+1 -1
View File
@@ -114,7 +114,7 @@ impl InputState {
///
/// # Behavior
/// - Left click while Idle: Starts drawing with the current tool (based on modifiers)
/// - Left click during TextInput: Updates text position
/// - Left click during `TextInput`: Updates text position
/// - Right click: Cancels current action
#[allow(dead_code)] // Retained for older callers that only have canvas coordinates.
pub fn on_mouse_press(&mut self, button: MouseButton, x: i32, y: i32) {
+1 -1
View File
@@ -1,4 +1,4 @@
//! IME (zwp_text_input_v3) composition state-machine tests. These queue
//! IME (`zwp_text_input_v3`) composition state-machine tests. These queue
//! composition events on `TextEditing`, apply each batch through the root
//! `ime_apply_done` coordinator, and assert the caret-aware editor buffer and
//! transient preedit follow the protocol's batch-then-done model.
+1 -1
View File
@@ -2,7 +2,7 @@
//! Sources: tag v0.9.25 and commit a2bb723a. The generator below was added to
//! each archive as an integration test and run alone with
//! `cargo test --locked --no-default-features -- --ignored --exact --test-threads=1`.
//! COMPAT_FIXTURE_OUT selected an empty output directory. The v0.9.25 generator omits
//! `COMPAT_FIXTURE_OUT` selected an empty output directory. The v0.9.25 generator omits
//! BoardSnapshot.appearance because that revision does not have the field.
//!
//! Historical fixture generator:
@@ -1,6 +1,6 @@
//! Runs one GTK test behind a private headless Weston with one frame event withheld.
//!
//! All protocol messages and SCM_RIGHTS descriptors pass through unchanged, except
//! All protocol messages and `SCM_RIGHTS` descriptors pass through unchanged, except
//! the selected popup callback and its `delete_id` event. The protocol tables
//! compiled into `wayland-client` and `wayland-protocols` provide opcodes and
//! new-object types; this fixture neither renders nor invents feedback.
+1 -1
View File
@@ -247,7 +247,7 @@ impl TopBar {
/// A presets-island slot button: a filled slot draws the saved tool
/// glyph in the neutral foreground with the preset color as a separate
/// corner swatch in a DrawingArea child, so a dark preset color never
/// corner swatch in a `DrawingArea` child, so a dark preset color never
/// renders the glyph invisible against the slot body. An empty slot shows
/// its 1-based number as a plain label.
/// Clicking applies a filled slot or saves the current setup into an empty
+1 -1
View File
@@ -259,7 +259,7 @@ fn release_window_keyboard_focus(widget: &impl IsA<gtk4::Widget>) {
/// Whether a focus-widget change should drop the toolbar window's keyboard
/// mode. Entries keep it: the editable hex field needs the keys it captures.
/// Focus inside a popover keeps it too, for a different reason: the popover
/// is an xdg_popup holding a keyboard grab on its own surface. Dropping the
/// is an `xdg_popup` holding a keyboard grab on its own surface. Dropping the
/// parent layer surface's keyboard mode there makes the compositor pull
/// keyboard focus from the grabbing popup between a click's press and
/// release, and that broken grab stalls the release — a Settings checkbox
@@ -3,7 +3,7 @@ use std::f64::consts::PI;
use crate::ui::constants::{self, TEXT_TERTIARY, TEXT_WHITE};
use crate::ui::theme::{ACCENT_RGB, Rgb};
/// Delete-icon circle: softer than DESTRUCTIVE_RGB — the small filled disc
/// Delete-icon circle: softer than `DESTRUCTIVE_RGB` — the small filled disc
/// reads harsh at full saturation (kept from the pre-theme literal).
const DELETE_ICON_RGB: Rgb = (0.85, 0.2, 0.2);
/// Rename-icon circle: neutral gray with no matching theme token.
+1 -1
View File
@@ -40,7 +40,7 @@ const INDICATOR_OUTLINE: Rgba = (0.0, 0.0, 0.0, 0.4);
/// `theme::toolbar::COLOR_SWATCH_HAIRLINE_DARK`.
const SWATCH_BORDER_ON_DARK: Rgba = (0.5, 0.5, 0.5, 0.8);
const SWATCH_BORDER_ON_LIGHT: Rgba = (0.2, 0.2, 0.2, 0.6);
/// Validation-error red for the hex field (softer than DESTRUCTIVE_RGB).
/// Validation-error red for the hex field (softer than `DESTRUCTIVE_RGB`).
const HEX_INVALID_GLOW: Rgba = (0.9, 0.3, 0.3, 0.25);
const HEX_INVALID_BORDER: Rgba = (0.9, 0.35, 0.3, 0.9);
/// Hex input border when unfocused.
+1 -1
View File
@@ -9,7 +9,7 @@ use super::constants::{
RADIUS_PANEL, RADIUS_SM, SHADOW, TEXT_DISABLED, TEXT_HINT, TEXT_PRIMARY,
};
/// Footer hint text: slightly brighter than TEXT_TERTIARY so the key hints
/// Footer hint text: slightly brighter than `TEXT_TERTIARY` so the key hints
/// stay legible inside the menu (kept from pre-theme literals).
const HINT_FOOTER_TEXT: Rgba = (0.65, 0.68, 0.75, 1.0);
/// Accent bar on the parent row of an open submenu.
+1 -1
View File
@@ -665,7 +665,7 @@ fn draw_annular_sector(
// ── Slice content resolution (ActionMeta registry) ──
/// Short label of a compass slice, resolved through the ActionMeta registry
/// Short label of a compass slice, resolved through the `ActionMeta` registry
/// for action slices.
fn slice_label(slice: &RadialSlice) -> &'static str {
match slice.kind {
+7 -7
View File
@@ -11,8 +11,8 @@
//! The zoom-out/in marks are drawn as bold vector +/- strokes (not circled
//! glyphs), sized to the `NN%` digits and using the same adaptive chip color.
//! Buttons dispatch through the shared zoom action path:
//! minus = ZoomOut, plus = ZoomIn, `Reset` = ResetZoom (back to 100%), and — only
//! while zoom is active — a compact `Lock` toggle = ToggleZoomLock. The `NN%`
//! minus = `ZoomOut`, plus = `ZoomIn`, `Reset` = `ResetZoom` (back to 100%), and — only
//! while zoom is active — a compact `Lock` toggle = `ToggleZoomLock`. The `NN%`
//! readout is a passive display (it consumes clicks but triggers nothing), so
//! no drag ever starts on the canvas beneath the chip.
@@ -78,13 +78,13 @@ fn zoom_lock_label() -> &'static str {
/// Interactive surface a zoom chip button activates on click.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ZoomChipButtonKind {
/// Bold vector minus mark — dispatches ZoomOut.
/// Bold vector minus mark — dispatches `ZoomOut`.
Out,
/// Bold vector plus mark — dispatches ZoomIn.
/// Bold vector plus mark — dispatches `ZoomIn`.
In,
/// `Reset` — dispatches ResetZoom (back to 100%).
/// `Reset` — dispatches `ResetZoom` (back to 100%).
Reset,
/// `Lock` — dispatches ToggleZoomLock (present only while zoomed).
/// `Lock` — dispatches `ToggleZoomLock` (present only while zoomed).
Lock,
}
@@ -1031,7 +1031,7 @@ mod tests {
/// Reconciliation invariant (M8): outside Focus Mode, exactly one zoom-%
/// indicator shows while zoomed in every
/// {show_zoom_actions}×{show_zoom_chip}×{show_status_bar} combination —
/// `show_zoom_actions` × `show_zoom_chip` × `show_status_bar` combination —
/// never zero (the regression), never two. The chip and the status-HUD ZOOM
/// badge come from their real layouts; the passive top-corner badge follows
/// the backend render gate (`zoom_active && !show_status_bar &&
+1 -1
View File
@@ -468,7 +468,7 @@ pub mod toolbar {
/// Segmented control outer background
pub const COLOR_SEGMENT_BG: Rgba = (0.15, 0.17, 0.22, 0.85);
/// Active segment background: the accent at reduced alpha, deliberately
/// quieter than COLOR_ACCENT so segmented-control selection (Ico/Txt,
/// quieter than `COLOR_ACCENT` so segmented-control selection (Ico/Txt,
/// Simple/Full) never competes with the active-tool highlight
pub const COLOR_SEGMENT_ACTIVE: Rgba = rgba(ACCENT_RGB, 0.55);
/// Active segment text color
+1 -1
View File
@@ -305,7 +305,7 @@ pub enum ToolbarEvent {
/// Toggle page counter in the status bar
ToggleStatusPageBadge(bool),
/// Toggle the board/page badge when the status bar is visible
/// (renamed from TogglePageBadgeWithStatusBar for clarity)
/// (renamed from `TogglePageBadgeWithStatusBar` for clarity)
ToggleFloatingBadgeAlways(bool),
/// Set toolbar layout mode
SetToolbarLayoutMode(ToolbarLayoutMode),
+3 -3
View File
@@ -152,12 +152,12 @@ pub(crate) enum StylePillControl {
EraserModeSegment,
/// Docked selection property rendered as a compact cycle button that
/// shows the entry's value; clicking steps the property forward
/// through the properties apply machinery (Color, Fill, ArrowHead,
/// TextBackground).
/// through the properties apply machinery (Color, Fill, `ArrowHead`,
/// `TextBackground`).
SelectionCycle(SelectionPropertyKind),
/// Docked numeric selection property rendered as a −/value/+ stepper;
/// the halves step the property through the properties apply
/// machinery (Thickness, FontSize, ArrowLength, ArrowAngle). The
/// machinery (Thickness, `FontSize`, `ArrowLength`, `ArrowAngle`). The
/// machinery is relative (direction steps), so the pill uses steppers
/// where the tool states use sliders.
SelectionStepper(SelectionPropertyKind),
+1 -1
View File
@@ -26,7 +26,7 @@ pub enum ToolOptionsKind {
Shape,
/// Arrow tool: thickness + labels toggle + counter
Arrow,
/// StepMarker tool: size + counter
/// `StepMarker` tool: size + counter
StepMarker,
/// Spotlight tool: magnification only
Spotlight,