From 22bf19ddd37b5bc1a662422c3b70b06b557308b6 Mon Sep 17 00:00:00 2001 From: wfx Date: Wed, 4 Feb 2026 18:19:44 +0100 Subject: [PATCH] refactor: Remove redundant keyboard handlers from crop_overlay widget Keyboard events (Enter/Escape) are already handled globally in app.rs subscription and work correctly with Crop mode detection. Widget-level keyboard events don't work without focus anyway. Only mouse events (click, drag, double-click) stay in the widget. --- src/ui/widgets/crop_overlay.rs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/ui/widgets/crop_overlay.rs b/src/ui/widgets/crop_overlay.rs index c3f57b8..aef274f 100644 --- a/src/ui/widgets/crop_overlay.rs +++ b/src/ui/widgets/crop_overlay.rs @@ -14,7 +14,6 @@ use cosmic::{ widget::Tree, }, event::{Event, Status}, - keyboard, mouse::{self, Button, Cursor}, }, }; @@ -371,22 +370,6 @@ impl Widget for CropOverlay { return Status::Captured; } } - Event::Keyboard(keyboard::Event::KeyPressed { - key: keyboard::Key::Named(keyboard::key::Named::Enter), - .. - }) => { - if self.selection.has_selection() { - shell.publish(AppMessage::ApplyCrop); - return Status::Captured; - } - } - Event::Keyboard(keyboard::Event::KeyPressed { - key: keyboard::Key::Named(keyboard::key::Named::Escape), - .. - }) => { - shell.publish(AppMessage::CancelCrop); - return Status::Captured; - } _ => {} }