mirror of
https://github.com/devmobasa/wayscriber.git
synced 2026-11-01 07:36:42 +01:00
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:
1 parent
9c4336c645
commit
2b21ff1d80
50 files changed
+77
-72
No files matched your search
@@ -35,6 +35,7 @@ wildcard_imports = "warn"
|
|||||||
# Pedantic lints, adopted one at a time. Most of them have machine-applicable
|
# Pedantic lints, adopted one at a time. Most of them have machine-applicable
|
||||||
# fixes, so `cargo clippy --fix` can apply them.
|
# fixes, so `cargo clippy --fix` can apply them.
|
||||||
cast_lossless = "warn"
|
cast_lossless = "warn"
|
||||||
|
doc_markdown = "warn"
|
||||||
map_unwrap_or = "warn"
|
map_unwrap_or = "warn"
|
||||||
uninlined_format_args = "warn"
|
uninlined_format_args = "warn"
|
||||||
|
|
||||||
|
|||||||
@@ -14,3 +14,7 @@ disallowed-methods = [
|
|||||||
{ path = "std::sync::Mutex::clear_poison", reason = "a poisoned lock may hold broken invariants" },
|
{ 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" },
|
{ 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", ".."]
|
||||||
@@ -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
|
/// advertises this as its Wayland app-id, so compositor rules and the
|
||||||
/// `.desktop` `StartupWMClass` must match it.
|
/// `.desktop` `StartupWMClass` must match it.
|
||||||
const APP_ID: &str = "org.wayscriber.Configurator";
|
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
|
/// If they are still attached when the parent is destroyed, GTK warns on
|
||||||
/// finalize. Unparent in the destroy handler so shutdown stays quiet.
|
/// finalize. Unparent in the destroy handler so shutdown stays quiet.
|
||||||
pub(super) fn unparent_on_destroy(parent: &impl IsA<gtk::Widget>, popover: >k::Popover) {
|
pub(super) fn unparent_on_destroy(parent: &impl IsA<gtk::Widget>, popover: >k::Popover) {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ pub(in crate::backend::wayland) fn validate_shm_buffer_layout(
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl FrozenImage {
|
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.
|
/// WLR screencopy buffers are returned in output framebuffer coordinates.
|
||||||
/// Frozen/zoom rendering paints them onto a logical surface, so rotated or
|
/// Frozen/zoom rendering paints them onto a logical surface, so rotated or
|
||||||
|
|||||||
@@ -547,7 +547,7 @@ impl OutputGeometry {
|
|||||||
/// Crop origin inside a portal/desktop screenshot of `image_width` ×
|
/// Crop origin inside a portal/desktop screenshot of `image_width` ×
|
||||||
/// `image_height`.
|
/// `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
|
/// missing, `(0, 0)` is inferred only when topology proves there is a
|
||||||
/// single output and the image is that output's physical size.
|
/// 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)> {
|
pub fn portal_crop_origin(&self, image_width: u32, image_height: u32) -> Option<(u32, u32)> {
|
||||||
|
|||||||
@@ -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::os::fd::OwnedFd;
|
||||||
use std::sync::Arc;
|
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)
|
xkb::Keymap::new_from_names(&context, "", "", "", "", None, xkb::KEYMAP_COMPILE_NO_FLAGS)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// evdev KEY_LEFTCTRL.
|
/// evdev `KEY_LEFTCTRL`.
|
||||||
const CTRL_KEYCODE: u32 = 29;
|
const CTRL_KEYCODE: u32 = 29;
|
||||||
|
|
||||||
/// A press/release pair is reported to xkb once per *keycode*, not once
|
/// A press/release pair is reported to xkb once per *keycode*, not once
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//! Session persistence bookkeeping for per-output snapshots.
|
//! Session persistence bookkeeping for per-output snapshots.
|
||||||
//!
|
//!
|
||||||
//! Tracks the current session options and whether a snapshot has been loaded
|
//! 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;
|
use std::mem;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
//! last displayed - not just regions from the current frame.
|
//! last displayed - not just regions from the current frame.
|
||||||
//!
|
//!
|
||||||
//! This module tracks damage per buffer slot, identified by the canvas memory address.
|
//! 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.
|
//! serves as a stable slot identifier across buffer reuse.
|
||||||
//!
|
//!
|
||||||
//! A pool generation counter handles pool recreation (due to resize, scale change,
|
//! 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.
|
/// Tracks dirty regions for each buffer slot independently.
|
||||||
///
|
///
|
||||||
/// Buffers are identified by their canvas memory address, which is stable
|
/// 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
|
/// Pool identity (generation + size) detects when the pool is recreated or
|
||||||
/// grows, which invalidates all previous canvas pointers.
|
/// 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.
|
/// 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.
|
/// all previous canvas pointers become invalid due to memory remapping.
|
||||||
fn check_pool_identity(&mut self, generation: u64, pool_size: usize) {
|
fn check_pool_identity(&mut self, generation: u64, pool_size: usize) {
|
||||||
let pool_changed = generation != self.pool_generation;
|
let pool_changed = generation != self.pool_generation;
|
||||||
@@ -217,12 +217,12 @@ impl BufferDamageTracker {
|
|||||||
/// Takes damage regions for the buffer identified by its canvas pointer.
|
/// Takes damage regions for the buffer identified by its canvas pointer.
|
||||||
///
|
///
|
||||||
/// The canvas pointer (memory address of the first byte) serves as a stable
|
/// 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
|
/// Pool identity (generation + size) is checked first - if the pool was
|
||||||
/// recreated or grew, all tracking is reset since previous pointers are invalid.
|
/// 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.
|
/// Otherwise returns and clears the slot's accumulated damage.
|
||||||
pub fn take_buffer_damage_report(
|
pub fn take_buffer_damage_report(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ impl WaylandState {
|
|||||||
self.exit_overlay_suppression(OverlaySuppression::DesktopBackdrop);
|
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) {
|
pub(in crate::backend::wayland) fn handle_capture_action(&mut self, action: Action) {
|
||||||
if action.is_region_capture() {
|
if action.is_region_capture() {
|
||||||
if let Some(opening_action) = self.capture.active_region_action() {
|
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.
|
/// 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.
|
/// callback responsible only for translating Ctrl+A into one state action.
|
||||||
pub(in crate::backend::wayland) fn submit_whole_region_capture(&mut self) {
|
pub(in crate::backend::wayland) fn submit_whole_region_capture(&mut self) {
|
||||||
let Some(RegionSelectionFinalize::Selected { purpose, rect }) =
|
let Some(RegionSelectionFinalize::Selected { purpose, rect }) =
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ pub(super) enum ProfileMode {
|
|||||||
CanvasAndUi,
|
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)]
|
#[derive(Debug)]
|
||||||
pub(super) struct FrameProfile {
|
pub(super) struct FrameProfile {
|
||||||
profile: Option<RenderColorProfile>,
|
profile: Option<RenderColorProfile>,
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ mod tests {
|
|||||||
assert!(by + bubble_h <= 600.0, "clamped within bottom edge");
|
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 {
|
fn has_strong_green_pixel(pixels: &[u8]) -> bool {
|
||||||
pixels.as_chunks::<4>().0.iter().any(|px| {
|
pixels.as_chunks::<4>().0.iter().any(|px| {
|
||||||
let (b, g, r, a) = (px[0], px[1], px[2], px[3]);
|
let (b, g, r, a) = (px[0], px[1], px[2], px[3]);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//! Layer-surface management for the Wayland backend.
|
//! Layer-surface management for the Wayland backend.
|
||||||
//!
|
//!
|
||||||
//! This module owns the wl_surface/layer surface handle and the shm slot
|
//! This module owns the `wl_surface`, its layer-surface handle, and the shm slot
|
||||||
//! pool. WaylandState asks SurfaceState for buffers and size information
|
//! pool. `WaylandState` asks `SurfaceState` for buffers and size information
|
||||||
//! instead of juggling the raw objects directly.
|
//! instead of juggling the raw objects directly.
|
||||||
|
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
@@ -152,12 +152,12 @@ impl SurfaceState {
|
|||||||
self.frame_callbacks.clear();
|
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> {
|
pub fn wl_surface(&self) -> Option<&wl_surface::WlSurface> {
|
||||||
self.wl_surface.as_ref()
|
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 {
|
pub fn is_surface(&self, surface: &wl_surface::WlSurface) -> bool {
|
||||||
self.wl_surface
|
self.wl_surface
|
||||||
.as_ref()
|
.as_ref()
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
use wayland_protocols::wp::tablet::zv2::client::zwp_tablet_tool_v2::Type;
|
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)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub enum TabletToolType {
|
pub enum TabletToolType {
|
||||||
/// Pen tool (0x140)
|
/// Pen tool (0x140)
|
||||||
@@ -43,7 +43,7 @@ impl TabletToolType {
|
|||||||
/// Protocol value for lens tool
|
/// Protocol value for lens tool
|
||||||
const LENS_VALUE: u32 = 0x147;
|
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 {
|
pub fn from_raw(value: u32) -> Self {
|
||||||
match value {
|
match value {
|
||||||
Self::PEN_VALUE => TabletToolType::Pen,
|
Self::PEN_VALUE => TabletToolType::Pen,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ pub struct HitRegion {
|
|||||||
const ROW_HIT_LENGTH: f64 = MIN_HIT_TARGET * 3.0;
|
const ROW_HIT_LENGTH: f64 = MIN_HIT_TARGET * 3.0;
|
||||||
|
|
||||||
/// Shared pointer-target predicate: true when (x, y) lands inside `rect`
|
/// 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.
|
/// 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 {
|
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);
|
let (rx, ry, rw, rh) = rect_with_min_target(rect);
|
||||||
|
|||||||
@@ -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
|
/// 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.
|
/// while no menu popover is open.
|
||||||
pub fn top_popover_scroll_bounds(
|
pub fn top_popover_scroll_bounds(
|
||||||
engine: &UiTextEngine,
|
engine: &UiTextEngine,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use crate::ui_text::{UiTextEngine, UiTextStyle};
|
|||||||
use std::f64::consts::PI;
|
use std::f64::consts::PI;
|
||||||
|
|
||||||
/// Faint white glow behind a hovered flat button (quieter than
|
/// 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).
|
/// affordance, not a separator).
|
||||||
const COLOR_BUTTON_HOVER_GLOW: Rgba = (1.0, 1.0, 1.0, 0.08);
|
const COLOR_BUTTON_HOVER_GLOW: Rgba = (1.0, 1.0, 1.0, 0.08);
|
||||||
/// Warning-tinted glow behind a hovered destructive button (destructive
|
/// Warning-tinted glow behind a hovered destructive button (destructive
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ impl ToolbarSurface {
|
|||||||
self.configured = false;
|
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,
|
/// instead of destroy/recreate, so size changes (shape picker, drawer,
|
||||||
/// contextual sections) don't flicker. Rendering pauses until the
|
/// contextual sections) don't flicker. Rendering pauses until the
|
||||||
/// compositor acks with a new configure.
|
/// compositor acks with a new configure.
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ pub fn top_extra_height(engine: &UiTextEngine, snapshot: &ToolbarSnapshot) -> f6
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Scroll bounds for the open Canvas/Session/Settings popover as
|
/// 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
|
/// while no menu popover is open. The wheel path and scrollbar drag use these
|
||||||
/// same bounds.
|
/// same bounds.
|
||||||
pub fn top_popover_scroll_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
|
/// 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).
|
/// while no menu popover is open. Max scroll = (natural - viewport).max(0).
|
||||||
pub(super) fn menu_scroll_bounds_planned(
|
pub(super) fn menu_scroll_bounds_planned(
|
||||||
engine: &UiTextEngine,
|
engine: &UiTextEngine,
|
||||||
|
|||||||
@@ -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.
|
/// available for future context-sensitive mapping.
|
||||||
pub fn intent_to_event(intent: ToolbarIntent, _snapshot: Option<&ToolbarSnapshot>) -> ToolbarEvent {
|
pub fn intent_to_event(intent: ToolbarIntent, _snapshot: Option<&ToolbarSnapshot>) -> ToolbarEvent {
|
||||||
let _ = _snapshot;
|
let _ = _snapshot;
|
||||||
|
|||||||
@@ -2500,7 +2500,7 @@ enabled = true
|
|||||||
|
|
||||||
/// The historical `full` alias for the regular mode table must keep its
|
/// The historical `full` alias for the regular mode table must keep its
|
||||||
/// authored spelling on an unrelated save, and the retired nested field must
|
/// 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]
|
#[test]
|
||||||
fn retired_full_alias_show_settings_section_is_diagnosed_and_spelling_preserved() {
|
fn retired_full_alias_show_settings_section_is_diagnosed_and_spelling_preserved() {
|
||||||
let temp = TempConfig::new("retired-full-alias");
|
let temp = TempConfig::new("retired-full-alias");
|
||||||
|
|||||||
@@ -55,11 +55,11 @@ pub struct TabletInputConfig {
|
|||||||
#[serde(default = "default_pressure_thickness_scale_step")]
|
#[serde(default = "default_pressure_thickness_scale_step")]
|
||||||
pub pressure_thickness_scale_step: f64,
|
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")]
|
#[serde(default = "default_stylus_button")]
|
||||||
pub stylus_button: StylusButtonBinding,
|
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")]
|
#[serde(default = "default_stylus_button2")]
|
||||||
pub stylus_button2: StylusButtonBinding,
|
pub stylus_button2: StylusButtonBinding,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ pub struct UiConfig {
|
|||||||
pub show_floating_badge: bool,
|
pub show_floating_badge: bool,
|
||||||
|
|
||||||
/// Show the board/page badge even when the status bar is visible
|
/// 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(
|
#[serde(
|
||||||
default = "default_show_page_badge_with_status_bar",
|
default = "default_show_page_badge_with_status_bar",
|
||||||
alias = "show_page_badge_with_status_bar"
|
alias = "show_page_badge_with_status_bar"
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ pub(crate) fn open(invocation: &DesktopOpenInvocation) -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Spawn a desktop opener without blocking the Wayland or tray callback that
|
/// 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.
|
/// the launched application alive after this process exits.
|
||||||
///
|
///
|
||||||
/// Callers that own the process broker must join the returned worker before
|
/// Callers that own the process broker must join the returned worker before
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ impl Frame {
|
|||||||
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.
|
/// without first allocating copies of discarded actions or their payloads.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn clone_with_history_limit(&self, limit: usize) -> Self {
|
pub fn clone_with_history_limit(&self, limit: usize) -> Self {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ impl InputState {
|
|||||||
/// Handles all keyboard input including:
|
/// Handles all keyboard input including:
|
||||||
/// - Drawing color selection (configurable keybindings)
|
/// - Drawing color selection (configurable keybindings)
|
||||||
/// - Tool actions (text mode, clear, undo - configurable)
|
/// - Tool actions (text mode, clear, undo - configurable)
|
||||||
/// - Text input (when in TextInput state)
|
/// - Text input (when in `TextInput` state)
|
||||||
/// - Exit commands (configurable)
|
/// - Exit commands (configurable)
|
||||||
/// - Thickness adjustment (configurable)
|
/// - Thickness adjustment (configurable)
|
||||||
/// - Help toggle (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 crate::draw::TextMeasurer;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|||||||
@@ -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 std::collections::HashSet;
|
||||||
|
|
||||||
use crate::draw::frame::{Frame, ShapeSnapshot, UndoAction};
|
use crate::draw::frame::{Frame, ShapeSnapshot, UndoAction};
|
||||||
|
|||||||
@@ -32,16 +32,16 @@ enum CellCoverage {
|
|||||||
Global,
|
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
|
/// This allows incremental updates when shapes are added, removed, or modified
|
||||||
/// without needing to rebuild the entire grid.
|
/// without needing to rebuild the entire grid.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub(in crate::input::state::core) struct SpatialGrid {
|
pub(in crate::input::state::core) struct SpatialGrid {
|
||||||
cell_size: i32,
|
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>>,
|
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)>>,
|
shape_cells: HashMap<ShapeId, Vec<(i32, i32)>>,
|
||||||
/// Shapes kept as global candidates because their coverage is unsafe or
|
/// Shapes kept as global candidates because their coverage is unsafe or
|
||||||
/// oversized, or because the aggregate membership budget is exhausted.
|
/// 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
|
/// The search radius is expanded based on tolerance to ensure shapes that could
|
||||||
/// be hit within the tolerance distance are not missed.
|
/// be hit within the tolerance distance are not missed.
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ pub enum RadialMenuState {
|
|||||||
/// Identifies a segment in the radial menu for hit-testing.
|
/// Identifies a segment in the radial menu for hit-testing.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub enum RadialSegmentId {
|
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).
|
/// clockwise).
|
||||||
Tool(u8),
|
Tool(u8),
|
||||||
/// Sub-ring child segment (parent index, child index).
|
/// Sub-ring child segment (parent index, child index).
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ enum SelectionState {
|
|||||||
None,
|
None,
|
||||||
Active {
|
Active {
|
||||||
shape_ids: Vec<ShapeId>,
|
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>,
|
shape_ids_set: HashSet<ShapeId>,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -156,8 +156,8 @@ impl InputState {
|
|||||||
self.selection_interaction.selected_shape_ids()
|
self.selection_interaction.selected_shape_ids()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a reference to the cached HashSet of 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.
|
/// Use this for O(1) membership tests instead of creating a new `HashSet`.
|
||||||
pub fn selected_shape_ids_set(&self) -> Option<&HashSet<ShapeId>> {
|
pub fn selected_shape_ids_set(&self) -> Option<&HashSet<ShapeId>> {
|
||||||
self.selection_interaction.selected_shape_ids_set()
|
self.selection_interaction.selected_shape_ids_set()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use crate::input::boards::PendingBoardRuntimeUiAction;
|
|||||||
|
|
||||||
impl InputState {
|
impl InputState {
|
||||||
/// Test convenience for inspecting shortcut edits. Production drains the
|
/// 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> {
|
pub(crate) fn take_pending_keybinding_edits(&mut self) -> Vec<KeybindingEditRequest> {
|
||||||
self.input_effects
|
self.input_effects
|
||||||
.drain_all(InputEffectKind::KeybindingEdit)
|
.drain_all(InputEffectKind::KeybindingEdit)
|
||||||
@@ -22,7 +22,7 @@ impl InputState {
|
|||||||
.collect()
|
.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(
|
pub(crate) fn take_pending_board_runtime_ui_actions(
|
||||||
&mut self,
|
&mut self,
|
||||||
) -> Vec<PendingBoardRuntimeUiAction> {
|
) -> Vec<PendingBoardRuntimeUiAction> {
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ impl InputState {
|
|||||||
///
|
///
|
||||||
/// # Behavior
|
/// # Behavior
|
||||||
/// - Left click while Idle: Starts drawing with the current tool (based on modifiers)
|
/// - 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
|
/// - Right click: Cancels current action
|
||||||
#[allow(dead_code)] // Retained for older callers that only have canvas coordinates.
|
#[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) {
|
pub fn on_mouse_press(&mut self, button: MouseButton, x: i32, y: i32) {
|
||||||
|
|||||||
@@ -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
|
//! composition events on `TextEditing`, apply each batch through the root
|
||||||
//! `ime_apply_done` coordinator, and assert the caret-aware editor buffer and
|
//! `ime_apply_done` coordinator, and assert the caret-aware editor buffer and
|
||||||
//! transient preedit follow the protocol's batch-then-done model.
|
//! transient preedit follow the protocol's batch-then-done model.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
//! Sources: tag v0.9.25 and commit a2bb723a. The generator below was added to
|
//! Sources: tag v0.9.25 and commit a2bb723a. The generator below was added to
|
||||||
//! each archive as an integration test and run alone with
|
//! each archive as an integration test and run alone with
|
||||||
//! `cargo test --locked --no-default-features -- --ignored --exact --test-threads=1`.
|
//! `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.
|
//! BoardSnapshot.appearance because that revision does not have the field.
|
||||||
//!
|
//!
|
||||||
//! Historical fixture generator:
|
//! Historical fixture generator:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//! Runs one GTK test behind a private headless Weston with one frame event withheld.
|
//! 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
|
//! the selected popup callback and its `delete_id` event. The protocol tables
|
||||||
//! compiled into `wayland-client` and `wayland-protocols` provide opcodes and
|
//! compiled into `wayland-client` and `wayland-protocols` provide opcodes and
|
||||||
//! new-object types; this fixture neither renders nor invents feedback.
|
//! new-object types; this fixture neither renders nor invents feedback.
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ impl TopBar {
|
|||||||
|
|
||||||
/// A presets-island slot button: a filled slot draws the saved tool
|
/// A presets-island slot button: a filled slot draws the saved tool
|
||||||
/// glyph in the neutral foreground with the preset color as a separate
|
/// 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
|
/// renders the glyph invisible against the slot body. An empty slot shows
|
||||||
/// its 1-based number as a plain label.
|
/// its 1-based number as a plain label.
|
||||||
/// Clicking applies a filled slot or saves the current setup into an empty
|
/// Clicking applies a filled slot or saves the current setup into an empty
|
||||||
|
|||||||
@@ -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
|
/// 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.
|
/// 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
|
/// 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
|
/// parent layer surface's keyboard mode there makes the compositor pull
|
||||||
/// keyboard focus from the grabbing popup between a click's press and
|
/// keyboard focus from the grabbing popup between a click's press and
|
||||||
/// release, and that broken grab stalls the release — a Settings checkbox
|
/// 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::constants::{self, TEXT_TERTIARY, TEXT_WHITE};
|
||||||
use crate::ui::theme::{ACCENT_RGB, Rgb};
|
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).
|
/// reads harsh at full saturation (kept from the pre-theme literal).
|
||||||
const DELETE_ICON_RGB: Rgb = (0.85, 0.2, 0.2);
|
const DELETE_ICON_RGB: Rgb = (0.85, 0.2, 0.2);
|
||||||
/// Rename-icon circle: neutral gray with no matching theme token.
|
/// Rename-icon circle: neutral gray with no matching theme token.
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const INDICATOR_OUTLINE: Rgba = (0.0, 0.0, 0.0, 0.4);
|
|||||||
/// `theme::toolbar::COLOR_SWATCH_HAIRLINE_DARK`.
|
/// `theme::toolbar::COLOR_SWATCH_HAIRLINE_DARK`.
|
||||||
const SWATCH_BORDER_ON_DARK: Rgba = (0.5, 0.5, 0.5, 0.8);
|
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);
|
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_GLOW: Rgba = (0.9, 0.3, 0.3, 0.25);
|
||||||
const HEX_INVALID_BORDER: Rgba = (0.9, 0.35, 0.3, 0.9);
|
const HEX_INVALID_BORDER: Rgba = (0.9, 0.35, 0.3, 0.9);
|
||||||
/// Hex input border when unfocused.
|
/// Hex input border when unfocused.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use super::constants::{
|
|||||||
RADIUS_PANEL, RADIUS_SM, SHADOW, TEXT_DISABLED, TEXT_HINT, TEXT_PRIMARY,
|
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).
|
/// stay legible inside the menu (kept from pre-theme literals).
|
||||||
const HINT_FOOTER_TEXT: Rgba = (0.65, 0.68, 0.75, 1.0);
|
const HINT_FOOTER_TEXT: Rgba = (0.65, 0.68, 0.75, 1.0);
|
||||||
/// Accent bar on the parent row of an open submenu.
|
/// Accent bar on the parent row of an open submenu.
|
||||||
|
|||||||
@@ -665,7 +665,7 @@ fn draw_annular_sector(
|
|||||||
|
|
||||||
// ── Slice content resolution (ActionMeta registry) ──
|
// ── 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.
|
/// for action slices.
|
||||||
fn slice_label(slice: &RadialSlice) -> &'static str {
|
fn slice_label(slice: &RadialSlice) -> &'static str {
|
||||||
match slice.kind {
|
match slice.kind {
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
//! The zoom-out/in marks are drawn as bold vector +/- strokes (not circled
|
//! 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.
|
//! glyphs), sized to the `NN%` digits and using the same adaptive chip color.
|
||||||
//! Buttons dispatch through the shared zoom action path:
|
//! Buttons dispatch through the shared zoom action path:
|
||||||
//! minus = ZoomOut, plus = ZoomIn, `Reset` = ResetZoom (back to 100%), and — only
|
//! minus = `ZoomOut`, plus = `ZoomIn`, `Reset` = `ResetZoom` (back to 100%), and — only
|
||||||
//! while zoom is active — a compact `Lock` toggle = ToggleZoomLock. The `NN%`
|
//! while zoom is active — a compact `Lock` toggle = `ToggleZoomLock`. The `NN%`
|
||||||
//! readout is a passive display (it consumes clicks but triggers nothing), so
|
//! readout is a passive display (it consumes clicks but triggers nothing), so
|
||||||
//! no drag ever starts on the canvas beneath the chip.
|
//! 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.
|
/// Interactive surface a zoom chip button activates on click.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub enum ZoomChipButtonKind {
|
pub enum ZoomChipButtonKind {
|
||||||
/// Bold vector minus mark — dispatches ZoomOut.
|
/// Bold vector minus mark — dispatches `ZoomOut`.
|
||||||
Out,
|
Out,
|
||||||
/// Bold vector plus mark — dispatches ZoomIn.
|
/// Bold vector plus mark — dispatches `ZoomIn`.
|
||||||
In,
|
In,
|
||||||
/// `Reset` — dispatches ResetZoom (back to 100%).
|
/// `Reset` — dispatches `ResetZoom` (back to 100%).
|
||||||
Reset,
|
Reset,
|
||||||
/// `Lock` — dispatches ToggleZoomLock (present only while zoomed).
|
/// `Lock` — dispatches `ToggleZoomLock` (present only while zoomed).
|
||||||
Lock,
|
Lock,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1031,7 +1031,7 @@ mod tests {
|
|||||||
|
|
||||||
/// Reconciliation invariant (M8): outside Focus Mode, exactly one zoom-%
|
/// Reconciliation invariant (M8): outside Focus Mode, exactly one zoom-%
|
||||||
/// indicator shows while zoomed in every
|
/// 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
|
/// 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
|
/// badge come from their real layouts; the passive top-corner badge follows
|
||||||
/// the backend render gate (`zoom_active && !show_status_bar &&
|
/// the backend render gate (`zoom_active && !show_status_bar &&
|
||||||
|
|||||||
+1
-1
@@ -468,7 +468,7 @@ pub mod toolbar {
|
|||||||
/// Segmented control outer background
|
/// Segmented control outer background
|
||||||
pub const COLOR_SEGMENT_BG: Rgba = (0.15, 0.17, 0.22, 0.85);
|
pub const COLOR_SEGMENT_BG: Rgba = (0.15, 0.17, 0.22, 0.85);
|
||||||
/// Active segment background: the accent at reduced alpha, deliberately
|
/// 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
|
/// Simple/Full) never competes with the active-tool highlight
|
||||||
pub const COLOR_SEGMENT_ACTIVE: Rgba = rgba(ACCENT_RGB, 0.55);
|
pub const COLOR_SEGMENT_ACTIVE: Rgba = rgba(ACCENT_RGB, 0.55);
|
||||||
/// Active segment text color
|
/// Active segment text color
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ pub enum ToolbarEvent {
|
|||||||
/// Toggle page counter in the status bar
|
/// Toggle page counter in the status bar
|
||||||
ToggleStatusPageBadge(bool),
|
ToggleStatusPageBadge(bool),
|
||||||
/// Toggle the board/page badge when the status bar is visible
|
/// Toggle the board/page badge when the status bar is visible
|
||||||
/// (renamed from TogglePageBadgeWithStatusBar for clarity)
|
/// (renamed from `TogglePageBadgeWithStatusBar` for clarity)
|
||||||
ToggleFloatingBadgeAlways(bool),
|
ToggleFloatingBadgeAlways(bool),
|
||||||
/// Set toolbar layout mode
|
/// Set toolbar layout mode
|
||||||
SetToolbarLayoutMode(ToolbarLayoutMode),
|
SetToolbarLayoutMode(ToolbarLayoutMode),
|
||||||
|
|||||||
@@ -152,12 +152,12 @@ pub(crate) enum StylePillControl {
|
|||||||
EraserModeSegment,
|
EraserModeSegment,
|
||||||
/// Docked selection property rendered as a compact cycle button that
|
/// Docked selection property rendered as a compact cycle button that
|
||||||
/// shows the entry's value; clicking steps the property forward
|
/// shows the entry's value; clicking steps the property forward
|
||||||
/// through the properties apply machinery (Color, Fill, ArrowHead,
|
/// through the properties apply machinery (Color, Fill, `ArrowHead`,
|
||||||
/// TextBackground).
|
/// `TextBackground`).
|
||||||
SelectionCycle(SelectionPropertyKind),
|
SelectionCycle(SelectionPropertyKind),
|
||||||
/// Docked numeric selection property rendered as a −/value/+ stepper;
|
/// Docked numeric selection property rendered as a −/value/+ stepper;
|
||||||
/// the halves step the property through the properties apply
|
/// 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
|
/// machinery is relative (direction steps), so the pill uses steppers
|
||||||
/// where the tool states use sliders.
|
/// where the tool states use sliders.
|
||||||
SelectionStepper(SelectionPropertyKind),
|
SelectionStepper(SelectionPropertyKind),
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ pub enum ToolOptionsKind {
|
|||||||
Shape,
|
Shape,
|
||||||
/// Arrow tool: thickness + labels toggle + counter
|
/// Arrow tool: thickness + labels toggle + counter
|
||||||
Arrow,
|
Arrow,
|
||||||
/// StepMarker tool: size + counter
|
/// `StepMarker` tool: size + counter
|
||||||
StepMarker,
|
StepMarker,
|
||||||
/// Spotlight tool: magnification only
|
/// Spotlight tool: magnification only
|
||||||
Spotlight,
|
Spotlight,
|
||||||
|
|||||||
Reference in new issue
Block a user