diff --git a/crates/ui-egui/src/dialogs/artboard_options.rs b/crates/ui-egui/src/dialogs/artboard_options.rs
index 47da0f401..9c0eecdc6 100644
--- a/crates/ui-egui/src/dialogs/artboard_options.rs
+++ b/crates/ui-egui/src/dialogs/artboard_options.rs
@@ -1,5 +1,5 @@
-//! Artboard Options (double-click with the Artboard tool, or double-click the tool): the
-//! artboard's fields, sizes parsed with units.
+//! Artboard Options (double-click with the Artboard tool, double-click the tool, or the Artboards
+//! panel's options icon or menu): the artboard's fields, sizes parsed with units.
use serde_json::{Value, json};
diff --git a/crates/ui-egui/src/dialogs/tests.rs b/crates/ui-egui/src/dialogs/tests.rs
index 46b211232..acb2b6b0a 100644
--- a/crates/ui-egui/src/dialogs/tests.rs
+++ b/crates/ui-egui/src/dialogs/tests.rs
@@ -884,6 +884,28 @@ fn artboard_options_position_moves_art_only_with_the_tool_option_on() {
}
}
+/// Opened while another tool is in use, as the Artboards panel opens it (#1876), Artboard Options
+/// moves the art with a new X only when the Artboard tool's Move Artwork with Artboard option is
+/// on.
+#[test]
+fn artboard_options_position_follows_the_tool_option_with_another_tool() {
+ for move_art in [false, true] {
+ let mut app = app();
+ let id = app.run("shape.rectangle", json!({"x": 10, "y": 20, "width": 30, "height": 40})).unwrap()["id"].as_u64().unwrap();
+ app.run("tool.setOption", json!({"tool": "artboard", "key": "moveArt", "value": move_art})).unwrap();
+ app.run("tool.options", json!({"tool": "artboard"})).unwrap();
+ assert_ne!(app.session.tool_id(), "artboard");
+ app.ui.dialog.as_mut().unwrap().fields.insert("x".into(), json!(50));
+ frame(&mut app, Default::default());
+ super::confirm(&mut app).unwrap();
+ assert_eq!(app.session.doc().unwrap().doc.artboards[0].rect.x0, 50.0);
+ assert_eq!(
+ app.session.doc().unwrap().doc.node(vectorcraft_doc::NodeId(id)).unwrap().geometric_bounds().unwrap().x0,
+ if move_art { 60.0 } else { 10.0 }
+ );
+ }
+}
+
/// Zig Zag's dialog has Size and Ridges per segment sliders, and Relative / Absolute and Smooth /
/// Corner as radio buttons, not dropdowns (#1133).
#[test]
diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv
index f9923e337..78cf1f425 100644
--- a/crates/ui-egui/src/i18n/cs.tsv
+++ b/crates/ui-egui/src/i18n/cs.tsv
@@ -1280,7 +1280,6 @@ lighting Light Světlo
Rectangle: Sunshine Obdélník: Sluneční svit
Redefine Graphic Style “{name}” Předefinovat grafický styl „{name}“
Show Thumbnail Zobrazit miniaturu
- Artboard Options: edit with the Artboard tool Možnosti pracovní plochy: upravte nástrojem Pracovní plocha
Delete Artboards Odstranit pracovní plochy
Delete Empty Artboards Odstranit prázdné pracovní plochy
Duplicate Artboards Duplikovat pracovní plochy
diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv
index 1b6e23e5b..4e8b5d0a4 100644
--- a/crates/ui-egui/src/i18n/de.tsv
+++ b/crates/ui-egui/src/i18n/de.tsv
@@ -204,7 +204,6 @@
Art Bild
Art using a deleted global swatch keeps its colour. Grafiken, die ein gelöschtes globales Farbfeld verwenden, behalten ihre Farbe.
Artboard Options Zeichenflächenoptionen
- Artboard Options: edit with the Artboard tool Zeichenflächenoptionen: mit dem Zeichenflächen-Werkzeug bearbeiten
Artboard Options… Zeichenflächenoptionen…
Artboard Tool Zeichenflächen-Werkzeug
Artboard {number} Zeichenfläche {number}
diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv
index f02f9a599..98319745d 100644
--- a/crates/ui-egui/src/i18n/es.tsv
+++ b/crates/ui-egui/src/i18n/es.tsv
@@ -222,7 +222,6 @@
Art Ilustración
Art using a deleted global swatch keeps its colour. La ilustración que usa una muestra global eliminada conserva su color.
Artboard Options Opciones de mesa de trabajo
- Artboard Options: edit with the Artboard tool Opciones de mesa de trabajo: edita con la herramienta Mesa de trabajo
Artboard Options… Opciones de mesa de trabajo…
Artboard Tool Herramienta Mesa de trabajo
Artboard {number} Mesa de trabajo {number}
diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv
index 21faea1a5..3e068429f 100644
--- a/crates/ui-egui/src/i18n/fr.tsv
+++ b/crates/ui-egui/src/i18n/fr.tsv
@@ -223,7 +223,6 @@
Art Illustration
Art using a deleted global swatch keeps its colour. L’illustration qui utilise une nuance globale supprimée conserve sa couleur.
Artboard Options Options du plan de travail
- Artboard Options: edit with the Artboard tool Options du plan de travail : modifier avec l’outil Plan de travail
Artboard Options… Options du plan de travail…
Artboard Tool Outil Plan de travail
Artboard {number} Plan de travail {number}
diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv
index 16a06c84c..4a372b61a 100644
--- a/crates/ui-egui/src/i18n/hu.tsv
+++ b/crates/ui-egui/src/i18n/hu.tsv
@@ -327,7 +327,6 @@
Art using a deleted global swatch keeps its colour. A törölt globális színmintát használó grafika megtartja a színét.
Artboard Rajztábla
Artboard Options Rajztábla beállításai
- Artboard Options: edit with the Artboard tool Rajztábla beállításai: szerkesztés a Rajztábla eszközzel
Artboard Options… Rajztábla beállításai…
Artboard Tool Rajztábla
Artboard {number} Rajztábla {number}
diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv
index 821b85d1b..a1176a097 100644
--- a/crates/ui-egui/src/i18n/it.tsv
+++ b/crates/ui-egui/src/i18n/it.tsv
@@ -222,7 +222,6 @@
Art Grafica
Art using a deleted global swatch keeps its colour. La grafica che usa un campione globale eliminato mantiene il suo colore.
Artboard Options Opzioni tavola da disegno
- Artboard Options: edit with the Artboard tool Opzioni tavola da disegno: modifica con lo strumento Tavola da disegno
Artboard Options… Opzioni tavola da disegno…
Artboard Tool Strumento Tavola da disegno
Artboard {number} Tavola da disegno {number}
diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv
index a5d460dd3..798893b76 100644
--- a/crates/ui-egui/src/i18n/ja.tsv
+++ b/crates/ui-egui/src/i18n/ja.tsv
@@ -860,7 +860,6 @@
Art using a deleted global swatch keeps its colour. 削除したグローバルスウォッチを使っているアートは、そのカラーを保持します。
ArtCraft website ArtCraft の Web サイト
Artboard Options アートボードオプション
- Artboard Options: edit with the Artboard tool アートボードオプション: アートボードツールで編集
Artboard Options… アートボードオプション…
Artboard Tool アートボードツール
Artboard {number} アートボード {number}
diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv
index 869b18dc5..a5f3a7b44 100644
--- a/crates/ui-egui/src/i18n/ko.tsv
+++ b/crates/ui-egui/src/i18n/ko.tsv
@@ -855,7 +855,6 @@
Art using a deleted global swatch keeps its colour. 삭제된 글로벌 견본을 사용한 아트워크는 색상을 유지합니다.
ArtCraft website ArtCraft 웹사이트
Artboard Options 아트보드 옵션
- Artboard Options: edit with the Artboard tool 아트보드 옵션: 아트보드 도구로 편집
Artboard Options… 아트보드 옵션…
Artboard Tool 아트보드 도구
Artboard {number} 아트보드 {number}
diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv
index a56342b50..5f9ab48e1 100644
--- a/crates/ui-egui/src/i18n/pl.tsv
+++ b/crates/ui-egui/src/i18n/pl.tsv
@@ -1193,7 +1193,6 @@ lighting Light Światło
Rectangle: Sunshine Prostokąt: Słońce
Redefine Graphic Style “{name}” Zdefiniuj ponownie styl graficzny „{name}”
Show Thumbnail Pokaż miniaturę
- Artboard Options: edit with the Artboard tool Opcje obszaru kompozycji: edytuj narzędziem Obszar kompozycji
Delete Artboards Usuń obszary kompozycji
Delete Empty Artboards Usuń puste obszary kompozycji
Duplicate Artboards Powiel obszary kompozycji
diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv
index 1b245d942..8a90966de 100644
--- a/crates/ui-egui/src/i18n/pt-br.tsv
+++ b/crates/ui-egui/src/i18n/pt-br.tsv
@@ -228,7 +228,6 @@
ArtCraft Website Site do ArtCraft
ArtCraft website Site do ArtCraft
Artboard Options Opções de Mesa de Trabalho
- Artboard Options: edit with the Artboard tool Opções de Mesa de Trabalho: edite com a ferramenta Mesa de Trabalho
Artboard Options… Opções de Mesa de Trabalho…
Artboard Tool Ferramenta Mesa de Trabalho
Artboard {number} Mesa de Trabalho {number}
diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv
index 162c998e0..6a1141036 100644
--- a/crates/ui-egui/src/i18n/ru.tsv
+++ b/crates/ui-egui/src/i18n/ru.tsv
@@ -220,7 +220,6 @@
Art Рисунок
Art using a deleted global swatch keeps its colour. Рисунок с удалённым глобальным образцом сохраняет свой цвет.
Artboard Options Параметры монтажной области
- Artboard Options: edit with the Artboard tool Параметры монтажной области: редактируются инструментом «Монтажная область»
Artboard Options… Параметры монтажной области…
Artboard Tool Инструмент «Монтажная область»
Artboard {number} Монтажная область {number}
diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv
index 76c5f5973..0b073b8b4 100644
--- a/crates/ui-egui/src/i18n/uk.tsv
+++ b/crates/ui-egui/src/i18n/uk.tsv
@@ -216,7 +216,6 @@
Art Малюнок
Art using a deleted global swatch keeps its colour. Графіка з видаленим глобальним зразком зберігає свій колір.
Artboard Options Параметри монтажної області
- Artboard Options: edit with the Artboard tool Параметри монтажної області: редагуються інструментом «Монтажна область»
Artboard Options… Параметри монтажної області…
Artboard Tool Інструмент «Монтажна область»
Artboard {number} Монтажна область {number}
diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv
index ee105f278..26d32ebb6 100644
--- a/crates/ui-egui/src/i18n/vi.tsv
+++ b/crates/ui-egui/src/i18n/vi.tsv
@@ -256,7 +256,6 @@
Art using a deleted global swatch keeps its colour. Tác phẩm dùng mẫu màu toàn cục đã xóa vẫn giữ màu của nó.
Artboard Bảng vẽ
Artboard Options Tùy chọn bảng vẽ
- Artboard Options: edit with the Artboard tool Tùy chọn bảng vẽ: chỉnh sửa bằng Công cụ Bảng vẽ
Artboard Options… Tùy chọn bảng vẽ…
Artboard Tool Công cụ Bảng vẽ
Artboard {number} Bảng vẽ {number}
diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv
index f551b280e..cfb35d1a4 100644
--- a/crates/ui-egui/src/i18n/zh-hans.tsv
+++ b/crates/ui-egui/src/i18n/zh-hans.tsv
@@ -180,7 +180,6 @@
Art 图稿
Art using a deleted global swatch keeps its colour. 使用已删除全局色板的图稿会保留其颜色。
Artboard Options 画板选项
- Artboard Options: edit with the Artboard tool 画板选项:使用画板工具编辑
Artboard Options… 画板选项…
Artboard Tool 画板工具
Artboard {number} 画板 {number}
diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv
index f3616068a..64cfa03f2 100644
--- a/crates/ui-egui/src/i18n/zh-hant.tsv
+++ b/crates/ui-egui/src/i18n/zh-hant.tsv
@@ -191,7 +191,6 @@
Art 圖稿
Art using a deleted global swatch keeps its colour. 使用已刪除整體色票的圖稿會保留其顏色。
Artboard Options 工作區域選項
- Artboard Options: edit with the Artboard tool 工作區域選項:請使用工作區域工具編輯
Artboard Options… 工作區域選項…
Artboard Tool 工作區域工具
Artboard {number} 工作區域 {number}
diff --git a/crates/ui-egui/src/panels/artboards.rs b/crates/ui-egui/src/panels/artboards.rs
index 9f6b86782..7f49b11f2 100644
--- a/crates/ui-egui/src/panels/artboards.rs
+++ b/crates/ui-egui/src/panels/artboards.rs
@@ -2,7 +2,8 @@
//! delete; a row dragged onto New Artboard duplicates its artboard (as Duplicate Artboards does, with
//! its art when the Artboard tool's Move/Copy Artwork with Artboard is on). The highlighted row is the active artboard, the one the status bar's navigator shows and
//! Fit Artboard in Window fits: clicking a row makes it active, double-clicking its number also
-//! fits it in the window.
+//! fits it in the window. The options icon at a row's right end opens Artboard Options: a click on
+//! the active artboard's icon, or a double-click on another row's icon.
use egui::{Sense, Ui, pos2, vec2};
use serde_json::{Value, json};
@@ -30,9 +31,10 @@ pub(crate) fn scale_art(app: &VectorcraftApp) -> bool {
app.session.tool_id() == "artboard" && app.session.tool_options()["scaleArt"].as_bool().unwrap_or(false)
}
-/// Whether position edits take their art along, matching the Artboard tool's move option.
+/// Whether position edits take their art along, matching the Artboard tool's move option. The tool
+/// keeps the option while another tool is in use, as when this panel opens Artboard Options.
pub(crate) fn move_art(app: &VectorcraftApp) -> bool {
- app.session.tool_id() == "artboard" && app.session.tool_options()["moveArt"].as_bool().unwrap_or(true)
+ app.session.tool_options_of("artboard")["moveArt"].as_bool().unwrap_or(true)
}
/// The active artboard (of `n`).
@@ -170,9 +172,14 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
let opt = egui::Rect::from_center_size(r.right_center() - vec2(14.0, 0.0), vec2(14.0, 14.0));
let oresp = ui.interact(opt, ui.id().with(("ab-opt", i)), Sense::click());
icons::paint(ui, "dc-artboard-options", opt, if oresp.hovered() { t.text_strong } else { t.icon });
- if oresp.on_hover_text(tl!("Artboard Options: edit with the Artboard tool")).clicked() {
- app.select_tool("artboard");
+ let oresp = oresp.on_hover_text(tl!("Artboard Options"));
+ // A click on the active artboard's icon opens its Artboard Options. A click on
+ // another row's icon makes that artboard active, so a double-click opens its options.
+ if oresp.clicked() {
select(app, i);
+ if i == sel || oresp.double_clicked() {
+ app.run("tool.options", json!({ "tool": "artboard" })).ok();
+ }
}
let several = ui.input(|inp| inp.modifiers.shift || inp.modifiers.command);
if resp.clicked() && several && app.session.tool_id() == "artboard" {
@@ -246,7 +253,7 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) {
ui.separator();
menu_item(ui, tl!("Convert to Artboards"), false, false);
if menu_item(ui, tl!("Artboard Options…"), n > 0, false) {
- app.select_tool("artboard");
+ app.run("tool.options", json!({ "tool": "artboard" })).ok();
}
if menu_item(ui, tl!("Rearrange All Artboards…"), n > 1, false) {
open_rearrange(app);
@@ -376,9 +383,9 @@ mod tests {
assert_eq!(picked(&app, 3), [0]);
}
- /// Double-clicking a row's number goes to its artboard and its name renames it; a row's
- /// Options button edits that artboard with the Artboard tool, and the tool's artboard is the
- /// active one.
+ /// Double-clicking a row's number goes to its artboard and its name renames it; a click on
+ /// another row's options icon makes that artboard the active one, and the Artboard tool's
+ /// artboard is the active one.
#[test]
fn double_clicks_go_to_or_rename_and_options_edits_the_rows_artboard() {
let mut app = VectorcraftApp::new(Session::new(), Default::default());
@@ -422,9 +429,10 @@ mod tests {
assert_eq!(pstate::