diff --git a/locales/ar-SA/opencadstudio.ftl b/locales/ar-SA/opencadstudio.ftl index 16590511c..b5088c6f6 100644 --- a/locales/ar-SA/opencadstudio.ftl +++ b/locales/ar-SA/opencadstudio.ftl @@ -2341,6 +2341,7 @@ common = .load-linetypes = تحميل أنواع الخطوط .requires-two-positive-values = يتطلب قيمتين موجبتين (x,y) أو قيمة واحدة لكليهما. .snap-marker-color = لون علامة الالتقاط + .command-line-text-color = لون نص سطر الأوامر .linetypes-loaded = تم تحميل __ocs_fmt_0__ من أنواع الخطوط. .geometric-center-snap = المركز الهندسي .no-trim-option = بدون تشذيب diff --git a/locales/bg-BG/opencadstudio.ftl b/locales/bg-BG/opencadstudio.ftl index fb12e4dbc..1d0073369 100644 --- a/locales/bg-BG/opencadstudio.ftl +++ b/locales/bg-BG/opencadstudio.ftl @@ -2328,6 +2328,7 @@ common = .load-linetypes = Зареждане на типове линии .requires-two-positive-values = Изискват се две положителни стойности (x,y) или една за двете. .snap-marker-color = Цвят на маркера за прихващане + .command-line-text-color = Цвят на текста в командния ред .linetypes-loaded = Заредени типове линии: __ocs_fmt_0__. .geometric-center-snap = Геометричен център .no-trim-option = Без подрязване diff --git a/locales/cs-CZ/opencadstudio.ftl b/locales/cs-CZ/opencadstudio.ftl index 808612974..ff14acdee 100644 --- a/locales/cs-CZ/opencadstudio.ftl +++ b/locales/cs-CZ/opencadstudio.ftl @@ -2328,6 +2328,7 @@ common = .load-linetypes = Načíst typy čar .requires-two-positive-values = Vyžaduje dvě kladné hodnoty (x,y) nebo jednu pro obě. .snap-marker-color = Barva značky uchopení + .command-line-text-color = Barva textu příkazového řádku .linetypes-loaded = Načteno typů čar: __ocs_fmt_0__. .geometric-center-snap = Geometrický střed .no-trim-option = Neoříznout diff --git a/locales/de-DE/opencadstudio.ftl b/locales/de-DE/opencadstudio.ftl index c8abcfdfe..f18f5edc7 100644 --- a/locales/de-DE/opencadstudio.ftl +++ b/locales/de-DE/opencadstudio.ftl @@ -2329,6 +2329,7 @@ common = .load-linetypes = Linientypen laden .requires-two-positive-values = Erfordert zwei positive Werte (x,y) oder einen für beide. .snap-marker-color = Farbe der Fangmarkierung + .command-line-text-color = Textfarbe der Befehlszeile .linetypes-loaded = __ocs_fmt_0__ Linientyp(en) geladen. .geometric-center-snap = Geometrischer Mittelpunkt .no-trim-option = Nicht stutzen diff --git a/locales/el-GR/opencadstudio.ftl b/locales/el-GR/opencadstudio.ftl index 5ebbc4005..d2ab60b7d 100644 --- a/locales/el-GR/opencadstudio.ftl +++ b/locales/el-GR/opencadstudio.ftl @@ -2328,6 +2328,7 @@ common = .load-linetypes = Φόρτωση τύπων γραμμής .requires-two-positive-values = Απαιτούνται δύο θετικές τιμές (x,y) ή μία και για τις δύο. .snap-marker-color = Χρώμα δείκτη έλξης + .command-line-text-color = Χρώμα κειμένου γραμμής εντολών .linetypes-loaded = Φορτώθηκαν __ocs_fmt_0__ τύποι γραμμής. .geometric-center-snap = Γεωμετρικό κέντρο .no-trim-option = Χωρίς περικοπή diff --git a/locales/en-US/opencadstudio.ftl b/locales/en-US/opencadstudio.ftl index 99a7b15c2..1df12baa1 100644 --- a/locales/en-US/opencadstudio.ftl +++ b/locales/en-US/opencadstudio.ftl @@ -2329,6 +2329,7 @@ common = .load-linetypes = Load Linetypes .requires-two-positive-values = Requires two positive values (x,y) or one for both. .snap-marker-color = Snap marker color + .command-line-text-color = Command line text color .linetypes-loaded = __ocs_fmt_0__ linetype(s) loaded. .geometric-center-snap = Geometric Center .no-trim-option = No trim diff --git a/locales/es-ES/opencadstudio.ftl b/locales/es-ES/opencadstudio.ftl index a53f4e3ae..8c6199d4d 100644 --- a/locales/es-ES/opencadstudio.ftl +++ b/locales/es-ES/opencadstudio.ftl @@ -2329,6 +2329,7 @@ common = .load-linetypes = Cargar tipos de línea .requires-two-positive-values = Requiere dos valores positivos (x,y) o uno para ambos. .snap-marker-color = Color del marcador de referencia + .command-line-text-color = Color del texto de la línea de comandos .linetypes-loaded = __ocs_fmt_0__ tipo(s) de línea cargado(s). .geometric-center-snap = Centro geométrico .no-trim-option = No recortar diff --git a/locales/fi-FI/opencadstudio.ftl b/locales/fi-FI/opencadstudio.ftl index be72d4cd1..777353a31 100644 --- a/locales/fi-FI/opencadstudio.ftl +++ b/locales/fi-FI/opencadstudio.ftl @@ -2328,6 +2328,7 @@ common = .load-linetypes = Lataa viivatyypit .requires-two-positive-values = Vaatii kaksi positiivista arvoa (x,y) tai yhden molemmille. .snap-marker-color = Kohdistusmerkin väri + .command-line-text-color = Komentorivin tekstin väri .linetypes-loaded = Ladattu __ocs_fmt_0__ viivatyyppiä. .geometric-center-snap = Geometrinen keskipiste .no-trim-option = Ei trimmausta diff --git a/locales/fr-FR/opencadstudio.ftl b/locales/fr-FR/opencadstudio.ftl index d9753bbb0..e9f4f0cb4 100644 --- a/locales/fr-FR/opencadstudio.ftl +++ b/locales/fr-FR/opencadstudio.ftl @@ -2329,6 +2329,7 @@ common = .load-linetypes = Charger des types de ligne .requires-two-positive-values = Nécessite deux valeurs positives (x,y) ou une seule pour les deux. .snap-marker-color = Couleur du marqueur d'accrochage + .command-line-text-color = Couleur du texte de la ligne de commande .linetypes-loaded = __ocs_fmt_0__ type(s) de ligne chargé(s). .geometric-center-snap = Centre géométrique .no-trim-option = Sans ajuster diff --git a/locales/hi-IN/opencadstudio.ftl b/locales/hi-IN/opencadstudio.ftl index 04bbe36f2..e13ced65d 100644 --- a/locales/hi-IN/opencadstudio.ftl +++ b/locales/hi-IN/opencadstudio.ftl @@ -2317,6 +2317,7 @@ common = .load-linetypes = लाइनटाइप लोड करें .requires-two-positive-values = दो धनात्मक मान (x,y) या दोनों के लिए एक मान आवश्यक है। .snap-marker-color = स्नैप मार्कर का रंग + .command-line-text-color = कमांड लाइन टेक्स्ट रंग .linetypes-loaded = __ocs_fmt_0__ लाइनटाइप लोड हुए। .geometric-center-snap = ज्यामितीय केंद्र .no-trim-option = ट्रिम नहीं diff --git a/locales/hu-HU/opencadstudio.ftl b/locales/hu-HU/opencadstudio.ftl index f44f32c93..ca1abb88d 100644 --- a/locales/hu-HU/opencadstudio.ftl +++ b/locales/hu-HU/opencadstudio.ftl @@ -2328,6 +2328,7 @@ common = .load-linetypes = Vonaltípusok betöltése .requires-two-positive-values = Két pozitív érték (x,y) vagy egy közös érték szükséges. .snap-marker-color = Illesztési jelölő színe + .command-line-text-color = Parancssor szövegszíne .linetypes-loaded = __ocs_fmt_0__ vonaltípus betöltve. .geometric-center-snap = Geometriai középpont .no-trim-option = Nincs vágás diff --git a/locales/it-IT/opencadstudio.ftl b/locales/it-IT/opencadstudio.ftl index ec3a84feb..b5cc454e9 100644 --- a/locales/it-IT/opencadstudio.ftl +++ b/locales/it-IT/opencadstudio.ftl @@ -2328,6 +2328,7 @@ common = .load-linetypes = Carica tipi di linea .requires-two-positive-values = Richiede due valori positivi (x,y) o uno per entrambi. .snap-marker-color = Colore del marcatore di snap + .command-line-text-color = Colore del testo della riga di comando .linetypes-loaded = __ocs_fmt_0__ tipo/i di linea caricato/i. .geometric-center-snap = Centro geometrico .no-trim-option = Non tagliare diff --git a/locales/ja-JP/opencadstudio.ftl b/locales/ja-JP/opencadstudio.ftl index 319fc1bbb..7d02e9959 100644 --- a/locales/ja-JP/opencadstudio.ftl +++ b/locales/ja-JP/opencadstudio.ftl @@ -2319,6 +2319,7 @@ common = .load-linetypes = 線種をロード .requires-two-positive-values = 2つの正の値 (x,y)、または両方に共通の1つの値が必要です。 .snap-marker-color = スナップ マーカーの色 + .command-line-text-color = コマンドラインの文字色 .linetypes-loaded = __ocs_fmt_0__ 個の線種をロードしました。 .geometric-center-snap = 図心 .no-trim-option = トリムしない diff --git a/locales/ko-KR/opencadstudio.ftl b/locales/ko-KR/opencadstudio.ftl index 461e6c85c..2a61aa614 100644 --- a/locales/ko-KR/opencadstudio.ftl +++ b/locales/ko-KR/opencadstudio.ftl @@ -2328,6 +2328,7 @@ common = .load-linetypes = 선종류 로드 .requires-two-positive-values = 양수 값 두 개(x,y) 또는 둘 다에 쓸 값 하나가 필요합니다. .snap-marker-color = 스냅 마커 색상 + .command-line-text-color = 명령줄 텍스트 색상 .linetypes-loaded = 선종류 __ocs_fmt_0__개를 로드했습니다. .geometric-center-snap = 기하학적 중심 .no-trim-option = 자르지 않기 diff --git a/locales/nl-NL/opencadstudio.ftl b/locales/nl-NL/opencadstudio.ftl index 541dee671..da2f69ba4 100644 --- a/locales/nl-NL/opencadstudio.ftl +++ b/locales/nl-NL/opencadstudio.ftl @@ -2329,6 +2329,7 @@ common = .load-linetypes = Lijntypen laden .requires-two-positive-values = Vereist twee positieve waarden (x,y) of één voor beide. .snap-marker-color = Kleur van snapmarkering + .command-line-text-color = Tekstkleur opdrachtregel .linetypes-loaded = __ocs_fmt_0__ lijntype(n) geladen. .geometric-center-snap = Geometrisch middelpunt .no-trim-option = Niet trimmen diff --git a/locales/pl-PL/opencadstudio.ftl b/locales/pl-PL/opencadstudio.ftl index 46587c5f5..fc0c483bf 100644 --- a/locales/pl-PL/opencadstudio.ftl +++ b/locales/pl-PL/opencadstudio.ftl @@ -2328,6 +2328,7 @@ common = .load-linetypes = Wczytaj rodzaje linii .requires-two-positive-values = Wymaga dwóch wartości dodatnich (x,y) lub jednej dla obu. .snap-marker-color = Kolor znacznika przyciągania + .command-line-text-color = Kolor tekstu wiersza poleceń .linetypes-loaded = Wczytano rodzaje linii: __ocs_fmt_0__. .geometric-center-snap = Środek geometryczny .no-trim-option = Bez przycinania diff --git a/locales/pt-BR/opencadstudio.ftl b/locales/pt-BR/opencadstudio.ftl index 558279ebc..b2c2d9a73 100644 --- a/locales/pt-BR/opencadstudio.ftl +++ b/locales/pt-BR/opencadstudio.ftl @@ -2329,6 +2329,7 @@ common = .load-linetypes = Carregar tipos de linha .requires-two-positive-values = Requer dois valores positivos (x,y) ou um para ambos. .snap-marker-color = Cor do marcador de snap + .command-line-text-color = Cor do texto da linha de comando .linetypes-loaded = __ocs_fmt_0__ tipo(s) de linha carregado(s). .geometric-center-snap = Centro geométrico .no-trim-option = Não aparar diff --git a/locales/ru-RU/opencadstudio.ftl b/locales/ru-RU/opencadstudio.ftl index 30e6767bf..86bc3212e 100644 --- a/locales/ru-RU/opencadstudio.ftl +++ b/locales/ru-RU/opencadstudio.ftl @@ -2332,6 +2332,7 @@ common = .load-linetypes = Загрузить типы линий .requires-two-positive-values = Требуются два положительных значения (x,y) или одно для обоих. .snap-marker-color = Цвет маркера привязки + .command-line-text-color = Цвет текста командной строки .linetypes-loaded = Загружено типов линий: __ocs_fmt_0__. .geometric-center-snap = Геометрический центр .no-trim-option = Без обрезки diff --git a/locales/tr-TR/opencadstudio.ftl b/locales/tr-TR/opencadstudio.ftl index 9441fb8c3..436b5bebd 100644 --- a/locales/tr-TR/opencadstudio.ftl +++ b/locales/tr-TR/opencadstudio.ftl @@ -2313,6 +2313,7 @@ common = .load-linetypes = Çizgi tiplerini yükle .requires-two-positive-values = İki pozitif değer (x,y) ya da ikisi için tek değer gerekir. .snap-marker-color = Yakalama işaretçisi rengi + .command-line-text-color = Komut satırı metin rengi .linetypes-loaded = __ocs_fmt_0__ çizgi tipi yüklendi. .geometric-center-snap = Geometrik merkez .no-trim-option = Budama yok diff --git a/locales/zh-CN/opencadstudio.ftl b/locales/zh-CN/opencadstudio.ftl index ebf534a3c..5216b4d44 100644 --- a/locales/zh-CN/opencadstudio.ftl +++ b/locales/zh-CN/opencadstudio.ftl @@ -2316,6 +2316,7 @@ common = .load-linetypes = 加载线型 .requires-two-positive-values = 需要两个正值 (x,y),或一个同时用于两者的值。 .snap-marker-color = 捕捉标记颜色 + .command-line-text-color = 命令行文字颜色 .linetypes-loaded = 已加载 __ocs_fmt_0__ 个线型。 .geometric-center-snap = 几何中心 .no-trim-option = 不修剪 diff --git a/locales/zh-TW/opencadstudio.ftl b/locales/zh-TW/opencadstudio.ftl index 76f95d1a5..bf4254fed 100644 --- a/locales/zh-TW/opencadstudio.ftl +++ b/locales/zh-TW/opencadstudio.ftl @@ -2328,6 +2328,7 @@ common = .load-linetypes = 載入線型 .requires-two-positive-values = 需要兩個正值 (x,y),或一個同時用於兩者的值。 .snap-marker-color = 鎖點標記顏色 + .command-line-text-color = 命令列文字顏色 .linetypes-loaded = 已載入 __ocs_fmt_0__ 個線型。 .geometric-center-snap = 幾何中心 .no-trim-option = 不修剪 diff --git a/src/app/mod.rs b/src/app/mod.rs index 211db1f9d..39b4b2260 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -592,6 +592,10 @@ pub(super) struct OpenCADStudio { crosshair_color_input: String, /// Explicit object-snap marker colour; `None` keeps the automatic one. snap_marker_color: Option<[u8; 3]>, + /// Explicit command-line text colour; `None` keeps the theme's. + command_text_color: Option<[u8; 3]>, + /// Editable Options buffer for the command-line text colour. + command_text_color_input: String, /// Editable Options buffer for the snap marker colour. snap_marker_color_input: String, /// Defer the ISOLINES mesh rebuild until the slider is released. @@ -2296,6 +2300,7 @@ pub enum Message { /// Edit the optional crosshair RGB value; blank restores automatic contrast. CrosshairColorChanged(String), SnapMarkerColorChanged(String), + CommandTextColorChanged(String), /// Options → Files: the default template for new drawings. QnewTemplateChanged(String), QnewTemplateBrowse, @@ -4167,6 +4172,8 @@ impl OpenCADStudio { crosshair_color_input: String::new(), snap_marker_color: None, snap_marker_color_input: String::new(), + command_text_color: None, + command_text_color_input: String::new(), isolines_awaiting_regen: false, snap_angle_input: "0".to_string(), lineweight_display_scale: 100, diff --git a/src/app/settings.rs b/src/app/settings.rs index f5fd9ea18..93fa75b38 100644 --- a/src/app/settings.rs +++ b/src/app/settings.rs @@ -432,6 +432,8 @@ pub struct UserSettings { pub crosshair_color: Option<[u8; 3]>, /// Explicit object-snap marker RGB. `None` keeps the automatic colour. pub snap_marker_color: Option<[u8; 3]>, + /// Explicit command-line text RGB. `None` keeps the theme's. + pub command_text_color: Option<[u8; 3]>, /// Model-space lineweight preview scale as a percentage. pub lineweight_display_scale: i32, /// Isometric drafting changes the grid and crosshair to the active axis @@ -825,6 +827,7 @@ impl Default for UserSettings { cursor_type: CursorType::Crosshair, crosshair_color: None, snap_marker_color: None, + command_text_color: None, lineweight_display_scale: 100, isometric_drafting: false, iso_plane: IsoPlane::Left, diff --git a/src/app/update/file.rs b/src/app/update/file.rs index b707e7440..f671242bd 100644 --- a/src/app/update/file.rs +++ b/src/app/update/file.rs @@ -682,6 +682,7 @@ impl OpenCADStudio { cursor_type: self.cursor_type, crosshair_color: self.crosshair_color, snap_marker_color: self.snap_marker_color, + command_text_color: self.command_text_color, lineweight_display_scale: self.lineweight_display_scale, isometric_drafting: self.isometric_drafting, iso_plane: self.iso_plane, @@ -798,6 +799,12 @@ impl OpenCADStudio { .snap_marker_color .map(crate::app::config::rgb_to_hex) .unwrap_or_default(); + self.command_text_color = s.command_text_color; + self.command_text_color_input = s + .command_text_color + .map(crate::app::config::rgb_to_hex) + .unwrap_or_default(); + crate::ui::command_line::set_text_color(s.command_text_color); self.lineweight_display_scale = s.lineweight_display_scale.clamp(25, 200); self.isometric_drafting = s.isometric_drafting; self.iso_plane = s.iso_plane; diff --git a/src/app/update/mod.rs b/src/app/update/mod.rs index d0e063b76..656af6fad 100644 --- a/src/app/update/mod.rs +++ b/src/app/update/mod.rs @@ -8060,6 +8060,20 @@ impl OpenCADStudio { None => Message::Noop, }, ), + Message::CommandTextColorChanged(value) => { + self.command_text_color_input = value.clone(); + let color = if value.trim().is_empty() { + None + } else if let Some(rgb) = crate::app::config::parse_hex(&value) { + Some(rgb) + } else { + return Task::none(); + }; + self.command_text_color = color; + crate::ui::command_line::set_text_color(color); + self.persist_settings_if_changed(); + Task::none() + } Message::SnapMarkerColorChanged(value) => { self.snap_marker_color_input = value.clone(); if value.trim().is_empty() { @@ -8532,7 +8546,11 @@ impl OpenCADStudio { Task::none() } - Message::OpenFolder(path) => crate::sys::open_url(&path, None), + Message::OpenFolder(path) => { + // The fonts folder exists only once something is put in it. + let _ = std::fs::create_dir_all(&path); + crate::sys::open_url(&path, None) + } Message::PickDragRectToggled(rectangle) => { self.pick_drag_rect = rectangle; diff --git a/src/app/view/modal.rs b/src/app/view/modal.rs index af15e9254..bb2a95378 100644 --- a/src/app/view/modal.rs +++ b/src/app/view/modal.rs @@ -376,6 +376,8 @@ impl OpenCADStudio { .map(|p| p.display().to_string()), autosave: crate::config::config_dir() .map(|_| std::env::temp_dir().display().to_string()), + fonts: crate::io::font_repo::fonts_dir() + .map(|p| p.display().to_string()), } } #[cfg(target_arch = "wasm32")] @@ -391,6 +393,8 @@ impl OpenCADStudio { &self.crosshair_color_input, self.snap_marker_color, &self.snap_marker_color_input, + self.command_text_color, + &self.command_text_color_input, self.lineweight_display_scale, &self.model_space, &self.model_bg_input, diff --git a/src/locale_catalog.rs b/src/locale_catalog.rs index 22e5abc54..f78d847b5 100644 --- a/src/locale_catalog.rs +++ b/src/locale_catalog.rs @@ -4894,6 +4894,7 @@ pub(super) fn message_attribute(source: &str) -> Option<(&'static str, &'static "Load Linetypes" => Some(("common", "load-linetypes")), "Requires two positive values (x,y) or one for both." => Some(("common", "requires-two-positive-values")), "Snap marker color" => Some(("common", "snap-marker-color")), + "Command line text color" => Some(("common", "command-line-text-color")), "{added} linetype(s) loaded." => Some(("common", "linetypes-loaded")), "Geometric Center" => Some(("common", "geometric-center-snap")), "No trim" => Some(("common", "no-trim-option")), diff --git a/src/ui/command_line.rs b/src/ui/command_line.rs index 8edf25dd5..5704e42a4 100644 --- a/src/ui/command_line.rs +++ b/src/ui/command_line.rs @@ -801,12 +801,18 @@ impl CommandLine { .on_input(Message::CommandInput) .on_submit(Message::CommandSubmit); } - let input = input.size(11).padding(Padding { - top: 4.0, - right: 30.0, - bottom: 4.0, - left: 6.0, - }); + let input = input + .size(11) + .padding(Padding { + top: 4.0, + right: 30.0, + bottom: 4.0, + left: 6.0, + }) + .style(|theme: &Theme, status| text_input::Style { + value: text_color(theme), + ..text_input::default(theme, status) + }); // Autocomplete suggestions panel, shown above the input row // when the user has typed a prefix that matches at least one // command. Each row is a button — clicking it dispatches the @@ -1159,18 +1165,43 @@ fn header_btn_style(theme: &Theme, status: button::Status) -> button::Style { } } +/// The user's command-line text colour, packed `0x01RRGGBB`; 0 keeps the +/// theme's. Global because the history highlighter takes a plain `fn`. +static TEXT_COLOR: std::sync::atomic::AtomicU32 = std::sync::atomic::AtomicU32::new(0); + +pub fn set_text_color(rgb: Option<[u8; 3]>) { + let packed = rgb.map_or(0, |[r, g, b]| 1 << 24 | u32::from_be_bytes([0, r, g, b])); + TEXT_COLOR.store(packed, std::sync::atomic::Ordering::Relaxed); +} + +fn user_text_color() -> Option { + match TEXT_COLOR.load(std::sync::atomic::Ordering::Relaxed) { + 0 => None, + packed => { + let [_, r, g, b] = packed.to_be_bytes(); + Some(Color::from_rgb8(r, g, b)) + } + } +} + +fn text_color(theme: &Theme) -> Color { + user_text_color().unwrap_or(theme.palette().background.base.text) +} + fn history_color(theme: &Theme, kind: &EntryKind) -> Color { let palette = theme.palette(); match kind { - EntryKind::Command => palette.background.base.text, - EntryKind::Output => palette.background.base.text.scale_alpha(0.72), + EntryKind::Command => text_color(theme), + EntryKind::Output => text_color(theme).scale_alpha(0.72), EntryKind::Error => palette.danger.base.color, - EntryKind::Info => accessible_accent_threshold( - palette.primary.base.color, - palette.background.base.color, - palette.background.base.text, - 4.5, - ), + EntryKind::Info => user_text_color().unwrap_or_else(|| { + accessible_accent_threshold( + palette.primary.base.color, + palette.background.base.color, + palette.background.base.text, + 4.5, + ) + }), } } diff --git a/src/ui/window/options.rs b/src/ui/window/options.rs index 4f0b019f2..d9a4f298f 100644 --- a/src/ui/window/options.rs +++ b/src/ui/window/options.rs @@ -97,6 +97,9 @@ pub struct Folders { pub plot_styles: Option, pub plugins: Option, pub autosave: Option, + /// Where `.shx` / `.ttf` fonts dropped in by the user (or downloaded for + /// a drawing) are found. + pub fonts: Option, } /// Values read from the current drawing's header rather than from preferences. @@ -217,6 +220,8 @@ pub fn view_window<'a>( crosshair_color_input: &'a str, snap_marker_color: Option<[u8; 3]>, snap_marker_color_input: &'a str, + command_text_color: Option<[u8; 3]>, + command_text_color_input: &'a str, lineweight_display_scale: i32, model_space: &'a crate::app::config::ModelSpaceThemeConfig, model_bg_input: &'a str, @@ -526,6 +531,24 @@ pub fn view_window<'a>( ..Default::default() }); + let command_rgb = command_text_color.unwrap_or([220, 220, 220]); + let command_swatch = container(Space::new()) + .width(28) + .height(22) + .style(move |theme: &Theme| container::Style { + background: Some(Background::Color(iced::Color::from_rgb8( + command_rgb[0], + command_rgb[1], + command_rgb[2], + ))), + border: Border { + color: theme.palette().background.strong.color, + width: 1.0, + radius: 3.0.into(), + }, + ..Default::default() + }); + let snap_rgb = snap_marker_color.unwrap_or([255, 230, 26]); let snap_swatch = container(Space::new()) .width(28) @@ -803,6 +826,18 @@ pub fn view_window<'a>( .spacing(10) .align_y(iced::Center), ) + .push(Space::new().height(10)) + .push( + row![ + text(crate::t!("Command line text color")).size(12).width(140), + command_swatch, + text_input(crate::t!("#RRGGBB or blank").as_ref(), command_text_color_input) + .on_input(Message::CommandTextColorChanged) + .width(150), + ] + .spacing(10) + .align_y(iced::Center), + ) .push(Space::new().height(6)) .push( text(crate::t!("Leave the color blank to keep automatic viewport contrast.")) @@ -1700,6 +1735,8 @@ pub fn view_window<'a>( folder_row(crate::t!("Plugins"), folders.plugins.clone()), Space::new().height(12), folder_row(crate::t!("Autosave files"), folders.autosave.clone()), + Space::new().height(12), + folder_row(crate::t!("Fonts"), folders.fonts.clone()), Space::new().height(16), text(crate::t!("Default template for new drawings")).size(12), Space::new().height(4),