mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-04 16:56:59 +01:00
fix(gui): keep the photos timeline at its top across a relayout
Anchoring on the first photo row after a relayout scrolled the heading above it out of view, so the timeline opened a heading's height down.
This commit is contained in:
1 parent
ce4656e46a
commit
c3ec82392a
1 file changed
+8
-1
@@ -2210,7 +2210,14 @@ pub(crate) fn schedule_relayout(ui: &Rc<Ui>) {
|
||||
/// topmost visible row's first photo is remembered, and the row that holds it
|
||||
/// afterwards is put back at the same height in the viewport.
|
||||
pub(crate) fn relayout_gallery(ui: &Rc<Ui>) {
|
||||
let anchor = top_anchor(ui);
|
||||
// At the very top there is nothing to hold on to: the first photo row sits
|
||||
// under a heading, and anchoring on it would scroll that heading away.
|
||||
let at_top = ui
|
||||
.gallery
|
||||
.list
|
||||
.vadjustment()
|
||||
.is_none_or(|adj| adj.value() < 1.0);
|
||||
let anchor = if at_top { None } else { top_anchor(ui) };
|
||||
repaint_gallery(ui);
|
||||
let Some((anchor, offset)) = anchor else {
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user