forked from 1b-agent/opencadstudio-upstream
feat(ribbon): Block Palette button reflects panel open state
The Insert tab's Block Palette button now behaves like the View tab toggles (UCS Icon, View Cube, Ortho, Properties, File Tabs, Layout Tabs): it stays highlighted while the block palette panel is open and clears when closed. The Ribbon gains a show_block_palette flag with a set_block_palette setter, fed into ToggleState and mapped in is_active_tool for the BLOCKPALETTE tool id. show_block_palette on the app remains the single source of truth; both mutation paths now mirror it onto the ribbon: - BLOCKPALETTE / BLOCKSPALETTE command toggles ribbon state alongside the panel (src/app/commands/blocks.rs). - Closing the panel via the dock rail close button clears the ribbon state, matching how Close(Properties) already syncs (src/app/update/dialog.rs).
This commit is contained in:
1 parent
28e5deb222
commit
fbab4c4934
4 files changed
+12
No files matched your search
@@ -37,6 +37,7 @@ pub(super) struct ToggleState {
|
||||
pub show_viewcube: bool,
|
||||
pub show_ucs_icon: bool,
|
||||
pub show_properties: bool,
|
||||
pub show_block_palette: bool,
|
||||
pub show_file_tabs: bool,
|
||||
pub show_layout_tabs: bool,
|
||||
}
|
||||
@@ -359,6 +360,7 @@ pub(super) fn is_active_tool(
|
||||
"NAVVCUBE" => state.show_viewcube,
|
||||
"UCSICON" => state.show_ucs_icon,
|
||||
"PROPERTIES" => state.show_properties,
|
||||
"BLOCKPALETTE" => state.show_block_palette,
|
||||
"FILETAB" => state.show_file_tabs,
|
||||
"LAYOUTTAB" => state.show_layout_tabs,
|
||||
id => active_tool.as_deref() == Some(id),
|
||||
|
||||
Reference in new issue
Block a user