junction/src/Junction.App/App.axaml
dtrentin f4abdc0039 feat: themed + iconed UI polish (v0.3.1)
Fluent light/dark theme dictionaries (accent/surface/card/border/danger),
OS-following variant, App-level text/button/card styles. Per-protocol vector
icons via ProtocolIdToIconConverter (mirrors StatusKindToBrushConverter,
view-layer, safe fallback, no external assets). Curated layout across
dashboard/detail/config: consistent spacing scale, card grouping, theme brushes,
accent/danger buttons. App-only; no VM contract change, no new NuGet, no fw bump.

Projects: Junction.App (+ Junction.Tests: +10 converter tests, 148 pass).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 07:23:47 +02:00

114 lines
5.8 KiB
XML

<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Junction.App"
xmlns:conv="clr-namespace:Junction.App.Converters"
x:Class="Junction.App.App"
RequestedThemeVariant="Default">
<!-- RequestedThemeVariant="Default" = follow the OS light/dark preference. -->
<Application.Resources>
<ResourceDictionary>
<!-- Per-variant palette. Fluent supplies the base chrome; these are Junction's
accent + surface + status tokens, adapted for Light and Dark. -->
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="AccentBrush" Color="#2563EB" />
<SolidColorBrush x:Key="AccentHoverBrush" Color="#1D4FD7" />
<SolidColorBrush x:Key="AppBackgroundBrush" Color="#F4F6F9" />
<SolidColorBrush x:Key="CardBackgroundBrush" Color="#FFFFFF" />
<SolidColorBrush x:Key="CardBorderBrush" Color="#E2E6EC" />
<SolidColorBrush x:Key="HeaderForegroundBrush" Color="#161A1F" />
<SolidColorBrush x:Key="SubtleForegroundBrush" Color="#697586" />
<SolidColorBrush x:Key="DangerBrush" Color="#C62828" />
<SolidColorBrush x:Key="OnAccentBrush" Color="#FFFFFF" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="AccentBrush" Color="#4C8DF6" />
<SolidColorBrush x:Key="AccentHoverBrush" Color="#6BA1F8" />
<SolidColorBrush x:Key="AppBackgroundBrush" Color="#1B1E23" />
<SolidColorBrush x:Key="CardBackgroundBrush" Color="#24282E" />
<SolidColorBrush x:Key="CardBorderBrush" Color="#3A3F46" />
<SolidColorBrush x:Key="HeaderForegroundBrush" Color="#F2F4F7" />
<SolidColorBrush x:Key="SubtleForegroundBrush" Color="#9AA3AF" />
<SolidColorBrush x:Key="DangerBrush" Color="#EF5350" />
<SolidColorBrush x:Key="OnAccentBrush" Color="#FFFFFF" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<!-- Spacing scale (variant-invariant). -->
<Thickness x:Key="PageMargin">20</Thickness>
<!-- Variant-invariant converters. -->
<conv:StatusKindToBrushConverter x:Key="StatusKindToBrush" />
<conv:ProtocolIdToIconConverter x:Key="ProtocolIdToIcon" />
</ResourceDictionary>
</Application.Resources>
<Application.DataTemplates>
<local:ViewLocator />
</Application.DataTemplates>
<Application.Styles>
<FluentTheme />
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml" />
<!-- Inter (bundled via WithInterFont) as the shell default for a consistent, crisp face. -->
<Style Selector="Window">
<Setter Property="FontFamily" Value="avares://Avalonia.Fonts.Inter/Assets#Inter" />
<Setter Property="Background" Value="{DynamicResource AppBackgroundBrush}" />
</Style>
<!-- Reusable text roles. -->
<Style Selector="TextBlock.h1">
<Setter Property="FontSize" Value="22" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="Foreground" Value="{DynamicResource HeaderForegroundBrush}" />
</Style>
<Style Selector="TextBlock.h2">
<Setter Property="FontSize" Value="16" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="Foreground" Value="{DynamicResource HeaderForegroundBrush}" />
</Style>
<Style Selector="TextBlock.subtle">
<Setter Property="Foreground" Value="{DynamicResource SubtleForegroundBrush}" />
</Style>
<Style Selector="TextBlock.fieldLabel">
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="Foreground" Value="{DynamicResource SubtleForegroundBrush}" />
</Style>
<!-- Card / section container. -->
<Style Selector="Border.card">
<Setter Property="Background" Value="{DynamicResource CardBackgroundBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource CardBorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="6" />
<Setter Property="Padding" Value="16" />
</Style>
<!-- Primary (accent) button. -->
<Style Selector="Button.accent">
<Setter Property="Background" Value="{DynamicResource AccentBrush}" />
<Setter Property="Foreground" Value="{DynamicResource OnAccentBrush}" />
<Setter Property="FontWeight" Value="SemiBold" />
</Style>
<Style Selector="Button.accent:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AccentHoverBrush}" />
<Setter Property="Foreground" Value="{DynamicResource OnAccentBrush}" />
</Style>
<!-- Destructive button. -->
<Style Selector="Button.danger">
<Setter Property="Background" Value="{DynamicResource DangerBrush}" />
<Setter Property="Foreground" Value="#FFFFFF" />
<Setter Property="FontWeight" Value="SemiBold" />
</Style>
<!-- Protocol glyph. -->
<Style Selector="PathIcon.protocol">
<Setter Property="Width" Value="16" />
<Setter Property="Height" Value="16" />
<Setter Property="Foreground" Value="{DynamicResource AccentBrush}" />
</Style>
</Application.Styles>
</Application>