From 6c3a50ce7fd8ac6611a5dbb1db106d515ef5ba51 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Mon, 28 Sep 2026 23:57:13 +0200 Subject: [PATCH] fix(gui): let the Sync page use the full width The transfer label did not ellipsize, so a long file name set the column's minimum width and pushed it past the clamp. The page width changed with every file. The label now ellipsizes in the middle, and the Sync page drops the clamp so Overview and Folders fill the space next to the sidebar. --- crates/pdfs-gui/src/app/pages/locations.rs | 16 +++++++++------- crates/pdfs-gui/src/app/pages/status.rs | 6 +++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/crates/pdfs-gui/src/app/pages/locations.rs b/crates/pdfs-gui/src/app/pages/locations.rs index a789c71..77524b0 100644 --- a/crates/pdfs-gui/src/app/pages/locations.rs +++ b/crates/pdfs-gui/src/app/pages/locations.rs @@ -262,20 +262,22 @@ pub(crate) fn build_locations_page(history: >k4::Widget) -> (gtk4::Widget, Loc (frame.upcast(), widgets) } -/// `child` in a clamp that scrolls vertically only, with page margins. +/// `child` across the page's full width, scrolling vertically only, with page +/// margins. fn scrolled_column(child: &impl IsA) -> gtk4::ScrolledWindow { - let clamp = adw::Clamp::builder().child(child).build(); - clamp.set_margin_top(18); - clamp.set_margin_bottom(18); - clamp.set_margin_start(18); - clamp.set_margin_end(18); + let column = gtk4::Box::new(gtk4::Orientation::Vertical, 0); + column.append(child); + column.set_margin_top(18); + column.set_margin_bottom(18); + column.set_margin_start(18); + column.set_margin_end(18); // Never scroll sideways: a location's subtitle holds a full path, and letting // the row grow to fit one pushes the controls at its end off screen. // Constrained, the path ellipsizes and the controls stay reachable. gtk4::ScrolledWindow::builder() .vexpand(true) .hscrollbar_policy(gtk4::PolicyType::Never) - .child(&clamp) + .child(&column) .build() } diff --git a/crates/pdfs-gui/src/app/pages/status.rs b/crates/pdfs-gui/src/app/pages/status.rs index b2c1245..34dbd47 100644 --- a/crates/pdfs-gui/src/app/pages/status.rs +++ b/crates/pdfs-gui/src/app/pages/status.rs @@ -1069,7 +1069,11 @@ pub(crate) fn repaint_transfers(ui: &Rc, items: &[TransferItem], jobs: &[Job let row_box = gtk4::Box::new(gtk4::Orientation::Vertical, 4); row_box.set_margin_top(8); row_box.set_margin_bottom(8); - let label = gtk4::Label::builder().halign(gtk4::Align::Start).build(); + // Ellipsized so a long file name cannot widen the page. + let label = gtk4::Label::builder() + .halign(gtk4::Align::Start) + .ellipsize(gtk4::pango::EllipsizeMode::Middle) + .build(); label.add_css_class("dim-label"); let bar = gtk4::ProgressBar::new(); row_box.append(&label);