Tint: Swap Colors (#963) (#1060)

Squash of #1060 by @RavoxX, without the docs/images screenshots (kept out of the repo).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jannik Wappler
2026-10-13 04:33:43 -04:00
committed by Brandon Thomas
co-authored by Claude Opus 5.5
parent 9aabb5da4f
commit 1765dc53df
6 changed files with 186 additions and 2 deletions
+6
View File
@@ -486,6 +486,7 @@ const JAPANESE: &[(&str, &str)] = &[
("Stretch Factor:", "伸縮率:"),
("Stylistic Sets", "スタイルセット"),
("Subpixel Positioning", "サブピクセル位置決め"),
("Swap Colors", "色を入れ替え"),
("Swap Paint Colors (X)", "ペイントカラーを入れ替え(X)"),
("Sync with System", "システムに合わせる"),
("System Default", "システムの既定"),
@@ -1025,6 +1026,7 @@ const SIMPLIFIED_CHINESE: &[(&str, &str)] = &[
("Stretch Factor:", "伸展系数:"),
("Stylistic Sets", "样式集"),
("Subpixel Positioning", "次像素定位"),
("Swap Colors", "交换颜色"),
("Swap Paint Colors (X)", "交换绘画颜色(X)"),
("Sync with System", "与系统同步"),
("System Default", "系统默认"),
@@ -1755,6 +1757,7 @@ const TRADITIONAL_CHINESE: &[(&str, &str)] = &[
("Stretch Factor:", "伸展係數:"),
("Stylistic Sets", "樣式集"),
("Subpixel Positioning", "次像素定位"),
("Swap Colors", "交換顏色"),
("Swap Paint Colors (X)", "交換繪畫顏色(X)"),
("Sync with System", "與系統同步"),
("System Default", "系統預設"),
@@ -2493,6 +2496,7 @@ const UKRAINIAN: &[(&str, &str)] = &[
("Stretch Factor:", "Коефіцієнт розтягнення:"),
("Stylistic Sets", "Стилістичні набори"),
("Subpixel Positioning", "Субпіксельне позиціювання"),
("Swap Colors", "Поміняти кольори"),
("Swap Paint Colors (X)", "Поміняти місцями кольори малювання (X)"),
("Sync with System", "Синхронізувати з системою"),
("System Default", "Стандартне системне"),
@@ -3035,6 +3039,7 @@ const PORTUGUESE: &[(&str, &str)] = &[
("Stretch Factor:", "Fator de esticamento:"),
("Stylistic Sets", "Conjuntos estilísticos"),
("Subpixel Positioning", "Posicionamento em subpixel"),
("Swap Colors", "Trocar cores"),
("Swap Paint Colors (X)", "Trocar cores de pintura (X)"),
("System Default", "Padrão do sistema"),
("Table", "Tabela"),
@@ -3486,6 +3491,7 @@ const CZECH: &[(&str, &str)] = &[
("Stretch Factor:", "Koeficient roztažení:"),
("Stylistic Sets", "Stylistické sady"),
("Subpixel Positioning", "Subpixelové umístění"),
("Swap Colors", "Prohodit barvy"),
("Swap Paint Colors (X)", "Prohodit barvy malování (X)"),
("Sync with System", "Synchronizovat se systémem"),
("System Default", "Výchozí systémové"),
@@ -1347,6 +1347,17 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
}
let scope = FxScope { effect: effect.as_str(), root: g, path: String::new() };
group_rows(app, ui, &bp, &layer, g, &ectx, body, &mut y, 0, &scope, &mut actions);
if effect == "ec.color.tint" {
let r = Rect::from_min_size(pos2(body.min.x + PARAM_NAME_X, y + 2.0), vec2(120.0, ROW));
let label = crate::i18n::tr("Swap Colors");
let resp = widgets::text_button(ui, r, label, false, &t, egui::Id::new(("ec-tint-swap", g.uid)));
app.auto.add_response(&format!("effectControls.effect.{}.swapColors", g.uid), &resp, label);
if resp.clicked() {
actions.push(("prop.select".into(), json!({"layer": layer.id.0, "prop": g.uid})));
actions.push(("effect.swapTintColors".into(), json!({"layer": layer.id.0, "effect": g.uid})));
}
y += ROW + 4.0;
}
}
y += 4.0;
}