parent
40e0f29003
commit
129d1cfc7a
3 changed files with 89 additions and 0 deletions
|
|
@ -60,6 +60,8 @@ pub enum LpOrientation {
|
|||
|
||||
mod imp {
|
||||
|
||||
use gtk::gdk;
|
||||
|
||||
use super::*;
|
||||
|
||||
#[derive(Debug, Default, gtk::CompositeTemplate, glib::Properties)]
|
||||
|
|
@ -105,6 +107,56 @@ mod imp {
|
|||
klass.install_action("edit-crop.apply-crop", None, |obj, _, _| {
|
||||
obj.imp().apply_crop()
|
||||
});
|
||||
|
||||
klass.add_shortcut(
|
||||
>k::Shortcut::builder()
|
||||
.action(>k::NamedAction::new("edit-crop.mirror-horizontally"))
|
||||
.trigger(>k::KeyvalTrigger::new(
|
||||
gdk::Key::H,
|
||||
gdk::ModifierType::NO_MODIFIER_MASK,
|
||||
))
|
||||
.build(),
|
||||
);
|
||||
|
||||
klass.add_shortcut(
|
||||
>k::Shortcut::builder()
|
||||
.action(>k::NamedAction::new("edit-crop.mirror-vertically"))
|
||||
.trigger(>k::KeyvalTrigger::new(
|
||||
gdk::Key::V,
|
||||
gdk::ModifierType::NO_MODIFIER_MASK,
|
||||
))
|
||||
.build(),
|
||||
);
|
||||
|
||||
klass.add_shortcut(
|
||||
>k::Shortcut::builder()
|
||||
.action(>k::NamedAction::new("edit-crop.rotate-cw"))
|
||||
.trigger(>k::KeyvalTrigger::new(
|
||||
gdk::Key::R,
|
||||
gdk::ModifierType::CONTROL_MASK,
|
||||
))
|
||||
.build(),
|
||||
);
|
||||
|
||||
klass.add_shortcut(
|
||||
>k::Shortcut::builder()
|
||||
.action(>k::NamedAction::new("edit-crop.rotate-ccw"))
|
||||
.trigger(>k::KeyvalTrigger::new(
|
||||
gdk::Key::R,
|
||||
gdk::ModifierType::CONTROL_MASK.union(gdk::ModifierType::SHIFT_MASK),
|
||||
))
|
||||
.build(),
|
||||
);
|
||||
|
||||
klass.add_shortcut(
|
||||
>k::Shortcut::builder()
|
||||
.action(>k::NamedAction::new("edit-crop.apply-crop"))
|
||||
.trigger(>k::KeyvalTrigger::new(
|
||||
gdk::Key::Return,
|
||||
gdk::ModifierType::CONTROL_MASK,
|
||||
))
|
||||
.build(),
|
||||
);
|
||||
}
|
||||
|
||||
fn instance_init(obj: &glib::subclass::InitializingObject<Self>) {
|
||||
|
|
|
|||
|
|
@ -194,6 +194,8 @@ mod imp {
|
|||
|
||||
#[template_child]
|
||||
selection_move: TemplateChild<gtk::GestureDrag>,
|
||||
#[template_child]
|
||||
shortcuts: TemplateChild<gtk::ShortcutController>,
|
||||
|
||||
#[template_child]
|
||||
selection_overlay: TemplateChild<gtk::Overlay>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue