mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
Dock: the Toolbar's content version covers its slots, remembered tools, drawer, Quick Mask and screen mode
This commit is contained in:
1 parent
b8463b4db5
commit
565abebaca
2 files changed
+11
No files matched your search
@@ -190,6 +190,7 @@ impl DockPanels<String> 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)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user