diff --git a/config.example.toml b/config.example.toml index 3e0ebbbd..bbceb1a5 100644 --- a/config.example.toml +++ b/config.example.toml @@ -76,6 +76,7 @@ increase_marker_opacity = ["Ctrl+Alt+ArrowUp"] decrease_marker_opacity = ["Ctrl+Alt+ArrowDown"] # Tool selection shortcuts (optional; keep empty to rely on modifiers) +select_selection_tool = ["V"] select_pen_tool = ["F"] select_marker_tool = ["H"] select_eraser_tool = ["D"] @@ -825,4 +826,3 @@ copy_to_clipboard = true # When false, clipboard-only captures still auto-exit by default. # Use --no-exit-after-capture to keep the overlay open for a run. exit_after_capture = false - diff --git a/configurator/src/models/keybindings/field/config.rs b/configurator/src/models/keybindings/field/config.rs index 3a383972..ca5cd757 100644 --- a/configurator/src/models/keybindings/field/config.rs +++ b/configurator/src/models/keybindings/field/config.rs @@ -39,6 +39,7 @@ impl KeybindingField { Self::DecreaseThickness => &config.tools.decrease_thickness, Self::IncreaseMarkerOpacity => &config.tools.increase_marker_opacity, Self::DecreaseMarkerOpacity => &config.tools.decrease_marker_opacity, + Self::SelectSelectionTool => &config.tools.select_selection_tool, Self::SelectPenTool => &config.tools.select_pen_tool, Self::SelectEraserTool => &config.tools.select_eraser_tool, Self::ToggleEraserMode => &config.tools.toggle_eraser_mode, @@ -145,6 +146,7 @@ impl KeybindingField { Self::DecreaseThickness => config.tools.decrease_thickness = value, Self::IncreaseMarkerOpacity => config.tools.increase_marker_opacity = value, Self::DecreaseMarkerOpacity => config.tools.decrease_marker_opacity = value, + Self::SelectSelectionTool => config.tools.select_selection_tool = value, Self::SelectPenTool => config.tools.select_pen_tool = value, Self::SelectEraserTool => config.tools.select_eraser_tool = value, Self::ToggleEraserMode => config.tools.toggle_eraser_mode = value, diff --git a/configurator/src/models/keybindings/field/labels.rs b/configurator/src/models/keybindings/field/labels.rs index 5f90f2d5..94566deb 100644 --- a/configurator/src/models/keybindings/field/labels.rs +++ b/configurator/src/models/keybindings/field/labels.rs @@ -34,6 +34,7 @@ impl KeybindingField { Self::DecreaseThickness => "Decrease thickness", Self::IncreaseMarkerOpacity => "Increase marker opacity", Self::DecreaseMarkerOpacity => "Decrease marker opacity", + Self::SelectSelectionTool => "Select selection tool", Self::SelectPenTool => "Select pen tool", Self::SelectEraserTool => "Select eraser tool", Self::ToggleEraserMode => "Toggle eraser mode", @@ -136,6 +137,7 @@ impl KeybindingField { Self::DecreaseThickness => "decrease_thickness", Self::IncreaseMarkerOpacity => "increase_marker_opacity", Self::DecreaseMarkerOpacity => "decrease_marker_opacity", + Self::SelectSelectionTool => "select_selection_tool", Self::SelectPenTool => "select_pen_tool", Self::SelectEraserTool => "select_eraser_tool", Self::ToggleEraserMode => "toggle_eraser_mode", diff --git a/configurator/src/models/keybindings/field/list.rs b/configurator/src/models/keybindings/field/list.rs index 6dc93da4..dbcb8157 100644 --- a/configurator/src/models/keybindings/field/list.rs +++ b/configurator/src/models/keybindings/field/list.rs @@ -34,6 +34,7 @@ impl KeybindingField { Self::DecreaseThickness, Self::IncreaseMarkerOpacity, Self::DecreaseMarkerOpacity, + Self::SelectSelectionTool, Self::SelectPenTool, Self::SelectEraserTool, Self::ToggleEraserMode, diff --git a/configurator/src/models/keybindings/field/mod.rs b/configurator/src/models/keybindings/field/mod.rs index c95b0f33..e7fd8787 100644 --- a/configurator/src/models/keybindings/field/mod.rs +++ b/configurator/src/models/keybindings/field/mod.rs @@ -36,6 +36,7 @@ pub enum KeybindingField { DecreaseThickness, IncreaseMarkerOpacity, DecreaseMarkerOpacity, + SelectSelectionTool, SelectPenTool, SelectEraserTool, ToggleEraserMode, diff --git a/configurator/src/models/keybindings/field/tab.rs b/configurator/src/models/keybindings/field/tab.rs index 1303c7fd..76d490c6 100644 --- a/configurator/src/models/keybindings/field/tab.rs +++ b/configurator/src/models/keybindings/field/tab.rs @@ -23,7 +23,8 @@ impl KeybindingField { | Self::SetColorPink | Self::SetColorWhite | Self::SetColorBlack => KeybindingsTabId::Drawing, - Self::SelectPenTool + Self::SelectSelectionTool + | Self::SelectPenTool | Self::SelectEraserTool | Self::ToggleEraserMode | Self::SelectMarkerTool diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 698f53f5..132517fa 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -703,6 +703,7 @@ increase_marker_opacity = ["Ctrl+Alt+ArrowUp"] decrease_marker_opacity = ["Ctrl+Alt+ArrowDown"] # Tool selection shortcuts (optional; keep empty to rely on modifiers) +select_selection_tool = ["V"] select_pen_tool = ["F"] select_marker_tool = ["H"] select_eraser_tool = ["D"] diff --git a/src/backend/wayland/state/helpers.rs b/src/backend/wayland/state/helpers.rs index 74071ae7..e4a1cb98 100644 --- a/src/backend/wayland/state/helpers.rs +++ b/src/backend/wayland/state/helpers.rs @@ -90,7 +90,10 @@ pub(in crate::backend::wayland) fn debug_toolbar_drag_logging_enabled() -> bool pub(in crate::backend::wayland) fn toolbar_pointer_lock_enabled() -> bool { static ENABLED: OnceLock = OnceLock::new(); *ENABLED.get_or_init(|| { - parse_boolish_env(&std::env::var("WAYSCRIBER_TOOLBAR_POINTER_LOCK").unwrap_or_default()) + // Default ON: without pointer lock, layer-shell toolbar drags jitter/flicker as surfaces move. + parse_boolish_env( + &std::env::var("WAYSCRIBER_TOOLBAR_POINTER_LOCK").unwrap_or_else(|_| "1".into()), + ) }) } diff --git a/src/backend/wayland/state/toolbar/events.rs b/src/backend/wayland/state/toolbar/events.rs index 79e2c036..f163acac 100644 --- a/src/backend/wayland/state/toolbar/events.rs +++ b/src/backend/wayland/state/toolbar/events.rs @@ -4,19 +4,23 @@ impl WaylandState { /// Returns a snapshot of the current input state for toolbar UI consumption. pub(in crate::backend::wayland) fn toolbar_snapshot(&self) -> ToolbarSnapshot { let hints = ToolbarBindingHints::from_input_state(&self.input_state); - let show_drawer_hint = - !self.onboarding.state().drawer_hint_shown && !self.input_state.toolbar_drawer_open; + let hint_max = crate::onboarding::DRAWER_HINT_MAX; + let show_drawer_hint = self.onboarding.state().drawer_hint_count < hint_max + && !self.input_state.toolbar_drawer_open; ToolbarSnapshot::from_input_with_options(&self.input_state, hints, show_drawer_hint) } /// Applies an incoming toolbar event and schedules redraws as needed. pub(in crate::backend::wayland) fn handle_toolbar_event(&mut self, event: ToolbarEvent) { // Mark drawer hint as shown when user opens the drawer - if matches!(event, ToolbarEvent::ToggleDrawer(true)) - && !self.onboarding.state().drawer_hint_shown - { - self.onboarding.state_mut().drawer_hint_shown = true; - self.onboarding.save(); + let hint_max = crate::onboarding::DRAWER_HINT_MAX; + if matches!(event, ToolbarEvent::ToggleDrawer(true)) { + let state = self.onboarding.state_mut(); + if state.drawer_hint_count < hint_max { + state.drawer_hint_count = state.drawer_hint_count.saturating_add(1); + state.drawer_hint_shown = state.drawer_hint_count >= hint_max; + self.onboarding.save(); + } } match event { diff --git a/src/backend/wayland/toolbar/render/side_palette/colors.rs b/src/backend/wayland/toolbar/render/side_palette/colors.rs index b28dc271..5e0c4736 100644 --- a/src/backend/wayland/toolbar/render/side_palette/colors.rs +++ b/src/backend/wayland/toolbar/render/side_palette/colors.rs @@ -2,6 +2,7 @@ use super::{ColorSectionInfo, SidePaletteLayout}; use crate::backend::wayland::toolbar::events::HitKind; use crate::backend::wayland::toolbar::hit::HitRegion; use crate::backend::wayland::toolbar::layout::ToolbarLayoutSpec; +use crate::config::Action; use crate::draw::{BLACK, BLUE, Color, GREEN, ORANGE, PINK, RED, WHITE, YELLOW}; use crate::toolbar_icons; use crate::ui::toolbar::ToolbarEvent; @@ -27,17 +28,17 @@ pub(super) fn draw_colors_section(layout: &mut SidePaletteLayout, y: &mut f64) - size: FONT_SIZE_LABEL, }; - let basic_colors: &[(Color, &str)] = &[ - (RED, "Red"), - (GREEN, "Green"), - (BLUE, "Blue"), - (YELLOW, "Yellow"), - (WHITE, "White"), - (BLACK, "Black"), + let basic_colors: &[(Color, &str, Option)] = &[ + (RED, "Red", Some(Action::SetColorRed)), + (GREEN, "Green", Some(Action::SetColorGreen)), + (BLUE, "Blue", Some(Action::SetColorBlue)), + (YELLOW, "Yellow", Some(Action::SetColorYellow)), + (WHITE, "White", Some(Action::SetColorWhite)), + (BLACK, "Black", Some(Action::SetColorBlack)), ]; - let extended_colors: &[(Color, &str)] = &[ - (ORANGE, "Orange"), - (PINK, "Pink"), + let extended_colors: &[(Color, &str, Option)] = &[ + (ORANGE, "Orange", Some(Action::SetColorOrange)), + (PINK, "Pink", Some(Action::SetColorPink)), ( Color { r: 0.0, @@ -46,6 +47,7 @@ pub(super) fn draw_colors_section(layout: &mut SidePaletteLayout, y: &mut f64) - a: 1.0, }, "Cyan", + None, ), ( Color { @@ -55,6 +57,7 @@ pub(super) fn draw_colors_section(layout: &mut SidePaletteLayout, y: &mut f64) - a: 1.0, }, "Purple", + None, ), ( Color { @@ -64,6 +67,7 @@ pub(super) fn draw_colors_section(layout: &mut SidePaletteLayout, y: &mut f64) - a: 1.0, }, "Gray", + None, ), ]; @@ -98,13 +102,15 @@ pub(super) fn draw_colors_section(layout: &mut SidePaletteLayout, y: &mut f64) - let mut cx = x; let mut row_y = picker_y + picker_h + 8.0; - for (color, _name) in basic_colors { + for (color, name, action) in basic_colors { draw_swatch(ctx, cx, row_y, swatch, *color, *color == snapshot.color); + let binding = action.and_then(|action| snapshot.binding_hints.binding_for_action(action)); + let tooltip = crate::backend::wayland::toolbar::format_binding_label(name, binding); hits.push(HitRegion { rect: (cx, row_y, swatch, swatch), event: ToolbarEvent::SetColor(*color), kind: HitKind::Click, - tooltip: None, + tooltip: Some(tooltip), }); cx += swatch + swatch_gap; } @@ -132,13 +138,16 @@ pub(super) fn draw_colors_section(layout: &mut SidePaletteLayout, y: &mut f64) - if snapshot.show_more_colors { cx = x; - for (color, _name) in extended_colors { + for (color, name, action) in extended_colors { draw_swatch(ctx, cx, row_y, swatch, *color, *color == snapshot.color); + let binding = + action.and_then(|action| snapshot.binding_hints.binding_for_action(action)); + let tooltip = crate::backend::wayland::toolbar::format_binding_label(name, binding); hits.push(HitRegion { rect: (cx, row_y, swatch, swatch), event: ToolbarEvent::SetColor(*color), kind: HitKind::Click, - tooltip: None, + tooltip: Some(tooltip), }); cx += swatch + swatch_gap; } diff --git a/src/backend/wayland/toolbar/render/side_palette/header.rs b/src/backend/wayland/toolbar/render/side_palette/header.rs index dfc4aae1..dafc34bc 100644 --- a/src/backend/wayland/toolbar/render/side_palette/header.rs +++ b/src/backend/wayland/toolbar/render/side_palette/header.rs @@ -114,8 +114,8 @@ pub(super) fn draw_header(layout: &mut SidePaletteLayout) -> f64 { let icon_x = more_x + (btn_size - icon_size) / 2.0; let icon_y = header_btn_y + (btn_size - icon_size) / 2.0; toolbar_icons::draw_icon_more(ctx, icon_x, icon_y, icon_size); - // Draw attention dot when drawer is closed - if !snapshot.drawer_open { + // Draw attention dot only for the onboarding hint + if snapshot.show_drawer_hint { let dot_radius = 4.0; let dot_x = more_x + btn_size - dot_radius - 2.0; let dot_y = header_btn_y + dot_radius + 2.0; diff --git a/src/backend/wayland/toolbar/render/widgets/tooltip.rs b/src/backend/wayland/toolbar/render/widgets/tooltip.rs index 95fe1bae..069edf4d 100644 --- a/src/backend/wayland/toolbar/render/widgets/tooltip.rs +++ b/src/backend/wayland/toolbar/render/widgets/tooltip.rs @@ -42,15 +42,16 @@ pub(in crate::backend::wayland::toolbar::render) fn draw_tooltip( let gap = SPACING_STD; // Determine if tooltip should render above or below - // If rendering below would extend past panel height, render above instead + // If rendering below would extend past panel height, render above only when there's room. let render_above = if above { true } else { let below_y = hit.rect.1 + hit.rect.3 + gap + tooltip_h; - below_y > panel_height - SPACING_MD + let space_above = hit.rect.1 - tooltip_h - gap >= SPACING_MD; + below_y > panel_height - SPACING_MD && space_above }; - let tooltip_y = if render_above { + let mut tooltip_y = if render_above { hit.rect.1 - tooltip_h - gap } else { hit.rect.1 + hit.rect.3 + gap @@ -62,6 +63,17 @@ pub(in crate::backend::wayland::toolbar::render) fn draw_tooltip( if tooltip_x + tooltip_w > panel_width - SPACING_MD { tooltip_x = panel_width - tooltip_w - SPACING_MD; } + let min_y = SPACING_MD; + let max_y = panel_height - tooltip_h - SPACING_MD; + if max_y >= min_y { + if tooltip_y < min_y { + tooltip_y = min_y; + } else if tooltip_y > max_y { + tooltip_y = max_y; + } + } else { + tooltip_y = min_y; + } let shadow_offset = SPACING_XS; set_color(ctx, COLOR_TOOLTIP_SHADOW); diff --git a/src/config/action_meta/entries/colors.rs b/src/config/action_meta/entries/colors.rs index e5a2c185..ff958998 100644 --- a/src/config/action_meta/entries/colors.rs +++ b/src/config/action_meta/entries/colors.rs @@ -9,7 +9,7 @@ pub const ENTRIES: &[ActionMeta] = &[ Colors, true, true, - false + true ), meta!( SetColorGreen, @@ -19,7 +19,7 @@ pub const ENTRIES: &[ActionMeta] = &[ Colors, true, true, - false + true ), meta!( SetColorBlue, @@ -29,7 +29,7 @@ pub const ENTRIES: &[ActionMeta] = &[ Colors, true, true, - false + true ), meta!( SetColorYellow, @@ -39,7 +39,7 @@ pub const ENTRIES: &[ActionMeta] = &[ Colors, true, true, - false + true ), meta!( SetColorOrange, @@ -49,7 +49,7 @@ pub const ENTRIES: &[ActionMeta] = &[ Colors, true, true, - false + true ), meta!( SetColorPink, @@ -59,7 +59,7 @@ pub const ENTRIES: &[ActionMeta] = &[ Colors, true, true, - false + true ), meta!( SetColorWhite, @@ -69,7 +69,7 @@ pub const ENTRIES: &[ActionMeta] = &[ Colors, true, true, - false + true ), meta!( SetColorBlack, @@ -79,6 +79,6 @@ pub const ENTRIES: &[ActionMeta] = &[ Colors, true, true, - false + true ), ]; diff --git a/src/config/action_meta/entries/tools.rs b/src/config/action_meta/entries/tools.rs index 8484542c..97479840 100644 --- a/src/config/action_meta/entries/tools.rs +++ b/src/config/action_meta/entries/tools.rs @@ -21,6 +21,16 @@ pub const ENTRIES: &[ActionMeta] = &[ true, true ), + meta!( + SelectSelectionTool, + "Selection Tool", + Some("Select"), + "Select and move items", + Tools, + true, + true, + true + ), meta!( SelectPenTool, "Pen Tool", diff --git a/src/config/action_meta/tests.rs b/src/config/action_meta/tests.rs index acee10db..888840f7 100644 --- a/src/config/action_meta/tests.rs +++ b/src/config/action_meta/tests.rs @@ -36,6 +36,7 @@ const HELP_ACTIONS: &[Action] = &[ Action::SetColorPink, Action::SetColorWhite, Action::SetColorBlack, + Action::SelectSelectionTool, Action::SelectPenTool, Action::SelectLineTool, Action::SelectRectTool, @@ -88,6 +89,7 @@ const TOOLBAR_ACTIONS: &[Action] = &[ Action::SelectRectTool, Action::SelectEllipseTool, Action::SelectArrowTool, + Action::SelectSelectionTool, Action::SelectMarkerTool, Action::SelectHighlightTool, Action::SelectEraserTool, @@ -137,6 +139,7 @@ const PALETTE_ACTIONS: &[Action] = &[ Action::ClearCanvas, Action::Undo, Action::Redo, + Action::SelectSelectionTool, Action::SelectPenTool, Action::SelectLineTool, Action::SelectRectTool, diff --git a/src/config/keybindings/actions.rs b/src/config/keybindings/actions.rs index b01ad760..ea81c171 100644 --- a/src/config/keybindings/actions.rs +++ b/src/config/keybindings/actions.rs @@ -41,6 +41,7 @@ pub enum Action { DecreaseThickness, IncreaseMarkerOpacity, DecreaseMarkerOpacity, + SelectSelectionTool, SelectMarkerTool, SelectEraserTool, ToggleEraserMode, diff --git a/src/config/keybindings/config/map/tools.rs b/src/config/keybindings/config/map/tools.rs index 3da5b706..870b978d 100644 --- a/src/config/keybindings/config/map/tools.rs +++ b/src/config/keybindings/config/map/tools.rs @@ -17,6 +17,10 @@ impl KeybindingsConfig { &self.tools.decrease_marker_opacity, Action::DecreaseMarkerOpacity, )?; + inserter.insert_all( + &self.tools.select_selection_tool, + Action::SelectSelectionTool, + )?; inserter.insert_all(&self.tools.select_marker_tool, Action::SelectMarkerTool)?; inserter.insert_all(&self.tools.select_eraser_tool, Action::SelectEraserTool)?; inserter.insert_all(&self.tools.toggle_eraser_mode, Action::ToggleEraserMode)?; diff --git a/src/config/keybindings/config/types/bindings/tools.rs b/src/config/keybindings/config/types/bindings/tools.rs index 6bce8f47..bfbc90fb 100644 --- a/src/config/keybindings/config/types/bindings/tools.rs +++ b/src/config/keybindings/config/types/bindings/tools.rs @@ -17,6 +17,9 @@ pub struct ToolKeybindingsConfig { #[serde(default = "default_decrease_marker_opacity")] pub decrease_marker_opacity: Vec, + #[serde(default = "default_select_selection_tool")] + pub select_selection_tool: Vec, + #[serde(default = "default_select_marker_tool")] pub select_marker_tool: Vec, @@ -64,6 +67,7 @@ impl Default for ToolKeybindingsConfig { decrease_thickness: default_decrease_thickness(), increase_marker_opacity: default_increase_marker_opacity(), decrease_marker_opacity: default_decrease_marker_opacity(), + select_selection_tool: default_select_selection_tool(), select_marker_tool: default_select_marker_tool(), select_eraser_tool: default_select_eraser_tool(), toggle_eraser_mode: default_toggle_eraser_mode(), diff --git a/src/config/keybindings/defaults/tools.rs b/src/config/keybindings/defaults/tools.rs index 0c2702bf..cf3d7d5b 100644 --- a/src/config/keybindings/defaults/tools.rs +++ b/src/config/keybindings/defaults/tools.rs @@ -14,6 +14,10 @@ pub(crate) fn default_decrease_marker_opacity() -> Vec { vec!["Ctrl+Alt+ArrowDown".to_string()] } +pub(crate) fn default_select_selection_tool() -> Vec { + vec!["V".to_string()] +} + pub(crate) fn default_select_marker_tool() -> Vec { vec!["H".to_string()] } diff --git a/src/input/state/actions/action_tools.rs b/src/input/state/actions/action_tools.rs index c743a577..43ced145 100644 --- a/src/input/state/actions/action_tools.rs +++ b/src/input/state/actions/action_tools.rs @@ -43,6 +43,9 @@ impl InputState { Action::DecreaseMarkerOpacity => { self.set_marker_opacity(self.marker_opacity - 0.05); } + Action::SelectSelectionTool => { + self.set_tool_override(Some(Tool::Select)); + } Action::SelectMarkerTool => { self.set_tool_override(Some(Tool::Marker)); } diff --git a/src/onboarding.rs b/src/onboarding.rs index d2ed8311..7fd3b652 100644 --- a/src/onboarding.rs +++ b/src/onboarding.rs @@ -7,6 +7,7 @@ use std::path::{Path, PathBuf}; use std::time::{SystemTime, UNIX_EPOCH}; const ONBOARDING_VERSION: u32 = 2; +pub(crate) const DRAWER_HINT_MAX: u32 = 2; const ONBOARDING_FILE: &str = "onboarding.toml"; const ONBOARDING_DIR: &str = "wayscriber"; @@ -24,6 +25,9 @@ pub struct OnboardingState { /// Whether the "More" drawer hint has been shown #[serde(default)] pub drawer_hint_shown: bool, + /// Number of times the drawer hint has been acknowledged (opened) + #[serde(default)] + pub drawer_hint_count: u32, } impl Default for OnboardingState { @@ -34,6 +38,7 @@ impl Default for OnboardingState { toolbar_hint_shown: false, tour_shown: false, drawer_hint_shown: false, + drawer_hint_count: 0, } } } @@ -64,6 +69,14 @@ impl OnboardingStore { state.version = ONBOARDING_VERSION; needs_save = true; } + if state.drawer_hint_count == 0 && state.drawer_hint_shown { + state.drawer_hint_count = DRAWER_HINT_MAX; + needs_save = true; + } + if state.drawer_hint_count >= DRAWER_HINT_MAX && !state.drawer_hint_shown { + state.drawer_hint_shown = true; + needs_save = true; + } let store = Self { state, path: Some(path), @@ -175,6 +188,7 @@ fn recover_onboarding_file(path: &Path, _raw: Option<&str>) -> OnboardingState { toolbar_hint_shown, tour_shown: true, // Don't show tour for recovered state drawer_hint_shown: true, // Don't show drawer hint for recovered state + drawer_hint_count: DRAWER_HINT_MAX, }; let store = OnboardingStore { state: state.clone(), diff --git a/src/ui/help_overlay/sections/builder.rs b/src/ui/help_overlay/sections/builder.rs index 3039502f..e4508934 100644 --- a/src/ui/help_overlay/sections/builder.rs +++ b/src/ui/help_overlay/sections/builder.rs @@ -183,6 +183,10 @@ pub(crate) fn build_section_sets( let selection_section = Section { title: "Selection", rows: vec![ + row( + binding_or_fallback(bindings, Action::SelectSelectionTool, NOT_BOUND_LABEL), + action_label(Action::SelectSelectionTool), + ), row("Drag", "Selection tool"), row( binding_or_fallback(bindings, Action::SelectAll, NOT_BOUND_LABEL), diff --git a/src/ui/toolbar/bindings.rs b/src/ui/toolbar/bindings.rs index a15c9cc6..65224a78 100644 --- a/src/ui/toolbar/bindings.rs +++ b/src/ui/toolbar/bindings.rs @@ -50,6 +50,7 @@ impl ToolbarBindingHints { pub(crate) fn action_for_tool(tool: Tool) -> Option { match tool { + Tool::Select => Some(Action::SelectSelectionTool), Tool::Pen => Some(Action::SelectPenTool), Tool::Line => Some(Action::SelectLineTool), Tool::Rect => Some(Action::SelectRectTool), @@ -58,7 +59,6 @@ pub(crate) fn action_for_tool(tool: Tool) -> Option { Tool::Marker => Some(Action::SelectMarkerTool), Tool::Highlight => Some(Action::SelectHighlightTool), Tool::Eraser => Some(Action::SelectEraserTool), - Tool::Select => None, } }