mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Adaptive Wide Angle blocks other menu commands like the other full-window workspaces
This commit is contained in:
1 parent
3466d93204
commit
16d355def4
2 files changed
+6
-3
No files matched your search
@@ -1590,7 +1590,7 @@ mod tests {
|
||||
app.run("layer.new.layer", json!({})).unwrap();
|
||||
app.run("edit.fill", json!({"color":"#808080"})).unwrap();
|
||||
app.run("select.rect", json!({"x":8,"y":8,"width":8,"height":8})).unwrap();
|
||||
for workspace in ["filter.liquify", "edit.contentAwareFill", "filter.filterGallery"] {
|
||||
for workspace in ["filter.liquify", "edit.contentAwareFill", "filter.filterGallery", "filter.adaptiveWideAngle"] {
|
||||
let opened = call(&mut app, &ctx, "ui.menu.invoke", json!({"id":workspace}));
|
||||
assert_eq!(opened["ok"], true, "{workspace}: {opened}");
|
||||
assert_eq!(crate::distort_ui::modal_workspace(&app), Some(workspace));
|
||||
|
||||
@@ -91,8 +91,9 @@ pub(crate) fn surface_image(surf: &Surface, r: Rect, max_side: usize) -> ColorIm
|
||||
ColorImage::new([tw, th], px)
|
||||
}
|
||||
|
||||
/// The menu id of the open full-window workspace (Liquify, Content-Aware Fill, Filter Gallery).
|
||||
/// Like Photoshop's, these are modal: other menu commands wait for OK or Cancel (`menus::modal_allows`).
|
||||
/// The menu id of the open full-window workspace (Liquify, Content-Aware Fill, Filter Gallery,
|
||||
/// Adaptive Wide Angle). These are modal: other menu commands wait for OK or Cancel
|
||||
/// (`menus::modal_allows`).
|
||||
pub(crate) fn modal_workspace(app: &PhotocraftApp) -> Option<&'static str> {
|
||||
if app.distort.liquify.is_some() {
|
||||
Some("filter.liquify")
|
||||
@@ -100,6 +101,8 @@ pub(crate) fn modal_workspace(app: &PhotocraftApp) -> Option<&'static str> {
|
||||
Some("edit.contentAwareFill")
|
||||
} else if app.distort.gallery.is_some() {
|
||||
Some("filter.filterGallery")
|
||||
} else if app.wide_angle.is_some() {
|
||||
Some(photocraft_engine::lens_cmds::WIDE)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user