mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Layers panel requests are cleared only once the panel reports them taken
Rename, reveal and Find Layers focus are one-time requests the app passes to LayersPanel. The app cleared them after every call, also after a measuring run that applies none. It now clears them on LayersOutput::requests_taken (craft-layers), which the panel sets from its real run.
This commit is contained in:
1 parent
d2a35bf205
commit
ead3cd487a
2 files changed
+10
-7
No files matched your search
@@ -6,7 +6,7 @@
|
||||
//!
|
||||
//! The command dispatch takes a [`mark`] before a command and calls [`file`] after it; when the
|
||||
//! active layer moved, the reveal waits in `PhotocraftApp::pending_reveal` until the panel next
|
||||
//! draws and [`take`]s it, so a hidden panel reveals the layer when it is shown again.
|
||||
//! draws and applies it, so a hidden panel reveals the layer when it is shown again.
|
||||
//!
|
||||
//! Only a change of the active layer reveals: closing the group that holds it, or scrolling
|
||||
//! away, is left alone until the next change.
|
||||
@@ -50,9 +50,9 @@ pub(crate) fn file(app: &mut PhotocraftApp, before: Mark) {
|
||||
app.pending_reveal = Some((id, groups));
|
||||
}
|
||||
|
||||
/// The pending reveal, for the Layers panel's draw: the layer and what its closed parent groups
|
||||
/// do. The first pass of a frame takes it, so a second pass in the same frame reveals nothing
|
||||
/// again.
|
||||
/// The pending reveal: the layer and what its closed parent groups do. The Layers panel takes it
|
||||
/// once its real run applied it (`LayersOutput::requests_taken`), so a measuring run or a later
|
||||
/// pass of the same frame reveals nothing again.
|
||||
pub(crate) fn take(app: &mut PhotocraftApp) -> Option<(LayerId, Groups)> {
|
||||
app.pending_reveal.take()
|
||||
}
|
||||
@@ -23,7 +23,7 @@ pub(super) fn layers(app: &mut PhotocraftApp, ui: &mut egui::Ui) {
|
||||
use super::layers_tree::{self, PhotoThumbs};
|
||||
|
||||
// A Move-way pick of a layer opens its groups only when the Move option says so (#11381).
|
||||
let reveal = crate::layer_reveal::take(app);
|
||||
let reveal = app.pending_reveal;
|
||||
let ctx = ui.ctx().clone();
|
||||
// Thumbnail Contents is the clip preference alone, so the panel reads it each pass.
|
||||
app.ui.layers_settings.options.thumbnail_contents = crate::layers_panel_ui::thumbnail_contents(app);
|
||||
@@ -62,8 +62,11 @@ pub(super) fn layers(app: &mut PhotocraftApp, ui: &mut egui::Ui) {
|
||||
panel = panel.start_rename(id);
|
||||
}
|
||||
let out = panel.show(ui);
|
||||
app.find_layers_focus = false;
|
||||
app.layers_rename = None;
|
||||
if out.requests_taken {
|
||||
crate::layer_reveal::take(app);
|
||||
app.find_layers_focus = false;
|
||||
app.layers_rename = None;
|
||||
}
|
||||
if filter != before {
|
||||
app.ui.layer_filter = filter;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user