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.
This commit is contained in:
wfx 2026-02-04 18:19:44 +01:00
parent 32468c2758
commit 22bf19ddd3

View file

@ -14,7 +14,6 @@ use cosmic::{
widget::Tree,
},
event::{Event, Status},
keyboard,
mouse::{self, Button, Cursor},
},
};
@ -371,22 +370,6 @@ impl Widget<AppMessage, cosmic::Theme, Renderer> 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;
}
_ => {}
}