mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Check the Lorem Ipsum editor before generic availability
This commit is contained in:
1 parent
f8b0493999
commit
45ef0d4042
1 file changed
+4
-1
@@ -65,6 +65,10 @@ pub fn is_enabled(app: &PhotocraftApp, id: &str) -> bool {
|
||||
if crate::analysis::handles(id) {
|
||||
return true;
|
||||
}
|
||||
// The view command wrapper otherwise uses the engine's document-level availability.
|
||||
if id == "type.pasteLoremIpsum" {
|
||||
return app.ui.text_edit.is_some() && app.session.is_enabled(id);
|
||||
}
|
||||
if let Some(e) = crate::view_cmds::is_enabled(app, id) {
|
||||
return e;
|
||||
}
|
||||
@@ -118,7 +122,6 @@ pub fn is_enabled(app: &PhotocraftApp, id: &str) -> bool {
|
||||
"edit.paste" | "file.newFromClipboard" => app.session.is_enabled(id) || app.services.clipboard_get_image.is_some(),
|
||||
"edit.pasteSpecial.pasteInPlace" => app.session.is_enabled(id) || (app.services.clipboard_get_image.is_some() && app.session.active().is_some()),
|
||||
"select.selectAndMask" => app.session.is_enabled("select.refineEdge"),
|
||||
"type.pasteLoremIpsum" => app.ui.text_edit.is_some(),
|
||||
"type.editText" => app
|
||||
.session
|
||||
.active()
|
||||
|
||||
Reference in new issue
Block a user