fix(ui): toasts render; RTL-aware icons, charts and media; keyboard and screen-reader support in the kit
- ToastHost gets its template (nothing drew before); toasts are announced, pause while hovered or focused, Esc dismisses the focused one, the action closes it, FocusNewest brings the keyboard to them. - Windows take the UI language's direction when created and follow every switch. - Icons mirror only when the glyph is directional (IconData.IsDirectional, Bidi.IsDirectional override); the brand mark never mirrors; icons centre in stretched slots (ComboBox chevron). - Card photos, scrub position, preview surface and shot data, mono templates, paths are left-to-right islands; the preview tool row follows the layout direction. - Chart words (categories, legends, summaries) read in the UI direction and legends start on its side. - Automation peers: charts as named images, filmstrip as a slider, curve editor value, preview image, split button, AutoSlider group; localized names for caption, reset, remove, dismiss and drop-down buttons. - Focus visible on list and table rows and the preview; curve editor fully operable by keyboard. - Rail item collapsed layout fixed; job bar trims its text only once the bar is at its minimum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
29 files changed
+711
-144
No files matched your search
@@ -85,6 +85,9 @@ public sealed class BarChart : DrawingElement
|
||||
remove => RemoveHandler(ItemActivatedEvent, value);
|
||||
}
|
||||
|
||||
protected internal override string? AutomationDescription =>
|
||||
Items is { Count: > 0 } items ? string.Join(Environment.NewLine, items.Select(ReadoutText)) : null;
|
||||
|
||||
protected override Size MeasureOverride(Size availableSize)
|
||||
{
|
||||
var count = Items?.Count ?? 0;
|
||||
@@ -166,10 +169,10 @@ public sealed class BarChart : DrawingElement
|
||||
double labelWidth = 0, valueWidth = 0;
|
||||
for (var i = 0; i < items.Count; i++)
|
||||
{
|
||||
labels[i] = CreateText(items[i].Label, LabelSize, faint);
|
||||
labels[i] = CreateLabel(items[i].Label, LabelSize, faint);
|
||||
labelWidth = Math.Max(labelWidth, labels[i].Width);
|
||||
if (!ShowValues) continue;
|
||||
values[i] = CreateText(items[i].ValueText ?? Format(items[i].Value), LabelSize, text);
|
||||
values[i] = CreateLabel(items[i].ValueText ?? Format(items[i].Value), LabelSize, text);
|
||||
valueWidth = Math.Max(valueWidth, values[i]!.Width);
|
||||
}
|
||||
var gridHeight = ShowGrid ? 16 : 0;
|
||||
@@ -184,7 +187,7 @@ public sealed class BarChart : DrawingElement
|
||||
{
|
||||
var item = items[i];
|
||||
var cy = _area.Top + _pitch * (i + 0.5);
|
||||
dc.DrawText(labels[i], new Point(left - 8 - labels[i].Width, cy - labels[i].Height / 2));
|
||||
DrawTextAt(dc, labels[i], new Point(left - 8 - labels[i].Width, cy - labels[i].Height / 2));
|
||||
var length = _area.Width * Math.Clamp(item.Value / max, 0, 1);
|
||||
if (length > 0)
|
||||
{
|
||||
@@ -192,7 +195,7 @@ public sealed class BarChart : DrawingElement
|
||||
dc.DrawRoundedRectangle(GetBrush(item.BrushKey ?? BrushKey), null, new Rect(left, cy - thickness / 2, length, thickness), 2, 2);
|
||||
dc.Pop();
|
||||
}
|
||||
if (values[i] is { } value) dc.DrawText(value, new Point(left + length + 6, cy - value.Height / 2));
|
||||
if (values[i] is { } value) DrawTextAt(dc, value, new Point(left + length + 6, cy - value.Height / 2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,13 +231,13 @@ public sealed class BarChart : DrawingElement
|
||||
}
|
||||
if (ShowValues && _pitch >= 24)
|
||||
{
|
||||
var value = CreateText(item.ValueText ?? Format(item.Value), LabelSize, text);
|
||||
if (value.Width <= _pitch) dc.DrawText(value, new Point(cx - value.Width / 2, _area.Bottom - height - value.Height - 2));
|
||||
var value = CreateLabel(item.ValueText ?? Format(item.Value), LabelSize, text);
|
||||
if (value.Width <= _pitch) DrawTextAt(dc, value, new Point(cx - value.Width / 2, _area.Bottom - height - value.Height - 2));
|
||||
}
|
||||
var label = CreateText(item.Label, LabelSize, faint);
|
||||
var label = CreateLabel(item.Label, LabelSize, faint);
|
||||
var x = cx - label.Width / 2;
|
||||
if (x < lastLabelRight + 6) continue;
|
||||
dc.DrawText(label, new Point(x, _area.Bottom + 4));
|
||||
DrawTextAt(dc, label, new Point(x, _area.Bottom + 4));
|
||||
lastLabelRight = x + label.Width;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user