From 14c46162027a0ed094fcdec349800e34f52c4227 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 1 Nov 2026 00:45:18 +0700 Subject: [PATCH] Fix #4953: the Gradient panel's freeform point swatch opens the point's popover --- crates/ui-egui/src/i18n/bg.tsv | 2 +- crates/ui-egui/src/i18n/bs.tsv | 2 +- crates/ui-egui/src/i18n/ca.tsv | 2 +- crates/ui-egui/src/i18n/cs.tsv | 2 +- crates/ui-egui/src/i18n/da.tsv | 2 +- crates/ui-egui/src/i18n/de.tsv | 2 +- crates/ui-egui/src/i18n/el.tsv | 2 +- crates/ui-egui/src/i18n/es.tsv | 2 +- crates/ui-egui/src/i18n/fi.tsv | 2 +- crates/ui-egui/src/i18n/fr.tsv | 2 +- crates/ui-egui/src/i18n/hu.tsv | 2 +- crates/ui-egui/src/i18n/id.tsv | 2 +- crates/ui-egui/src/i18n/it.tsv | 2 +- crates/ui-egui/src/i18n/ja.tsv | 2 +- crates/ui-egui/src/i18n/ka.tsv | 2 +- crates/ui-egui/src/i18n/ko.tsv | 2 +- crates/ui-egui/src/i18n/nl.tsv | 2 +- crates/ui-egui/src/i18n/pl.tsv | 2 +- crates/ui-egui/src/i18n/pt-br.tsv | 2 +- crates/ui-egui/src/i18n/ru.tsv | 2 +- crates/ui-egui/src/i18n/sv.tsv | 2 +- crates/ui-egui/src/i18n/tr.tsv | 2 +- crates/ui-egui/src/i18n/uk.tsv | 2 +- crates/ui-egui/src/i18n/vi.tsv | 2 +- crates/ui-egui/src/i18n/zh-hans.tsv | 2 +- crates/ui-egui/src/i18n/zh-hant.tsv | 2 +- crates/ui-egui/src/panels/gradient.rs | 16 ++++++++++--- crates/ui-egui/src/panels/gradient/tests.rs | 25 +++++++++++++++++++++ docs/ui-parity.md | 3 ++- 29 files changed, 66 insertions(+), 30 deletions(-) diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 59c231102..e09a59232 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -906,7 +906,7 @@ font-technology Variable Променливи Edit Symbol Редактиране на символ Edit Text Редактиране на текст Edit the applied effect, or add another one? Да се редактира ли приведеният ефект или да се добави друг? - Edit the selected point's colour in the Color panel Редактиране на цвета на избраната точка в панела Цвят + Edit the point Редактиране на точката Edit the stop Редактиране на опорната точка Edit Theme Редактиране на тема Edit theme Редактиране на тема diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 571421965..f213baaab 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -1516,7 +1516,7 @@ lighting Light Svjetlo Color: Boja: Delete Stop Izbriši tačku Edit Gradient Uredi gradijent - Edit the selected point's colour in the Color panel Uredite boju odabrane tačke u panelu Boja + Edit the point Uredi tačku Edit the stop Uredi tačku Eyedropper: click the art to sample the stop's colour Kapaljka: kliknite crtež da uzmete uzorak boje tačke Eyedropper: click the art to sample the key color Kapaljka: kliknite crtež da uzmete uzorak ključne boje diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 95c59b92c..8d8054c25 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -1309,7 +1309,7 @@ Edit Symbol Edita el símbol Edit Text Edita el text Edit the applied effect, or add another one? Vols editar l’efecte aplicat o afegir-ne un altre? - Edit the selected point's colour in the Color panel Edita el color del punt seleccionat al panell Color + Edit the point Edita el punt Edit the stop Edita la parada Edit Theme Edita el tema Edit theme Edita el tema diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 0768ea6c8..0caa797bd 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -1539,7 +1539,7 @@ lighting Light Světlo Color: Barva: Delete Stop Odstranit zarážku Edit Gradient Upravit přechod - Edit the selected point's colour in the Color panel Upravit barvu vybraného bodu v panelu Barva + Edit the point Upravit bod Edit the stop Upravit zarážku Eyedropper: click the art to sample the stop's colour Kapátko: kliknutím na kresbu naberete barvu zarážky Eyedropper: click the art to sample the key color Kapátko: kliknutím na kresbu naberete klíčovou barvu diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 170f4d4b9..1507f30ef 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -1453,7 +1453,7 @@ lighting Light Lys Color: Farve: Delete Stop Slet stop Edit Gradient Redigér gradient - Edit the selected point's colour in the Color panel Redigér det markerede punkts farve i farvepanelet + Edit the point Redigér punktet Edit the stop Redigér stoppet Eyedropper: click the art to sample the stop's colour Pipette: klik på grafikken for at prøvetage stoppets farve Eyedropper: click the art to sample the key color Pipette: klik på grafikken for at prøvetage nøglefarven diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 21734d6b4..22d228097 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -900,7 +900,7 @@ font-technology Variable Variabel Edit Symbol Symbol bearbeiten Edit Text Text bearbeiten Edit the applied effect, or add another one? Den angewendeten Effekt bearbeiten oder einen weiteren hinzufügen? - Edit the selected point's colour in the Color panel Die Farbe des ausgewählten Punkts im Bedienfeld „Farbe“ bearbeiten + Edit the point Punkt bearbeiten Edit the stop Farbstopp bearbeiten Edit Theme Thema bearbeiten Edit theme Thema bearbeiten diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index b3b5e9f97..a993b9840 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -876,7 +876,7 @@ font-technology Variable Μεταβλητές Edit Symbol Επεξεργασία συμβόλου Edit Text Επεξεργασία κειμένου Edit the applied effect, or add another one? Επεξεργασία του εφαρμοσμένου εφέ ή προσθήκη άλλου; - Edit the selected point's colour in the Color panel Επεξεργασία του χρώματος επιλεγμένου σημείου στον πίνακα Χρώμα + Edit the point Επεξεργασία σημείου Edit the stop Επεξεργασία σημείου ντεγκραντέ Edit Theme Επεξεργασία θέματος Edit theme Επεξεργασία θέματος diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 1e4a8fd9b..19e524cf2 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -921,7 +921,7 @@ font-technology Variable Variables Edit Symbol Editar símbolo Edit Text Editar texto Edit the applied effect, or add another one? ¿Editar el efecto aplicado o agregar otro? - Edit the selected point's colour in the Color panel Edita el color del punto seleccionado en el panel Color + Edit the point Editar el punto Edit the stop Editar la parada Edit Theme Editar tema Edit theme Editar tema diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 540800b58..eb9c0e525 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -1513,7 +1513,7 @@ lighting Light Valo Color: Väri: Delete Stop Poista väripiste Edit Gradient Muokkaa liukuväriä - Edit the selected point's colour in the Color panel Muokkaa valitun pisteen väriä Väri-paneelissa + Edit the point Muokkaa pistettä Edit the stop Muokkaa väripistettä Eyedropper: click the art to sample the stop's colour Pipetti: ota väripisteen väri näytteeksi napsauttamalla kuvitusta Eyedropper: click the art to sample the key color Pipetti: ota avainväri näytteeksi napsauttamalla kuvitusta diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index f171df8db..d2ecba42d 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -924,7 +924,7 @@ font-technology Variable Variables Edit Symbol Modifier le symbole Edit Text Modifier le texte Edit the applied effect, or add another one? Modifier l’effet appliqué ou en ajouter un autre ? - Edit the selected point's colour in the Color panel Modifier la couleur du point sélectionné dans le panneau Couleur + Edit the point Modifier le point Edit the stop Modifier l’étape de dégradé Edit Theme Modifier le thème Edit theme Modifier le thème diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 7070071b0..b29f8ef71 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -1189,7 +1189,7 @@ font-technology Variable Változó Edit Symbol Szimbólum szerkesztése Edit Text Szöveg szerkesztése Edit the applied effect, or add another one? Szerkeszted az alkalmazott effektust, vagy újat adsz hozzá? - Edit the selected point's colour in the Color panel A kijelölt pont színe a Szín panelen szerkeszthető + Edit the point Pont szerkesztése Edit the stop Színátmenet-pont szerkesztése Edit Theme Téma szerkesztése Edit theme Téma szerkesztése diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 4276a98f2..705f57370 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -1453,7 +1453,7 @@ lighting Light Cahaya Color: Warna: Delete Stop Hapus stop Edit Gradient Edit gradien - Edit the selected point's colour in the Color panel Edit warna titik terpilih di panel Warna + Edit the point Edit titik Edit the stop Edit stop Eyedropper: click the art to sample the stop's colour Pipet: klik karya seni untuk mengambil sampel warna stop Eyedropper: click the art to sample the key color Pipet: klik karya seni untuk mengambil sampel warna kunci diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 9daf34aec..9d6a31cca 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -921,7 +921,7 @@ font-technology Variable Variabili Edit Symbol Modifica simbolo Edit Text Modifica testo Edit the applied effect, or add another one? Modificare l'effetto applicato o aggiungerne un altro? - Edit the selected point's colour in the Color panel Modifica il colore del punto selezionato nel pannello Colore + Edit the point Modifica il punto Edit the stop Modifica il cursore colore Edit Theme Modifica tema Edit theme Modifica tema diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 008940f12..abe51ff0a 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -1420,7 +1420,7 @@ font-technology Variable バリアブル Edit or Apply Color Group… カラーグループを編集または適用… Edit or Apply Colors カラーを編集/適用 Edit the applied effect, or add another one? 適用済みの効果を編集しますか? それとも別の効果を追加しますか? - Edit the selected point's colour in the Color panel 選択したポイントのカラーをカラーパネルで編集 + Edit the point ポイントを編集 Edit the stop 分岐点を編集 Edit theme テーマを編集 Edit… 編集… diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index a32250773..adcb85d67 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -1370,7 +1370,7 @@ lighting Light სინათლე Color: ფერი: Delete Stop გადასვლის წერტილის წაშლა Edit Gradient გრადიენტის რედაქტირება - Edit the selected point's colour in the Color panel მონიშნული წერტილის ფერის რედაქტირება ფერის პანელში + Edit the point წერტილის რედაქტირება Edit the stop გადასვლის წერტილის რედაქტირება Eyedropper: click the art to sample the stop's colour პიპეტი: დაწკაპეთ ნახატზე გადასვლის წერტილის ფერის ასაღებად Eyedropper: click the art to sample the key color პიპეტი: დაწკაპეთ ნახატზე საკვანძო ფერის ასაღებად diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index a2c3ea0e9..b3bf3cd62 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -1411,7 +1411,7 @@ font-technology Variable 가변 Edit or Apply Color Group… 색상 그룹 편집 또는 적용… Edit or Apply Colors 색상 편집 또는 적용 Edit the applied effect, or add another one? 적용된 효과를 편집하거나 다른 효과를 추가하시겠습니까? - Edit the selected point's colour in the Color panel 색상 패널에서 선택한 포인트의 색상 편집 + Edit the point 포인트 편집 Edit the stop 정지점 편집 Edit theme 테마 편집 Edit… 편집… diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 26a3a0c49..c3bf46c3e 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -1467,7 +1467,7 @@ lighting Light Licht Color: Kleur: Delete Stop Stoppunt verwijderen Edit Gradient Verloop bewerken - Edit the selected point's colour in the Color panel Bewerk de kleur van het geselecteerde punt in het Kleur-paneel + Edit the point Punt bewerken Edit the stop Stoppunt bewerken Eyedropper: click the art to sample the stop's colour Pipet: klik op de illustratie om de kleur van het stoppunt over te nemen Eyedropper: click the art to sample the key color Pipet: klik op de illustratie om de sleutelkleur over te nemen diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 7a71813b0..519595ffc 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -1453,7 +1453,7 @@ lighting Light Światło Color: Kolor: Delete Stop Usuń punkt koloru Edit Gradient Edytuj gradient - Edit the selected point's colour in the Color panel Edytuj kolor zaznaczonego punktu w panelu Kolor + Edit the point Edytuj punkt Edit the stop Edytuj punkt koloru Eyedropper: click the art to sample the stop's colour Kroplomierz: kliknij kompozycję, aby pobrać kolor punktu Eyedropper: click the art to sample the key color Kroplomierz: kliknij kompozycję, aby pobrać kolor kluczowy diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index e20611488..b07ec8f66 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -816,7 +816,7 @@ Edit or Apply Color Group… Editar ou Aplicar Grupo de Cores… Edit or Apply Colors Editar ou Aplicar Cores Edit the applied effect, or add another one? Editar o efeito aplicado, ou adicionar outro? - Edit the selected point's colour in the Color panel Edite a cor do ponto selecionado no painel Cor + Edit the point Editar o ponto Edit the stop Editar a parada Edit theme Editar tema Edit… Editar… diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 414f43d29..685d6862b 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -919,7 +919,7 @@ font-technology Variable Вариативные Edit Symbol Редактировать символ Edit Text Редактировать текст Edit the applied effect, or add another one? Редактировать применённый эффект или добавить другой? - Edit the selected point's colour in the Color panel Редактируйте цвет выбранной точки на панели «Цвет» + Edit the point Редактировать точку Edit the stop Редактировать точку перехода Edit Theme Редактировать тему Edit theme Редактировать тему diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 46d0eb226..b5ff04674 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -908,7 +908,7 @@ font-technology Variable Variabla Edit Symbol Redigera symbol Edit Text Redigera text Edit the applied effect, or add another one? Vill du redigera den använda effekten eller lägga till en till? - Edit the selected point's colour in the Color panel Redigera den markerade punktens färg i panelen Färg + Edit the point Redigera punkten Edit the stop Redigera stoppet Edit Theme Redigera tema Edit theme Redigera tema diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index c40b948f1..4961fcd15 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -900,7 +900,7 @@ font-technology Variable Değişken Edit Symbol Sembolü Düzenle Edit Text Metni Düzenle Edit the applied effect, or add another one? Uygulanan efekti düzenlemek veya başka bir efekt eklemek mi istiyorsunuz? - Edit the selected point's colour in the Color panel Seçilen noktanın rengini Renk panelinde düzenleyin + Edit the point Noktayı düzenle Edit the stop Durağı düzenle Edit Theme Temayı Düzenle Edit theme Temayı düzenle diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index e92094241..886675579 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -915,7 +915,7 @@ font-technology Variable Варіативні Edit Symbol Редагувати символ Edit Text Редагувати текст Edit the applied effect, or add another one? Редагувати застосований ефект або додати інший? - Edit the selected point's colour in the Color panel Редагуйте колір вибраної точки на панелі «Колір» + Edit the point Редагувати точку Edit the stop Редагувати точку переходу Edit Theme Редагувати тему Edit theme Редагувати тему diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 44fffd0ce..f0ed3842e 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -1071,7 +1071,7 @@ font-technology Variable Biến thiên Edit Symbol Chỉnh sửa ký hiệu Edit Text Chỉnh sửa văn bản Edit the applied effect, or add another one? Chỉnh sửa hiệu ứng đã áp dụng, hay thêm hiệu ứng mới? - Edit the selected point's colour in the Color panel Chỉnh sửa màu của điểm đã chọn trong bảng Màu + Edit the point Chỉnh sửa điểm Edit the stop Chỉnh sửa điểm dừng Edit Theme Chỉnh sửa bộ màu Edit theme Chỉnh sửa bộ màu diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index cb2d7558b..b18470640 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -861,7 +861,7 @@ Edit Symbol 编辑符号 Edit Text 编辑文字 Edit the applied effect, or add another one? 编辑已应用的效果,还是再添加一个? - Edit the selected point's colour in the Color panel 在颜色面板中编辑所选点的颜色 + Edit the point 编辑点 Edit the stop 编辑色标 Edit Theme 编辑主题 Edit theme 编辑主题 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 31a2d1dbe..2b7e38a40 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -883,7 +883,7 @@ font-technology Variable 可變 Edit Symbol 編輯符號 Edit Text 編輯文字 Edit the applied effect, or add another one? 要編輯已套用的效果,還是新增另一個? - Edit the selected point's colour in the Color panel 在顏色面板中編輯所選點的顏色 + Edit the point 編輯點 Edit the stop 編輯色標 Edit Theme 編輯主題 Edit theme 編輯主題 diff --git a/crates/ui-egui/src/panels/gradient.rs b/crates/ui-egui/src/panels/gradient.rs index 0f6bcf395..2b71ea054 100644 --- a/crates/ui-egui/src/panels/gradient.rs +++ b/crates/ui-egui/src/panels/gradient.rs @@ -18,7 +18,7 @@ //! //! A freeform gradient shows its section instead of the angle, aspect and slider: the Draw //! toggle (Points or Lines: how the Gradient tool adds points) and the selected point's colour -//! (edited in the Color panel), opacity and spread, with Delete Point. +//! (click: its popover, as a stop's), opacity and spread, with Delete Point. //! //! The Presets menu lists ready-made gradients by theme (the built-in gradient libraries), then //! the gradients saved with the panel menu's Save Gradient Preset…; choosing one applies it to the @@ -484,13 +484,18 @@ fn freeform_section(app: &mut VectorcraftApp, ui: &mut Ui, g: &GradientPaint) { let point = sel.map(|i| f.points[i]); ui.horizontal(|ui| { widgets::dim_label(ui, tl!("Color:")); - let (r, resp) = ui.allocate_exact_size(vec2(18.0, 18.0), Sense::hover()); + let (r, resp) = ui.allocate_exact_size(vec2(18.0, 18.0), Sense::click()); let paint = point.map_or(Paint::None, |p| Paint::solid(p.color)); widgets::swatch_tile(ui, r, &paint, false, resp.hovered()); - resp.on_hover_text(tl!("Edit the selected point's colour in the Color panel")); if let Some(p) = point { widgets::dim_label(ui, &p.color.to_hex().to_uppercase()); } + // The selected point's popover, as a stop's swatch opens the stop's (#4953). + if let Some(i) = sel + && resp.on_hover_text(tl!("Edit the point")).clicked() + { + show_popover(app, i, r.left_bottom() + vec2(0.0, 4.0)); + } }); ui.horizontal(|ui| { ui.add_enabled_ui(sel.is_some(), |ui| { @@ -640,6 +645,11 @@ pub(crate) fn stop_eyedropper(app: &mut VectorcraftApp) { /// Open the stop popover for stop `i` at screen position `at`. fn open_popover(app: &mut VectorcraftApp, i: usize, at: Pos2) { select_stop(app, Some(i)); + show_popover(app, i, at); +} + +/// The popover for the selected stop or freeform point `i`, at screen position `at`. +fn show_popover(app: &mut VectorcraftApp, i: usize, at: Pos2) { app.ui.dialog = Some(Dialog::new("gradientStop", json!({ "index": i, "screen": [at.x, at.y], "tab": "color" }))); } diff --git a/crates/ui-egui/src/panels/gradient/tests.rs b/crates/ui-egui/src/panels/gradient/tests.rs index a3b7f5cfa..83a290bb1 100644 --- a/crates/ui-egui/src/panels/gradient/tests.rs +++ b/crates/ui-egui/src/panels/gradient/tests.rs @@ -543,6 +543,31 @@ fn double_clicking_a_stop_opens_the_shared_popover_beside_it() { assert_eq!(app.session.selected_stop(), Some(1)); } +/// #4953: with a freeform point selected, clicking the Color swatch opens the popover for that +/// point, which recolours it and leaves the other points as they were. +#[test] +fn the_freeform_color_swatch_opens_the_points_popover() { + let mut app = app(json!({"gradient": {"kind": "freeform"}})); + app.run("paint.freeform.selectPoint", json!({"index": 1})).unwrap(); + let mut p = Panel::new(); + let texts = p.frame(&mut app, vec![], Modifiers::NONE); + let label = text_at(&texts, "Color:").unwrap_or_else(|| panic!("the Color row: {texts:?}")); + let swatch = p.widget_after(label); + p.click(&mut app, swatch.center()); + let d = app.ui.dialog.clone().expect("the popover opened"); + assert_eq!( + (d.kind.as_str(), &d.fields["index"], &d.fields["screen"]), + ("gradientStop", &json!(1), &json!([swatch.left(), swatch.bottom() + 4.0])) + ); + let points = |app: &VectorcraftApp| shown_points(&fill(app)).points.iter().map(|p| p.color.to_hex()).collect::>(); + let before = points(&app); + app.ui.dialog.as_mut().unwrap().fields.insert("color".into(), json!("#ff0000")); + crate::dialogs::confirm(&mut app).unwrap(); + let mut want = before.clone(); + want[1] = "#ff0000".into(); + assert_eq!((fill(&app).gradient.kind, points(&app)), (GradientKind::Freeform, want)); +} + #[test] fn the_stop_eyedropper_arms_the_eyedropper_for_the_stop() { let mut app = app(json!({"gradient": {}})); diff --git a/docs/ui-parity.md b/docs/ui-parity.md index ecda87aae..fee3db42d 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI and interaction parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-31 · **Change:** minor (files opened from the file manager while VectorCraft runs open in its window on Windows and Linux, #4892) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-01 · **Change:** minor (native Save As Version menu, refused-save alert, fixed Contributors table header, freeform point swatch opens its popover: #4931, #4933, #4944, #4953) · **Target:** Adobe Illustrator 2026 (30.x) ## Feature submission evidence @@ -381,6 +381,7 @@ separate. Scores and hours unchanged. [Behavior and command details](development | Date | Change | Summary | |---|---|---| +| 2026-11-01 | minor | VectorCraft Options' Version is a menu of the versions VectorCraft writes, each named by the releases that read it, and an uncompressible version turns Use Compression off (#4931); a save refused before writing shows the Can't save alert with the reason (#4933); About › Contributors' table keeps its header row above the scrolling rows (#4944); the Gradient panel's freeform point swatch opens the point's popover (#4953); scores unchanged | | 2026-10-31 | minor | A file opened from the file manager while VectorCraft runs opens as a new tab in that window, which comes to the front, on Windows and Linux (#4892); `--new-instance` opts out; scores unchanged | | 2026-10-31 | minor | Object › Path › Smooth: Auto-Smooth takes a shaky line to one smooth curve, and direct-selected anchors smooth only their section; scores unchanged | | 2026-10-31 | minor | New Document: More Settings has Save Preset beside the name, as Preset Details does, and saves its settings (#4893); scores and estimates unchanged |