git.lucas.co / cce-gallery
widget gallery and compositor test bench

commit24dd34f48b5e798499a0a3a33d60a6ed8fba5597
parent06cfbeb0b8
authorLucas Galante <[email protected]>
date2026-09-08 10:38
chore: one Checkbox exhibit again — the round mark is the only style now

Co-Authored-By: Claude Fable 5.1 <[email protected]>

 src/main.rs | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index c79a13b..c8bbc47 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -271,7 +271,7 @@ impl Visibility {
         }
         match index {
             0..=1 | 36 => true,
-            2..=7 | 20 | 21 | 26 | 27 | 37 | 39 | 40 | 42..=59 => self.page == Page::Controls,
+            2..=7 | 20 | 21 | 26 | 27 | 37 | 39 | 40 | 42..=58 => self.page == Page::Controls,
             8..=19 | 28..=35 | 38 | 41 => self.page == Page::Windows,
             22..=25 => self.page == Page::Xdg,
             _ => false,
@@ -286,7 +286,7 @@ struct PreviewStyle {
     bg_color: [f32; 4],
 }
 
-/// The gallery roster: 60 named slots. The numeric indexes used by the positions
+/// The gallery roster: 59 named slots. The numeric indexes used by the positions
 /// table, the visibility filter and the dispatch loops address these slots through
 /// `get_dyn`/`get_dyn_mut`.
 pub struct GallerySlots {
@@ -349,10 +349,9 @@ pub struct GallerySlots {
     pub ramp_preview_demo: Adapted<RampPreview>,
     pub separator_demo: Adapted<Separator>,
     pub splitter_demo: Adapted<Splitter>,
-    pub checkbox_round_demo: Adapted<Checkbox>,
 }
 
-pub const GALLERY_COUNT: usize = 60;
+pub const GALLERY_COUNT: usize = 59;
 
 impl GallerySlots {
 
@@ -418,7 +417,6 @@ impl GallerySlots {
             56 => self.ramp_preview_demo.draggable(),
             57 => self.separator_demo.draggable(),
             58 => self.splitter_demo.draggable(),
-            59 => self.checkbox_round_demo.draggable(),
             _ => panic!("gallery slot index out of range: {idx}"),
         }
     }
@@ -484,7 +482,6 @@ impl GallerySlots {
             56 => self.ramp_preview_demo.is_dragging(),
             57 => self.separator_demo.is_dragging(),
             58 => self.splitter_demo.is_dragging(),
-            59 => self.checkbox_round_demo.is_dragging(),
             _ => panic!("gallery slot index out of range: {idx}"),
         }
     }
@@ -550,7 +547,6 @@ impl GallerySlots {
             56 => &self.ramp_preview_demo,
             57 => &self.separator_demo,
             58 => &self.splitter_demo,
-            59 => &self.checkbox_round_demo,
             _ => panic!("gallery slot index out of range: {idx}"),
         }
     }
@@ -616,7 +612,6 @@ impl GallerySlots {
             56 => &mut self.ramp_preview_demo,
             57 => &mut self.separator_demo,
             58 => &mut self.splitter_demo,
-            59 => &mut self.checkbox_round_demo,
             _ => panic!("gallery slot index out of range: {idx}"),
         }
     }
@@ -868,7 +863,6 @@ impl Roster {
             56 => s.ramp_preview_demo.take_click(),
             57 => s.separator_demo.take_click(),
             58 => s.splitter_demo.take_click(),
-            59 => s.checkbox_round_demo.take_click(),
             _ => panic!("take_click: unwired gallery slot {idx}"),
         }
     }
@@ -1161,11 +1155,10 @@ impl State {
         let slh = cce_ui::layout::slider_height();
         let sph = cce_ui::layout::spinbox_height();
         let ddh = cce_ui::layout::dropdown_height();
-        let raw: [(usize, f32, f32); 30] = [
+        let raw: [(usize, f32, f32); 29] = [
             (2, 190.0, bh),                                     // Button
             (46, 190.0, 28.0),                                  // ButtonStrip
             (3, 190.0, tgh),                                    // Checkbox
-            (59, 190.0, tgh),                                   // Checkbox (round)
             (4, 190.0, tgh),                                    // Toggle
             (6, 190.0, slh),                                    // Slider
             (20, 190.0, cce_ui::layout::rangeslider_height()),  // RangeSlider
@@ -1537,11 +1530,6 @@ impl cce_ui::engine::Application for State {
                 ramp_preview_demo: RampPreview::new().with_label("RampPreview"),
                 separator_demo: Separator::new(0.0, 0.0, 200.0, 1.0, [0.5, 0.5, 0.6, 1.0]).with_label("Separator"),
                 splitter_demo: Splitter::new(200.0).with_label("Splitter"),
-                checkbox_round_demo: {
-                    let mut c = Checkbox::new().with_label("Checkbox (round)");
-                    c.set_round(true);
-                    c
-                },
             }))
         };
 
@@ -2288,7 +2276,7 @@ impl cce_ui::engine::Application for State {
                         } else if self.roster.take_click(40) {
                             spawn_editor("Ramp");
                         } else {
-                            for i in [2, 3, 4, 6, 7, 20, 21, 26, 27, 43, 44, 45, 46, 47, 48, 52, 53, 54, 55, 56, 59] {
+                            for i in [2, 3, 4, 6, 7, 20, 21, 26, 27, 43, 44, 45, 46, 47, 48, 52, 53, 54, 55, 56] {
                                 if self.roster.take_click(i) {
                                     changed = true;
                                 }