From 565abebacac014f62c940427c270f84fc6959de2 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 18 Nov 2026 21:01:49 +0000 Subject: [PATCH] Dock: the Toolbar's content version covers its slots, remembered tools, drawer, Quick Mask and screen mode --- crates/ui-egui/src/panels/panel_docking.rs | 1 + crates/ui-egui/src/panels/region_versions.rs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/crates/ui-egui/src/panels/panel_docking.rs b/crates/ui-egui/src/panels/panel_docking.rs index d86e9a70a8b..45edd0b2d0c 100644 --- a/crates/ui-egui/src/panels/panel_docking.rs +++ b/crates/ui-egui/src/panels/panel_docking.rs @@ -190,6 +190,7 @@ impl DockPanels for Panels<'_> { match panel.as_str() { // The canvas shows state that changes without a command: the view, redraw progress, animation and job overlays. CANVAS => None, + TOOLBAR => Some(super::region_versions::toolbar(self.app)), _ => Some(super::region_versions::panel(self.app, panel)), } } diff --git a/crates/ui-egui/src/panels/region_versions.rs b/crates/ui-egui/src/panels/region_versions.rs index 889f825822c..d99adab5829 100644 --- a/crates/ui-egui/src/panels/region_versions.rs +++ b/crates/ui-egui/src/panels/region_versions.rs @@ -38,6 +38,16 @@ pub(crate) fn panel(app: &PhotocraftApp, id: &str) -> u64 { } } +/// The version of the Toolbar's rail: the toolbar slots (the preferences revision), the remembered group tools, the +/// Edit Toolbar drawer, the side its flyouts open on, Quick Mask and the screen mode. The active tool and the colours +/// are in every version. +pub(crate) fn toolbar(app: &PhotocraftApp) -> u64 { + let quick_mask = app.session.active().is_some_and(|st| st.doc.quick_mask.is_some()); + let opens_start = crate::panel_docking::toolbar_opens(app) == craft::behavior::overlay::Side::Start; + let screen_mode = format!("{:?}", app.ui.view.screen_mode); + version(app, (app.session.prefs.rev(), &app.ui.group_tools, app.ui.toolbar_drawer, opens_start, quick_mask, screen_mode)) +} + /// What every region may show, joined with `extra`: the commands run (any of them may change anything), the active /// document, its revision and its active layers, the tool, the colours and the brush. fn version(app: &PhotocraftApp, extra: impl Hash) -> u64 {