file manager
git clone https://git.lucas.co/cce-files.git
fix: selection bar clipped out of chooser mode by viewport clipping
The Select/Cancel bar was emitted into the page-content bucket, which is
clipped to the content viewport. In select mode the viewport ends exactly
where the bar begins, so the divider and both buttons were discarded and
never became clickable. Emit the bar into window_pc (window chrome, not
viewport-clipped) instead.
Broken since c6ae187, which introduced viewport clipping.
Co-Authored-By: Claude Fable 5 <[email protected]>
src/main.rs | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/main.rs b/src/main.rs
index 7ecdfd3..5115f11 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -523,11 +523,13 @@ impl FilesystemApp {
}
}
- // Draw bottom selection bar if select_mode is enabled
+ // Draw bottom selection bar if select_mode is enabled. It lives below the
+ // content region, so it goes into window_pc: page content (pc) is clipped
+ // to the viewport and would swallow the bar entirely.
if self.select_mode {
let bar_y = self.height as f32 - select_bar_h - 16.0;
// Divider line
- pc.rect([0.15, 0.20, 0.16, 1.0], browse_x, bar_y, usable_w, 1.0);
+ window_pc.rect([0.15, 0.20, 0.16, 1.0], browse_x, bar_y, usable_w, 1.0);
let accent = [0.36, 0.56, 0.38, 1.0];
let text_fg = [0.83, 0.83, 0.83, 1.0];
@@ -537,7 +539,7 @@ impl FilesystemApp {
// Cancel button
let cancel_x = self.width as f32 - 180.0;
- pc.button(
+ window_pc.button(
"Cancel",
cancel_x,
btn_y,
@@ -552,7 +554,7 @@ impl FilesystemApp {
// Open/Select/Save button
let open_x = self.width as f32 - 100.0;
let button_label = if self.save_mode { "Save" } else { "Select" };
- pc.button(
+ window_pc.button(
button_label,
open_x,
btn_y,