file manager
git clone https://git.lucas.co/cce-files.git
fix(controls): breadcrumb and search field at the toolkit's heights
The breadcrumb, whose segments are button plates, was a crate constant
of 24px; it now asks button_height() at the one site every page lays it
out from, so the graph pane and Space map follow a config change. The
browse page's search field was a hand-set 26px; it is textbox_height(),
like the chooser's name box.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/main.rs | 2 +-
src/pages/browse.rs | 7 ++++---
src/pages/mod.rs | 15 ++++++++++-----
3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/src/main.rs b/src/main.rs
index f1aa8ae..06e1e95 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -13,7 +13,7 @@ use cce_files::pages::browse::is_project_dir;
// ── Layout constants ────────────────────────────────────────────────
-const ROW_H: f32 = 24.0; // context-menu / breadcrumb row height
+const ROW_H: f32 = 24.0; // context-menu row height
const DIALOG_W: f32 = 400.0;
const DIALOG_H: f32 = 160.0;
const MENU_MIN_W: f32 = 120.0;
diff --git a/src/pages/browse.rs b/src/pages/browse.rs
index 8f11e79..5ccfc6a 100644
--- a/src/pages/browse.rs
+++ b/src/pages/browse.rs
@@ -229,7 +229,7 @@ pub fn view(state: &mut BrowseState, cx: f32, cy: f32, cw: f32, ch: f32, select_
let client_h = ch - 2.0 * margin;
layout.init(client_x, client_y, client_w, client_h);
- let breadcrumb_h = crate::pages::BREADCRUMB_H;
+ let breadcrumb_h = crate::pages::breadcrumb_h();
let textbox_h = cce_ui::layout::textbox_height();
// 1. Allocate and render the Breadcrumb, where every page puts it.
@@ -335,8 +335,9 @@ pub fn view(state: &mut BrowseState, cx: f32, cy: f32, cw: f32, ch: f32, select_
// Dissolved List (Phase 6z): scroll state, rows, and frame prims are app-owned.
// When the search strip is open it reserves the bottom of the frame, exactly as
- // the legacy List::set_rect carved its scroll frame.
- let search_h = 26.0;
+ // the legacy List::set_rect carved its scroll frame. The search field is
+ // the toolkit's textbox height, like the chooser's name box below.
+ let search_h = textbox_h;
// The strip stands off the well's rim (and the rows above it) by the
// pane rung, on both axes.
let search_pad = cce_ui::layout::plate_padding();
diff --git a/src/pages/mod.rs b/src/pages/mod.rs
index c787961..91c091e 100644
--- a/src/pages/mod.rs
+++ b/src/pages/mod.rs
@@ -38,8 +38,12 @@ impl Page {
}
}
-/// The breadcrumb's height on every page.
-pub const BREADCRUMB_H: f32 = 24.0;
+/// The breadcrumb's height on every page. Its segments are button plates, so
+/// it is one button tall: the toolkit's control height (as the widget's own
+/// `intrinsic_size` says), not a number of this crate's.
+pub fn breadcrumb_h() -> f32 {
+ cce_ui::layout::button_height()
+}
/// Lay out, render and carve a page's breadcrumb: the pane's full width along
/// its top edge, the same on every page, so switching views leaves it where it
@@ -56,10 +60,11 @@ pub fn breadcrumb_header(
cw: f32,
ctx: &mut cce_ui::context::UiContext,
) -> f32 {
- cce_ui::layout::render_widget(pc, breadcrumb, cx, cy, cw, BREADCRUMB_H, ctx);
- let rect = cce_ui::scene::layout::Rect { x: cx, y: cy, width: cw, height: BREADCRUMB_H };
+ let h = breadcrumb_h();
+ cce_ui::layout::render_widget(pc, breadcrumb, cx, cy, cw, h, ctx);
+ let rect = cce_ui::scene::layout::Rect { x: cx, y: cy, width: cw, height: h };
breadcrumb_relief(pc, breadcrumb, rect);
- cy + BREADCRUMB_H + cce_ui::layout::root_plate_gap()
+ cy + h + cce_ui::layout::root_plate_gap()
}
/// Mirror the breadcrumb's relief into a flat-path [`PageContent`]: the