refactor(ribbon): derive the Block Palette button highlight from app state
The ribbon kept its own \show_block_palette\ copy that the app had to manually sync at every mutation point (the BLOCKPALETTE command and the dock Close handler). Drop the copy and thread the app's authoritative \show_block_palette\ into \Ribbon::view\ at render time, so the button highlight can't drift from the panel's true visibility — those two handlers are now mutate-points only and the ribbon view is the single place that reads the state back.
This commit is contained in:
parent
c3e3132b39
commit
b4da342f0e
4 changed files with 27 additions and 12 deletions
|
|
@ -597,7 +597,6 @@ pub(super) fn on_ribbon_tool_click(&mut self, tool_id: String, event: ModuleEven
|
|||
match id {
|
||||
PanelId::BlockPalette => {
|
||||
self.show_block_palette = false;
|
||||
self.ribbon.set_block_palette(false);
|
||||
self.block_palette.placing = None;
|
||||
}
|
||||
PanelId::Properties => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue