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:
parent
32468c2758
commit
22bf19ddd3
1 changed files with 0 additions and 17 deletions
|
|
@ -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;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue