diff --git a/branding/ui-icons/icons.py b/branding/ui-icons/icons.py index 51aa85d7..2ecc1973 100644 --- a/branding/ui-icons/icons.py +++ b/branding/ui-icons/icons.py @@ -123,6 +123,10 @@ I["Triangle"] = (None, "M8 3 L13.5 12.5 H2.5 Z") I["TriangleRight"] = (None, "M5 3 L12 8 L5 13 Z") I["Cross"] = ("M4.5 4.5 L11.5 11.5 M11.5 4.5 L4.5 11.5", None) +# Glyphs that point along the reading direction (arrows, chevrons, start-aligned text lines): mirrored in RTL. +# Everything else (clocks, media controls, the ▶ rendered status, symmetric shapes) never mirrors. +DIRECTIONAL = {"Back", "Forward", "ChevronLeft", "ChevronRight", "ExternalLink", "Jobs", "Logs", "ViewList"} + out = os.path.join(os.path.dirname(__file__), "..", "..", "src", "Titano.Ui", "Icons", "Icons.xaml") with open(out, "w") as f: f.write('\n') f.write('\n') diff --git a/docs/ui/DESIGN.md b/docs/ui/DESIGN.md index 6bcfbea5..fbced7ab 100644 --- a/docs/ui/DESIGN.md +++ b/docs/ui/DESIGN.md @@ -84,7 +84,12 @@ Label column left of controls: 116 px in panels, 180 px in Settings. 16 px, 1.5 px strokes, round caps and joins, `currentColor`, drawn as `PathGeometry` / `DrawingImage` resources in `Titano.App/Icons/Icons.xaml` (source SVGs in `branding/ui-icons/` if generated by a tool). No icon fonts, no emoji in shipped UI (the mockups use a few glyphs -only as placeholders: replace ⟳ ▾ ✕ ■ ❚❚ ≡ with drawn icons). Directional icons mirror in RTL. +only as placeholders: replace ⟳ ▾ ✕ ■ ❚❚ ≡ with drawn icons). Directional icons mirror in RTL: +`IconData.IsDirectional` marks the glyphs that point along the reading direction (back/forward, chevrons +left/right, external link, start-aligned lines); `ui:Bidi.IsDirectional` overrides it for a subtree (a ▶ used +as "next", a chevron on a left-to-right time axis). Every other glyph (clocks, media controls, the ▶ rendered +status) and the brand mark keep their drawn orientation. Photos, previews, charts, numbers, paths and +templates are left-to-right islands (`FlowDirection="LeftToRight"` on the smallest element holding them). ## 6. App icon (`branding/`) diff --git a/i18n/en/Common.resx b/i18n/en/Common.resx index 7df05c2e..43d62770 100644 --- a/i18n/en/Common.resx +++ b/i18n/en/Common.resx @@ -5,14 +5,21 @@ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Auto + Auto · {0}{0} advisor value + curvecontrol type read by screen readers, lower case + Point {0} of {1}: {2}{0} position; {1} point count; {2} coordinates (Common.CurveReadout) + {0} → {1}invariant; drawn left to right in every language; {0} horizontal value; {1} vertical value {0} d {1} h {0} h {1} m {0} min {0} s + More choices n/a Open Open logs {0} % + Remove + Back to Auto {0} B {0} GB {0} KB diff --git a/i18n/en/Jobs.resx b/i18n/en/Jobs.resx index 9e6c4cd8..1bd5a967 100644 --- a/i18n/en/Jobs.resx +++ b/i18n/en/Jobs.resx @@ -67,6 +67,8 @@ queued running {0} · {1} + {0} → {1}invariant; {0} sequence title; {1} export preset + {0} ← {1}invariant; right-to-left languages: the arrow points from the sequence to the preset this PC Workers {0} / {1} diff --git a/i18n/en/Shell.resx b/i18n/en/Shell.resx index a2ff72aa..af382003 100644 --- a/i18n/en/Shell.resx +++ b/i18n/en/Shell.resx @@ -6,7 +6,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Titanoinvariant Ready + Pause job Ready · {0} jobs queued + Ready · {0} job queued{0} count + Ready · {0} jobs queued{0} count About Archive Import @@ -37,4 +40,5 @@ Connect to a server {0} on this network · {1} Welcome to Titano + {0} — {1}{0} program name; {1} screen title diff --git a/i18n/en/Tooltips.resx b/i18n/en/Tooltips.resx index e264dc55..33bc10be 100644 --- a/i18n/en/Tooltips.resx +++ b/i18n/en/Tooltips.resx @@ -87,6 +87,7 @@ Re-hash every original and report bit rot · reads the whole archive {0} · Right arrow opens the year, Left arrow closes it Dismiss + Close this notice · Esc Open the folder with the log files Return to the advisor's value Read every frame again and refresh the analysis · Ctrl+Shift+A diff --git a/i18n/it/Common.it.resx b/i18n/it/Common.it.resx index 8f944d39..674200b3 100644 --- a/i18n/it/Common.it.resx +++ b/i18n/it/Common.it.resx @@ -5,14 +5,21 @@ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Auto + Auto · {0} + curva + Punto {0} di {1}: {2} + {0} → {1} {0} g {1} h {0} h {1} m {0} min {0} s + Altre scelte n/d Apri Apri log {0}% + Rimuovi + Torna ad Auto {0} byte {0} GB {0} KB diff --git a/i18n/it/Shell.it.resx b/i18n/it/Shell.it.resx index 6da87848..cea2f212 100644 --- a/i18n/it/Shell.it.resx +++ b/i18n/it/Shell.it.resx @@ -5,7 +5,10 @@ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Pronto + Pausa attività Pronto · {0} attività in coda + Pronto · {0} attività in coda + Pronto · {0} attività in coda Informazioni Archivio Importa @@ -36,4 +39,5 @@ Connettiti a un server {0} in questa rete · {1} Benvenuto in Titano + {0} — {1} diff --git a/i18n/it/Tooltips.it.resx b/i18n/it/Tooltips.it.resx index f384abea..e8320ece 100644 --- a/i18n/it/Tooltips.it.resx +++ b/i18n/it/Tooltips.it.resx @@ -87,6 +87,7 @@ Ricalcola l'hash di ogni originale e segnala i danni · legge tutto l'archivio {0} · Freccia destra apre l'anno, freccia sinistra lo chiude Chiudi + Chiudi questo avviso · Esc Apri la cartella dei file di log Torna al valore consigliato Rilegge ogni fotogramma e aggiorna l’analisi · Ctrl+Maiusc+A diff --git a/src/Titano.App/Infrastructure/UiLanguage.cs b/src/Titano.App/Infrastructure/UiLanguage.cs index 66ba0b02..28bc456d 100644 --- a/src/Titano.App/Infrastructure/UiLanguage.cs +++ b/src/Titano.App/Infrastructure/UiLanguage.cs @@ -1,21 +1,22 @@ using System.Globalization; using System.Windows; using Titano.Core.Localization; +using Titano.Ui.Controls; namespace Titano.App.Infrastructure; -/// Switches the UI language at run time without restart (BRIEF §16), mirroring right-to-left languages. +/// +/// Switches the UI language at run time without restart (BRIEF §16). A takes the +/// language's direction when it is created and follows each switch, so right-to-left languages mirror windows opened +/// before and after this call alike; plain windows (the full-screen preview) take it when they load. +/// public static class UiLanguage { static UiLanguage() { - // Windows created later (the main window at start, every dialog) take the reading direction when they load. - EventManager.RegisterClassHandler(typeof(Window), FrameworkElement.LoadedEvent, new RoutedEventHandler((sender, _) => ((Window)sender).FlowDirection = Direction)); + EventManager.RegisterClassHandler(typeof(Window), FrameworkElement.LoadedEvent, new RoutedEventHandler((sender, _) => ((Window)sender).FlowDirection = Bidi.UiDirection)); } - /// The reading direction of the current language. - public static FlowDirection Direction => Loc.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; - /// Applies (or the OS language when null) and returns the culture in use. public static CultureInfo Apply(string? code) { @@ -32,10 +33,6 @@ public static class UiLanguage CultureInfo.DefaultThreadCurrentUICulture = culture; CultureInfo.CurrentUICulture = culture; Loc.SetCulture(culture); - if (Application.Current is { } app) - { - foreach (Window window in app.Windows) window.FlowDirection = Direction; - } return culture; } } diff --git a/src/Titano.App/Sections/AboutView.xaml b/src/Titano.App/Sections/AboutView.xaml index ac29b3b4..9f2c3b37 100644 --- a/src/Titano.App/Sections/AboutView.xaml +++ b/src/Titano.App/Sections/AboutView.xaml @@ -9,8 +9,7 @@ - - + diff --git a/src/Titano.App/Sections/ImportView.xaml b/src/Titano.App/Sections/ImportView.xaml index 71f1b441..9d80c554 100644 --- a/src/Titano.App/Sections/ImportView.xaml +++ b/src/Titano.App/Sections/ImportView.xaml @@ -102,10 +102,7 @@ - + - + - - - - - diff --git a/src/Titano.App/Shell/ConfirmDialog.xaml b/src/Titano.App/Shell/ConfirmDialog.xaml index 934a8896..3e05b8cf 100644 --- a/src/Titano.App/Shell/ConfirmDialog.xaml +++ b/src/Titano.App/Shell/ConfirmDialog.xaml @@ -5,14 +5,17 @@ xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui" Title="{l:Loc Shell.AppName}" IsDialog="True" ResizeMode="NoResize" SizeToContent="Height" Width="460" - WindowStartupLocation="CenterOwner" ShowInTaskbar="False"> - + WindowStartupLocation="CenterOwner" ShowInTaskbar="False" + AutomationProperties.Name="{Binding Heading}" AutomationProperties.HelpText="{Binding Message}"> + - + @@ -20,7 +23,7 @@ AutomationProperties.Name="{Binding TypedPrompt}" TextChanged="OnTyped" /> -