Properties: one filter leaves out Lock and Isolate Group while they're off (keeps show() within the cognitive complexity lint #4299 added)

This commit is contained in:
bflatastic
2026-10-29 11:22:51 +07:00
parent 7d04096840
commit 1924ddd1dd
+5 -8
View File
@@ -130,10 +130,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
}
if is_group {
actions.push((tl!("Ungroup"), "object.ungroup"));
// Isolate Group is left out while Enter Isolation Mode is off, as it is while an opacity mask is edited.
if crate::menus::enabled(app, "object.isolate") {
actions.push((tl!("Isolate Group"), "object.isolate"));
}
actions.push((tl!("Isolate Group"), "object.isolate"));
}
if is_live {
actions.push((tl!("Expand Shape"), "object.expandShape"));
@@ -149,10 +146,10 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
actions.push((tl!("Offset Path"), "object.path.offsetPath"));
actions.push((tl!("Simplify"), "object.path.simplify"));
actions.push((tl!("Arrange: Bring to Front"), "object.arrange.bringToFront"));
// Lock is listed only when Object › Lock › Selection is on, so not in isolation mode.
if crate::menus::enabled(app, "object.lock") {
actions.push((tl!("Lock"), "object.lock"));
}
actions.push((tl!("Lock"), "object.lock"));
// Lock and Isolate Group are left out while their commands are off (in isolation mode, while
// an opacity mask is edited).
actions.retain(|(_, id)| !matches!(*id, "object.lock" | "object.isolate") || crate::menus::enabled(app, id));
let w = (ui.available_width() - 6.0) / 2.0;
for pair in actions.chunks(2) {
ui.horizontal(|ui| {