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=b77a5c561934e089System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Auto
+ 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 choicesn/aOpenOpen 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 @@
queuedrunning{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 presetthis PCWorkers {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=b77a5c561934e089TitanoinvariantReady
+ Pause jobReady · {0} jobs queued
+ Ready · {0} job queued{0} count
+ Ready · {0} jobs queued{0} countAboutArchiveImport
@@ -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 itDismiss
+ Close this notice · EscOpen the folder with the log filesReturn to the advisor's valueRead 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=b77a5c561934e089System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Auto
+ Auto · {0}
+ curva
+ Punto {0} di {1}: {2}
+ {0} → {1}{0} g {1} h{0} h {1} m{0} min{0} s
+ Altre scelten/dApriApri 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=b77a5c561934e089System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Pronto
+ Pausa attivitàPronto · {0} attività in coda
+ Pronto · {0} attività in coda
+ Pronto · {0} attività in codaInformazioniArchivioImporta
@@ -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 chiudeChiudi
+ Chiudi questo avviso · EscApri la cartella dei file di logTorna al valore consigliatoRilegge 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" />
-
+
diff --git a/src/Titano.App/Shell/ConfirmDialog.xaml.cs b/src/Titano.App/Shell/ConfirmDialog.xaml.cs
index 025460db..72f55c6b 100644
--- a/src/Titano.App/Shell/ConfirmDialog.xaml.cs
+++ b/src/Titano.App/Shell/ConfirmDialog.xaml.cs
@@ -12,7 +12,11 @@ public sealed partial class ConfirmDialog : TitanoWindow
DataContext = request;
InitializeComponent();
Action.SetResourceReference(StyleProperty, request.IsDestructive ? "Button.Destructive" : "Button.Primary");
- if (request.TypedConfirmation is null) return;
+ if (request.TypedConfirmation is null)
+ {
+ Loaded += (_, _) => Safe.Focus();
+ return;
+ }
Typing.Visibility = Visibility.Visible;
Loaded += (_, _) => Typed.Focus();
EnableAction(false);
diff --git a/src/Titano.App/Shell/ErrorText.cs b/src/Titano.App/Shell/ErrorText.cs
new file mode 100644
index 00000000..5c9dd313
--- /dev/null
+++ b/src/Titano.App/Shell/ErrorText.cs
@@ -0,0 +1,37 @@
+using System.Reflection;
+using Titano.Core.Archiving;
+using Titano.Core.Import;
+using Titano.Core.Localization;
+using Titano.Core.Render;
+using Titano.Data.Archiving;
+using Titano.Data.Sync;
+using Titano.Protocol.Client;
+
+namespace Titano.App.Shell;
+
+///
+/// The sentence an error toast shows (BRIEF §0.2: one sentence saying what happened plus one action). Only failures
+/// that carry a catalog sentence say what happened; anything else (framework and OS messages, often technical
+/// English) reads "Something went wrong." and stays in the log.
+///
+public static class ErrorText
+{
+ public static string For(Exception ex) => Describe(Unwrap(ex)) ?? Loc.L("Errors.Unexpected");
+
+ private static string? Describe(Exception ex) => ex switch
+ {
+ LeaseUnavailableException or ArchiveOfflineException or NewerFormatException or ImportSourceUnavailableException
+ or CopyVerificationException or StaleRenamePlanException or SyncConflictChangedException => ex.Message,
+ // The server words its errors in the client's language (Accept-Language).
+ TitanoApiException api when !string.IsNullOrWhiteSpace(api.Error.Message) => api.Error.Message,
+ RenderException render => Loc.Get(render.ReasonKey, Loc.Culture) is null ? null : Loc.L(render.ReasonKey, [.. render.Args]),
+ _ => null,
+ };
+
+ /// Awaited tasks and reflection wrap the real failure in one layer or more.
+ private static Exception Unwrap(Exception ex)
+ {
+ while (ex is AggregateException { InnerExceptions.Count: 1 } or TargetInvocationException && ex.InnerException is { } inner) ex = inner;
+ return ex;
+ }
+}
diff --git a/src/Titano.App/Shell/LoginDialog.xaml b/src/Titano.App/Shell/LoginDialog.xaml
index 119b339c..0e4fc295 100644
--- a/src/Titano.App/Shell/LoginDialog.xaml
+++ b/src/Titano.App/Shell/LoginDialog.xaml
@@ -5,11 +5,11 @@
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui"
Title="{l:Loc Shell.AppName}"
IsDialog="True" ResizeMode="NoResize" SizeToContent="Height" Width="440"
- WindowStartupLocation="CenterOwner" ShowInTaskbar="False">
+ WindowStartupLocation="CenterOwner" ShowInTaskbar="False" AutomationProperties.Name="{l:Loc Server.Login.Title}">
-
+
diff --git a/src/Titano.App/Shell/LoginDialog.xaml.cs b/src/Titano.App/Shell/LoginDialog.xaml.cs
index 85f4e999..b0adb296 100644
--- a/src/Titano.App/Shell/LoginDialog.xaml.cs
+++ b/src/Titano.App/Shell/LoginDialog.xaml.cs
@@ -1,4 +1,6 @@
using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Automation.Peers;
using Titano.Ui.Controls;
namespace Titano.App.Shell;
@@ -6,7 +8,8 @@ namespace Titano.App.Shell;
///
/// The login form (BRIEF §12.7). It calls back the connection with the credentials and stays open with the
/// error sentence until the sign-in succeeds or the user cancels. The password never leaves the PasswordBox
-/// except for that call.
+/// except for that call. A failed sign-in is announced to screen readers and marks the password box (error border,
+/// sentence as its help text) until the next attempt.
///
public sealed partial class LoginDialog : TitanoWindow
{
@@ -40,6 +43,7 @@ public sealed partial class LoginDialog : TitanoWindow
{
SignIn.IsEnabled = false;
Error.Visibility = Visibility.Collapsed;
+ Field.SetError(Password, null);
try
{
var error = await _signIn(User.Text, Password.Password);
@@ -50,8 +54,11 @@ public sealed partial class LoginDialog : TitanoWindow
}
Error.Text = error;
Error.Visibility = Visibility.Visible;
+ Field.SetError(Password, error);
Password.Clear();
Password.Focus();
+ UIElementAutomationPeer.CreatePeerForElement(this)?.RaiseNotificationEvent(
+ AutomationNotificationKind.ActionCompleted, AutomationNotificationProcessing.ImportantMostRecent, error, "Titano.SignIn");
}
finally
{
diff --git a/src/Titano.App/Shell/MainWindow.xaml b/src/Titano.App/Shell/MainWindow.xaml
index e2d5156e..70b7a7e3 100644
--- a/src/Titano.App/Shell/MainWindow.xaml
+++ b/src/Titano.App/Shell/MainWindow.xaml
@@ -4,6 +4,7 @@
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui"
xmlns:shell="clr-namespace:Titano.App.Shell"
+ xmlns:infra="clr-namespace:Titano.App.Infrastructure"
xmlns:s="clr-namespace:Titano.App.Sections"
Title="{Binding WindowTitle}"
Width="1440" Height="900" MinWidth="1200" MinHeight="760"
@@ -14,8 +15,24 @@
-
-
+
+
+
+
+
-
+
-
-
+
+
@@ -61,18 +80,22 @@
-
+
-
-
-
-
+
+
-
+
+
+
+
diff --git a/src/Titano.App/Shell/MainWindow.xaml.cs b/src/Titano.App/Shell/MainWindow.xaml.cs
index bc7982ec..b5fc47f7 100644
--- a/src/Titano.App/Shell/MainWindow.xaml.cs
+++ b/src/Titano.App/Shell/MainWindow.xaml.cs
@@ -1,5 +1,9 @@
using System.Collections.Specialized;
using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Threading;
using Titano.App.Infrastructure;
using Titano.Ui.Controls;
@@ -14,21 +18,50 @@ public partial class MainWindow : TitanoWindow
_shell = shell;
DataContext = shell;
InitializeComponent();
- Rail.Width = shell.IsRailCollapsed ? 48 : 128;
UpdateConnection();
shell.PropertyChanged += (_, e) =>
{
- if (e.PropertyName is nameof(ShellViewModel.IsRailCollapsed) or "")
- Rail.Width = shell.IsRailCollapsed ? 48 : 128;
if (e.PropertyName is nameof(ShellViewModel.IsConnected) or "") UpdateConnection();
+ if (e.PropertyName is nameof(ShellViewModel.IsWelcomeOpen) or "") FocusWelcome();
};
shell.PendingToasts.CollectionChanged += OnToastRequested;
+ Loaded += (_, _) => FocusWelcome();
RestorePlacement();
Closing += (_, _) => SavePlacement();
}
+ /// F6 moves the keyboard to the newest notification (as in Windows apps), Esc there dismisses it.
+ protected override void OnKeyDown(KeyEventArgs e)
+ {
+ base.OnKeyDown(e);
+ if (!e.Handled && e.Key == Key.F6 && Keyboard.Modifiers == ModifierKeys.None) e.Handled = Toasts.FocusNewest();
+ }
+
private void UpdateConnection() =>
- Connection.SetResourceReference(System.Windows.Controls.TextBlock.ForegroundProperty, _shell.IsConnected ? "Brush.Accent" : "Brush.TextMuted");
+ Connection.SetResourceReference(TextBlock.ForegroundProperty, _shell.IsConnected ? "Brush.Accent" : "Brush.TextMuted");
+
+ /// The first-run dialog takes the keyboard on its chosen option once it is on screen.
+ private void FocusWelcome()
+ {
+ if (!_shell.IsWelcomeOpen) return;
+ Dispatcher.BeginInvoke(DispatcherPriority.Loaded, () =>
+ {
+ if (!_shell.IsWelcomeOpen || !IsLoaded) return;
+ if (FindChecked(WelcomeOverlay) is { } choice) choice.Focus();
+ else WelcomeOverlay.MoveFocus(new TraversalRequest(FocusNavigationDirection.First));
+ });
+ }
+
+ private static RadioButton? FindChecked(DependencyObject root)
+ {
+ for (var i = 0; i < VisualTreeHelper.GetChildrenCount(root); i++)
+ {
+ var child = VisualTreeHelper.GetChild(root, i);
+ if (child is RadioButton { IsChecked: true } radio) return radio;
+ if (FindChecked(child) is { } nested) return nested;
+ }
+ return null;
+ }
private void OnToastRequested(object? sender, NotifyCollectionChangedEventArgs e)
{
diff --git a/src/Titano.App/Shell/ScreenCapture.cs b/src/Titano.App/Shell/ScreenCapture.cs
index 60073f16..f3dfbe2b 100644
--- a/src/Titano.App/Shell/ScreenCapture.cs
+++ b/src/Titano.App/Shell/ScreenCapture.cs
@@ -7,6 +7,7 @@ using Titano.App.Archiving;
using Titano.App.DesignTime;
using Titano.App.Editor;
using Titano.App.Import;
+using Titano.App.Infrastructure;
using Titano.App.Server;
using Titano.App.Settings;
using Titano.Core.Diagnostics;
@@ -17,7 +18,9 @@ namespace Titano.App.Shell;
///
/// Titano.exe --capture <dir>: renders every client screen at 1440×900 in the dark and light themes to
/// <screen>-<theme>.png from (first run on an empty index, then a populated
-/// one, then the sync table with transfers, a conflict and its confirmation), for visual review and phase reports (BRIEF §20.2), then exits.
+/// one, then the sync table with transfers, a conflict and its confirmation), plus the Library, the editor's Exposure
+/// tab and the import plan in Arabic (*-rtl-dark.png, right to left), for visual review and phase reports
+/// (BRIEF §20.2), then exits.
///
public static class ScreenCapture
{
@@ -79,6 +82,9 @@ public static class ScreenCapture
written += await SaveAsync(window, directory, "library-list", theme, waitForThumbnails: shell);
shell.Library.LayoutIndex = 0;
shell.Library.ClearSelectionCommand.Execute(null);
+ shell.IsRailCollapsed = true;
+ written += await SaveAsync(window, directory, "library-rail-collapsed", theme, waitForThumbnails: shell);
+ shell.IsRailCollapsed = false;
shell.Navigate(SectionKey.Jobs);
if (shell.Jobs.Rows.Count > 0) shell.Jobs.Rows[0].IsExpanded = true;
@@ -213,6 +219,8 @@ public static class ScreenCapture
foreach (var toast in window.Toasts.Toasts.ToList()) window.Toasts.Dismiss(toast);
}
+ written += await CaptureRightToLeftAsync(window, shell, editor, directory);
+
// Last, as it stays: an analysis of the sequence running (settings disabled, viewing tools live).
await sample.MarkAnalysingAsync(id);
await editor.AttachJobsAsync();
@@ -224,6 +232,41 @@ public static class ScreenCapture
return written;
}
+ ///
+ /// The Library, the editor's Exposure tab and the import plan in Arabic, dark: the layout mirrors while photos,
+ /// charts, the filmstrip and templates stay left to right. English is restored whatever happens.
+ ///
+ private static async Task CaptureRightToLeftAsync(MainWindow window, ShellViewModel shell, EditorViewModel editor, string directory)
+ {
+ var written = 0;
+ var frame = editor.CurrentIndex;
+ ThemeManager.Apply(AppTheme.Dark);
+ UiLanguage.Apply("ar");
+ try
+ {
+ DismissToasts(window);
+ shell.Navigate(SectionKey.Library);
+ written += await SaveAsync(window, directory, "library-rtl", AppTheme.Dark, waitForThumbnails: shell);
+
+ shell.Navigate(SectionKey.Sequence);
+ editor.SelectedTab = editor.Exposure;
+ editor.IsCompare = true;
+ editor.CurrentIndex = 45;
+ written += await SaveEditorAsync(window, editor, directory, "sequence-exposure-rtl", AppTheme.Dark);
+
+ await ImportScenes.ShowAsync(shell, "plan");
+ DismissToasts(window);
+ written += await SaveAsync(window, directory, "import-plan-rtl", AppTheme.Dark);
+ }
+ finally
+ {
+ UiLanguage.Apply("en");
+ }
+ shell.Navigate(SectionKey.Sequence);
+ editor.CurrentIndex = frame;
+ return written;
+ }
+
private static async Task SaveEditorAsync(Window window, EditorViewModel editor, string directory, string screen, AppTheme theme)
{
await Settle(window);
@@ -278,6 +321,7 @@ public static class ScreenCapture
return false;
}
var bitmap = new RenderTargetBitmap(width, height, dpi.PixelsPerInchX, dpi.PixelsPerInchY, PixelFormats.Pbgra32);
+ // A right-to-left window's content already renders mirrored, as on screen.
bitmap.Render(root);
var encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(bitmap));
diff --git a/src/Titano.App/Shell/ShellViewModel.cs b/src/Titano.App/Shell/ShellViewModel.cs
index ad645906..6a68c0e3 100644
--- a/src/Titano.App/Shell/ShellViewModel.cs
+++ b/src/Titano.App/Shell/ShellViewModel.cs
@@ -16,6 +16,7 @@ public sealed class ShellViewModel : LocalizedViewModel
private SectionViewModel _current;
private bool _isRailCollapsed;
private string? _jobText;
+ private string? _jobName;
private double _jobProgress;
private bool _jobActive;
private bool _jobIndeterminate;
@@ -85,12 +86,17 @@ public sealed class ShellViewModel : LocalizedViewModel
get => _welcome;
private set
{
- if (Set(ref _welcome, value)) OnPropertyChanged(nameof(IsWelcomeOpen));
+ if (!Set(ref _welcome, value)) return;
+ OnPropertyChanged(nameof(IsWelcomeOpen));
+ OnPropertyChanged(nameof(IsShellEnabled));
}
}
public bool IsWelcomeOpen => _welcome is not null;
+ /// The rail and the sections take input only while no first-run dialog covers them.
+ public bool IsShellEnabled => _welcome is null;
+
public SectionViewModel Current
{
get => _current;
@@ -105,7 +111,7 @@ public sealed class ShellViewModel : LocalizedViewModel
}
}
- public string WindowTitle => Current == Library ? "Titano" : "Titano — " + Current.Title;
+ public string WindowTitle => Current == Library ? Loc.L("Shell.AppName") : Loc.L("Shell.WindowTitle", Loc.L("Shell.AppName"), Current.Title);
public bool IsRailCollapsed
{
@@ -160,7 +166,7 @@ public sealed class ShellViewModel : LocalizedViewModel
// ---- Job bar ----
public string JobText => _jobActive && _jobText is not null
? _jobText
- : _queuedCount > 0 ? Loc.L("Shell.JobBar.Ready", _queuedCount) : Loc.L("Shell.JobBar.Idle");
+ : _queuedCount > 0 ? Loc.Plural("Shell.JobBar.Ready", _queuedCount) : Loc.L("Shell.JobBar.Idle");
public double JobProgress { get => _jobProgress; private set => Set(ref _jobProgress, value); }
public bool IsJobActive
@@ -179,14 +185,25 @@ public sealed class ShellViewModel : LocalizedViewModel
/// Pauses the job the bar shows.
public ICommand? StopJobCommand => Jobs.PauseCurrentCommand;
- /// Updates the global job bar (and the taskbar progress through the window).
- public void SetJob(string? text, double progress, bool indeterminate = false)
+ ///
+ /// What screen readers hear from the job bar: the job when one starts, the idle line when the last one ends; not its
+ /// progress, speed or time left, which change every second.
+ ///
+ public string JobAnnouncement => _jobActive && _jobName is not null ? _jobName : JobText;
+
+ ///
+ /// Updates the global job bar (and the taskbar progress through the window). says which job
+ /// it is without its progress ("Render: Harbour sunset"); null reads .
+ ///
+ public void SetJob(string? text, double progress, bool indeterminate = false, string? name = null)
{
_jobText = text;
+ _jobName = text is null ? null : name ?? text;
IsJobActive = text is not null;
JobProgress = progress;
IsJobIndeterminate = indeterminate;
OnPropertyChanged(nameof(JobText));
+ OnPropertyChanged(nameof(JobAnnouncement));
}
// ---- Status strip ----
@@ -222,6 +239,7 @@ public sealed class ShellViewModel : LocalizedViewModel
_queuedCount = queued;
OnPropertyChanged(nameof(JobsText));
OnPropertyChanged(nameof(JobText));
+ OnPropertyChanged(nameof(JobAnnouncement));
}
public void Navigate(SectionKey key)
@@ -250,14 +268,14 @@ public sealed class ShellViewModel : LocalizedViewModel
ActionCommand = action is null ? null : new RelayCommand(action),
});
- /// Errors are one sentence saying what happened plus one action (BRIEF §0.2 rule 6).
+ /// Errors are one sentence saying what happened plus one action (BRIEF §0.2 rule 6); the details go to the log.
public void ReportError(Exception ex)
{
Log.Error("ui", "Operation failed", ex);
ShowToast(new Toast
{
- Title = Loc.L("Errors.Unexpected"),
- Message = ex.Message,
+ Title = ErrorText.For(ex),
+ IsError = true,
ActionText = Loc.L("Common.OpenLogs"),
ActionToolTip = Loc.L("Tooltips.Common.OpenLogs"),
ActionCommand = new RelayCommand(() => ShellActions.Reveal(Services.Environment.LogDirectory)),
diff --git a/src/Titano.Data/Processing/ProcessingJobs.cs b/src/Titano.Data/Processing/ProcessingJobs.cs
index bc990d70..8f124c46 100644
--- a/src/Titano.Data/Processing/ProcessingJobs.cs
+++ b/src/Titano.Data/Processing/ProcessingJobs.cs
@@ -37,7 +37,10 @@ public static class ProcessingJobs
ArgumentNullException.ThrowIfNull(sequence);
ArgumentNullException.ThrowIfNull(export);
var parameters = Parameters(export, sourceWidth, sourceHeight, project?.ToJson(), useProxies);
- return new ArchiveJobRequest(JobKind.Render, [sequence.Id], $"{sequence.DisplayTitle} → {parameters.PresetName}",
+ // The label is stored as written, in the language of the moment like the preset name: its arrow points from the
+ // sequence to the preset in that language's reading direction.
+ var label = Loc.L(Loc.IsRightToLeft ? "Jobs.Target.RenderRtl" : "Jobs.Target.Render", sequence.DisplayTitle, parameters.PresetName);
+ return new ArchiveJobRequest(JobKind.Render, [sequence.Id], label,
JsonSerializer.Serialize(parameters, ProtocolJson.Default.RenderJobParameters), JobPriority.User);
}
diff --git a/src/Titano.Setup/Views/SetupWindow.xaml b/src/Titano.Setup/Views/SetupWindow.xaml
index 52af7fe6..fe8ffd5e 100644
--- a/src/Titano.Setup/Views/SetupWindow.xaml
+++ b/src/Titano.Setup/Views/SetupWindow.xaml
@@ -18,8 +18,7 @@
-
-
+
diff --git a/src/Titano.Setup/Views/SetupWindow.xaml.cs b/src/Titano.Setup/Views/SetupWindow.xaml.cs
index 17a292d2..6433f946 100644
--- a/src/Titano.Setup/Views/SetupWindow.xaml.cs
+++ b/src/Titano.Setup/Views/SetupWindow.xaml.cs
@@ -26,8 +26,6 @@ internal sealed partial class SetupWindow : TitanoWindow
_shownStage = model.Stage;
DataContext = model;
InitializeComponent();
- ApplyFlowDirection();
- Loc.CultureChanged += OnCultureChanged;
// Ahead of the chrome's own Close binding, which is always enabled.
CommandBindings.Insert(0, new CommandBinding(SystemCommands.CloseWindowCommand, null, OnCanClose));
model.PickFolder = initial => FolderPicker.Pick(new WindowInteropHelper(this).Handle, Loc.L("Setup.Field.Folder"), initial);
@@ -46,12 +44,6 @@ internal sealed partial class SetupWindow : TitanoWindow
base.OnClosing(e);
}
- protected override void OnClosed(EventArgs e)
- {
- Loc.CultureChanged -= OnCultureChanged;
- base.OnClosed(e);
- }
-
private void OnCanClose(object sender, CanExecuteRoutedEventArgs e)
{
if (!_model.IsWorking) return;
@@ -97,8 +89,4 @@ internal sealed partial class SetupWindow : TitanoWindow
var buttons = Footer.Children.OfType