image: Add double click for zoom/fullscreen
Zooms on touchscreens and fullscreens otherwise. Using the fullscreen behavior for now, since that's what a lot of other apps do.
This commit is contained in:
parent
aa7a2dfd93
commit
169dd454cc
3 changed files with 40 additions and 4 deletions
|
|
@ -49,7 +49,7 @@ mod imp {
|
|||
#[template_child]
|
||||
pub(super) popover: TemplateChild<gtk::PopoverMenu>,
|
||||
#[template_child]
|
||||
pub(super) click_gesture: TemplateChild<gtk::GestureClick>,
|
||||
pub(super) right_click_gesture: TemplateChild<gtk::GestureClick>,
|
||||
#[template_child]
|
||||
pub(super) press_gesture: TemplateChild<gtk::GestureLongPress>,
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ mod imp {
|
|||
|
||||
self.parent_constructed();
|
||||
|
||||
self.click_gesture
|
||||
self.right_click_gesture
|
||||
.connect_pressed(clone!(@weak obj => move |gesture, _, x, y| {
|
||||
obj.show_popover_at(x, y);
|
||||
gesture.set_state(gtk::EventSequenceState::Claimed);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue