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:
parent
e5fc4bc85c
commit
7b7ece1dc3
3 changed files with 18 additions and 25 deletions
|
|
@ -165,14 +165,17 @@ mod imp {
|
|||
if page_position == (scroll_position + position_shift).floor()
|
||||
|| page_position == (scroll_position + position_shift).ceil()
|
||||
{
|
||||
page.set_visible(true);
|
||||
page.set_child_visible(true);
|
||||
let transform = gsk::Transform::new().translate(&graphene::Point::new(x, 0.));
|
||||
page.allocate(width, height, 0, Some(transform));
|
||||
} else {
|
||||
page.set_visible(false);
|
||||
page.set_child_visible(false);
|
||||
}
|
||||
|
||||
let transform = gsk::Transform::new().translate(&graphene::Point::new(x, 0.));
|
||||
page.allocate(width, height, 0, Some(transform));
|
||||
page.image().allocate(width, height, 0, None);
|
||||
if !page.scrolled_window().is_mapped() {
|
||||
// SVG needs to know a widget size before rendering something in LpImage
|
||||
page.scrolled_window().allocate(width, height, 0, None);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue