From bbfbcda742cb1a7c0592d76e154a3ce9ed4c2801 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 30 Nov 2026 03:23:44 +0000 Subject: [PATCH] BarItems: a checked command's item shows on A bar item whose command is checked got the toggle face, but its part carried no checked state, so the face painted off and the node did not read on (DeckCraft's Home in the Quick Access Toolbar while Home is open). The item's part now takes the checked flag. Co-Authored-By: Claude Opus 5.5 --- crates/ui-widgets/src/bars/items.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/ui-widgets/src/bars/items.rs b/crates/ui-widgets/src/bars/items.rs index c7852e12bb..b1b7953cf3 100644 --- a/crates/ui-widgets/src/bars/items.rs +++ b/crates/ui-widgets/src/bars/items.rs @@ -14,7 +14,7 @@ use crate::runtime::env::Label; use crate::style::{ComponentStyle, FocusLook, GlyphRole, StyleCx}; use craft_behavior::fit::{FitItem, FitKeep, fit_items}; use craft_behavior::{Axis, IconId, Metrics, NavShape, PartKey, PartRef, Proposal, Roving, Sense}; -use craft_theme::Variant; +use craft_theme::{Flags, Variant}; use egui::{Rect, Response, Vec2, pos2}; const ITEM: PartKey = PartKey::new("item"); @@ -439,7 +439,11 @@ impl Component for BarItems { } else { None }; - let part = cx.part(ITEM.at(index as u64), cell).sense(sense).focusable(); + let mut part = cx.part(ITEM.at(index as u64), cell).sense(sense).focusable(); + // A toggle item's face paints on, and its node reads on, from the part's state. + if present[index].resolved.checked == Some(true) { + part = part.flags(Flags::CHECKED); + } if let Some(tooltip) = tooltip { part.tooltip(tooltip); }