parent
40e0f29003
commit
129d1cfc7a
3 changed files with 89 additions and 0 deletions
|
|
@ -283,6 +283,41 @@
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkShortcutsGroup">
|
||||||
|
<property name="title" translatable="yes" context="shortcut window">Editing</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkShortcutsShortcut">
|
||||||
|
<property name="title" translatable="yes" context="shortcut window">Rotate Clockwise</property>
|
||||||
|
<property name="accelerator"><Ctrl>R</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkShortcutsShortcut">
|
||||||
|
<property name="title" translatable="yes" context="shortcut window">Rotate Counterclockwise</property>
|
||||||
|
<property name="accelerator"><Ctrl><Shift>R</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkShortcutsShortcut">
|
||||||
|
<property name="title" translatable="yes" context="shortcut window">Mirror Horizontally</property>
|
||||||
|
<property name="accelerator">H</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkShortcutsShortcut">
|
||||||
|
<property name="title" translatable="yes" context="shortcut window">Mirror Vertically</property>
|
||||||
|
<property name="accelerator">V</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkShortcutsShortcut">
|
||||||
|
<property name="title" translatable="yes" context="shortcut window">Apply Crop</property>
|
||||||
|
<property name="accelerator"><Ctrl>Return</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,8 @@ pub enum LpOrientation {
|
||||||
|
|
||||||
mod imp {
|
mod imp {
|
||||||
|
|
||||||
|
use gtk::gdk;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[derive(Debug, Default, gtk::CompositeTemplate, glib::Properties)]
|
#[derive(Debug, Default, gtk::CompositeTemplate, glib::Properties)]
|
||||||
|
|
@ -105,6 +107,56 @@ mod imp {
|
||||||
klass.install_action("edit-crop.apply-crop", None, |obj, _, _| {
|
klass.install_action("edit-crop.apply-crop", None, |obj, _, _| {
|
||||||
obj.imp().apply_crop()
|
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>) {
|
fn instance_init(obj: &glib::subclass::InitializingObject<Self>) {
|
||||||
|
|
|
||||||
|
|
@ -194,6 +194,8 @@ mod imp {
|
||||||
|
|
||||||
#[template_child]
|
#[template_child]
|
||||||
selection_move: TemplateChild<gtk::GestureDrag>,
|
selection_move: TemplateChild<gtk::GestureDrag>,
|
||||||
|
#[template_child]
|
||||||
|
shortcuts: TemplateChild<gtk::ShortcutController>,
|
||||||
|
|
||||||
#[template_child]
|
#[template_child]
|
||||||
selection_overlay: TemplateChild<gtk::Overlay>,
|
selection_overlay: TemplateChild<gtk::Overlay>,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue