slidingView: Allocate LpImage more correctly

Allocate the ScrolledWindow instead of the LpImage
to include non-overlayed scrollbars.

General cleanup how we measure things.

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/150>
This commit is contained in:
Sophie Herold 2023-03-21 21:50:54 +01:00 • committed by Marge Bot
parent e5fc4bc85c
commit 7b7ece1dc3
3 changed files with 18 additions and 25 deletions

View file

@ -48,6 +48,8 @@ mod imp {
#[template_child]
pub(super) image_stack_page: TemplateChild<gtk::Widget>,
#[template_child]
pub(super) scrolled_window: TemplateChild<gtk::ScrolledWindow>,
#[template_child]
pub(super) image: TemplateChild<LpImage>,
#[template_child]
pub(super) popover: TemplateChild<gtk::PopoverMenu>,
@ -165,6 +167,10 @@ impl LpImagePage {
self.image().path().unwrap()
}
pub fn scrolled_window(&self) -> gtk::ScrolledWindow {
self.imp().scrolled_window.clone()
}
pub fn image(&self) -> LpImage {
self.imp().image.get()
}