Skip to content

Commit 091ecc0

Browse files
RMANOVclaude
andcommitted
fix(ui): eliminate empty space — measure content via cursor, not min_rect
min_rect() on CentralPanel returns the panel's allocated rect (= window size), so the window never shrank. Now use cursor.y - max_rect.top to get actual content extent. Also remove with_resizable(false) which blocked ViewportCommand::InnerSize on some Wayland compositors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6a7f225 commit 091ecc0

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

crates/ui/src/app.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -939,9 +939,9 @@ impl eframe::App for LauncherApp {
939939
self.show_add_dialog = true;
940940
}
941941

942-
// Adaptive height: resize viewport to fit content
943-
let content_h = ui.min_rect().height();
944-
let chrome_padding = 32.0; // CentralPanel frame margins
942+
// Adaptive height: cursor.y = bottom of last widget, max_rect.top = panel top
943+
let content_h = ui.cursor().min.y - ui.max_rect().min.y;
944+
let chrome_padding = 16.0;
945945
let max_height = 800.0_f32;
946946
let desired = (content_h + chrome_padding).min(max_height).max(60.0);
947947
if content_h > 10.0 && (desired - self.last_height).abs() > 2.0 {
@@ -983,8 +983,7 @@ pub fn run_popup(
983983
.with_position([position.0 as f32, position.1 as f32])
984984
.with_decorations(false)
985985
.with_transparent(true)
986-
.with_always_on_top()
987-
.with_resizable(false),
986+
.with_always_on_top(),
988987
..Default::default()
989988
};
990989

0 commit comments

Comments
 (0)