imageView: Hide controls after mouse inactivity

Closes #25

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/189>
This commit is contained in:
Sophie Herold 2023-04-20 02:32:41 +02:00 • committed by Marge Bot
parent 7b6ee24651
commit 916514604c
4 changed files with 180 additions and 10 deletions

View file

@ -65,9 +65,14 @@ mod imp {
/// overlayed controls
#[template_child]
pub(super) controls_box_start: TemplateChild<gtk::Widget>,
#[template_child]
pub(super) controls_box_start_events: TemplateChild<gtk::EventControllerMotion>,
/// overlayed controls
#[template_child]
pub(super) controls_box_end: TemplateChild<gtk::Widget>,
#[template_child]
pub(super) controls_box_end_events: TemplateChild<gtk::EventControllerMotion>,
#[template_child]
pub sliding_view: TemplateChild<LpSlidingView>,
@ -413,6 +418,22 @@ impl LpImageView {
self.imp().sliding_view.clone()
}
pub fn controls_box_start(&self) -> gtk::Widget {
self.imp().controls_box_start.clone()
}
pub fn controls_box_start_events(&self) -> gtk::EventControllerMotion {
self.imp().controls_box_start_events.clone()
}
pub fn controls_box_end(&self) -> gtk::Widget {
self.imp().controls_box_end.clone()
}
pub fn controls_box_end_events(&self) -> gtk::EventControllerMotion {
self.imp().controls_box_end_events.clone()
}
fn model(&self) -> LpFileModel {
self.imp().model.borrow().clone()
}