Titano: Library completion, remote editing, accessibility and RTL pass, remaining translations #3

Merged
Alby96 merged 117 commits from claude/keen-knuth-uhxv8w into main 2026-10-12 09:24:21 +02:00
Showing only changes of commit a1b3cdc1ce - Show all commits
@@ -1,4 +1,3 @@
using System.Globalization;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
@@ -277,18 +276,34 @@ public sealed class ImportScreenSmokeTests
private static IEnumerable<ListBoxItem> DeviceItems(ScreenSmokeTests.SampleApp app) =>
app.FindAll<ListBoxItem>().Where(i => i.IsVisible && i.DataContext is ImportSource);
/// <summary>The text is shown whole: its formatted width fits the width the layout gave it.</summary>
/// <summary>
/// The text is shown whole: a copy with the same font, numerals and padding, measured by the same layout engine,
/// needs no more room than the layout gave the shown one (a formatted-text estimate differs by a few pixels).
/// </summary>
private static bool Fits(TextBlock text)
{
var typeface = new Typeface(text.FontFamily, text.FontStyle, text.FontWeight, text.FontStretch);
var formatted = new FormattedText(text.Text, CultureInfo.CurrentUICulture, text.FlowDirection, typeface, text.FontSize, Brushes.Black,
VisualTreeHelper.GetDpi(text).PixelsPerDip);
var probe = new TextBlock
{
Text = text.Text,
FontFamily = text.FontFamily,
FontSize = text.FontSize,
FontStyle = text.FontStyle,
FontWeight = text.FontWeight,
FontStretch = text.FontStretch,
FlowDirection = text.FlowDirection,
Language = text.Language,
Padding = text.Padding,
TextWrapping = text.TextWrapping,
};
System.Windows.Documents.Typography.SetNumeralAlignment(probe, System.Windows.Documents.Typography.GetNumeralAlignment(text));
TextOptions.SetTextFormattingMode(probe, TextOptions.GetTextFormattingMode(text));
if (text.TextWrapping != TextWrapping.NoWrap)
{
formatted.MaxTextWidth = System.Math.Max(1, text.ActualWidth - text.Padding.Left - text.Padding.Right + 1);
return formatted.Height <= text.ActualHeight + 0.5;
probe.Measure(new Size(text.ActualWidth, double.PositiveInfinity));
return probe.DesiredSize.Height <= text.ActualHeight + 0.5;
}
return formatted.WidthIncludingTrailingWhitespace <= text.ActualWidth - text.Padding.Left - text.Padding.Right + 1;
probe.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
return probe.DesiredSize.Width <= text.ActualWidth + 1;
}
private static double Left(ScreenSmokeTests.SampleApp app, FrameworkElement element) => element.TranslatePoint(new Point(0, 0), View(app)).X;