git.lucas.co / cce-files
file manager
git clone https://git.lucas.co/cce-files.git

commit4fca2a1c5adfca6faefd86050e0f700bd722cdf1
parent2c69262b91
authorLucas Galante <[email protected]>
date2026-08-24 10:55
chooser: plain toolkit buttons, tidy right-aligned footer

The select-bar's Cancel/Save wore hand-picked red/green tints and ragged
hand-set x offsets (70px and 80px wide, hugging the raw window edge). They
now use the toolkit's own themed Button face via a new button_plain helper —
chrome buttons should look like every other DE button — at equal widths, one
gap, right-aligned to the content region with the bar's own padding.

 src/main.rs      | 40 ++++++++++------------------------------
 src/pages/mod.rs |  8 ++++++++
 2 files changed, 18 insertions(+), 30 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index 039ce5d..d88f3e1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -605,40 +605,20 @@ impl FilesystemApp {
                 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];
-
             let btn_h = cce_ui::layout::button_height();
             let btn_y = bar_y + (select_bar_h - btn_h) / 2.0;
 
-            // Cancel button
-            let cancel_x = self.width as f32 - 180.0;
-            window_pc.button(
-                "Cancel",
-                cancel_x,
-                btn_y,
-                70.0,
-                btn_h,
-                [0.25, 0.12, 0.12, 0.5],
-                [0.35, 0.15, 0.15, 0.8],
-                text_fg,
-                Message::SelectCancel,
-            );
-
-            // Open/Select/Save button
-            let open_x = self.width as f32 - 100.0;
+            // Cancel and Save/Select: equal widths, one gap, right-aligned to
+            // the content region with the bar's own padding — and the
+            // toolkit's plain button face, not hand-picked red/green tints.
+            let btn_w = 84.0;
+            let gap = 10.0;
+            let pad = cce_ui::layout::backplate_padding().max(gap);
+            let confirm_x = browse_x + usable_w - pad - btn_w;
+            let cancel_x = confirm_x - gap - btn_w;
+            window_pc.button_plain("Cancel", cancel_x, btn_y, btn_w, btn_h, Message::SelectCancel);
             let button_label = if self.save_mode { "Save" } else { "Select" };
-            window_pc.button(
-                button_label,
-                open_x,
-                btn_y,
-                80.0,
-                btn_h,
-                accent,
-                [0.46, 0.66, 0.48, 1.0],
-                [0.10, 0.16, 0.11, 1.0],
-                Message::SelectOpen,
-            );
+            window_pc.button_plain(button_label, confirm_x, btn_y, btn_w, btn_h, Message::SelectOpen);
         }
 
         // Gather all popovers
diff --git a/src/pages/mod.rs b/src/pages/mod.rs
index 024e9b2..4f74797 100644
--- a/src/pages/mod.rs
+++ b/src/pages/mod.rs
@@ -253,6 +253,14 @@ impl PageContent {
         self.buttons.push((btn, action));
     }
 
+    /// A button wearing the toolkit's own face — no per-call colors. The
+    /// hand-tinted variant above predates the themed Button; chrome buttons
+    /// (the chooser's Cancel/Save) should look like every other DE button.
+    pub fn button_plain(&mut self, label: &str, x: f32, y: f32, w: f32, h: f32, action: crate::Message) {
+        let btn = cce_ui::widget::Button::new(x, y, w, h).with_label(label);
+        self.buttons.push((btn, action));
+    }
+
     pub fn button_left(
         &mut self,
         label: &str,