Files
Chronos/src/Titano.App/Sections/WelcomeView.xaml
T
Claude ffbea7cb74 feat(app): library, jobs, settings, server, welcome and about screens
Local-mode composition root (SQLite index, one JobEngine fed by a single
handler registration list), keyset-paged library with thumbnail cache and
hover scrub, live job list with throttled updates and the shell job bar,
settings with live template validation and encoder self-test, server
connection with trust-on-first-use and DPAPI token, first-run welcome,
About with update check, and --capture screenshots with synthetic data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-02 12:26:58 +00:00

116 lines
7.7 KiB
XML

<UserControl x:Class="Titano.App.Sections.WelcomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui">
<UserControl.Resources>
<!-- Welcome.html choice: 68 px card, highlighted = accent border with the AccentSelected glow. -->
<Style x:Key="RadioButton.Choice" TargetType="RadioButton">
<Setter Property="FocusVisualStyle" Value="{StaticResource Focus.Ring}" />
<Setter Property="Foreground" Value="{DynamicResource Brush.Text}" />
<Setter Property="Height" Value="68" />
<Setter Property="Margin" Value="0,0,0,10" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid>
<Border x:Name="Glow" Margin="-3" CornerRadius="11" BorderThickness="3" BorderBrush="{DynamicResource Brush.AccentSelected}" Visibility="Collapsed" />
<Border x:Name="Bd" Background="{DynamicResource Brush.Card}" BorderBrush="{DynamicResource Brush.Stroke}" BorderThickness="1"
CornerRadius="{StaticResource Radius.Card}" Padding="16,0">
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Stretch" />
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Brush.CardHover}" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Brush.Accent}" />
<Setter TargetName="Glow" Property="Visibility" Value="Visible" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="Text.ChoiceTitle" TargetType="TextBlock">
<Setter Property="FontSize" Value="14" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
</Style>
<Style x:Key="Text.ChoiceDetail" TargetType="TextBlock">
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="{DynamicResource Brush.TextMuted}" />
<Setter Property="Margin" Value="0,3,0,0" />
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
</Style>
</UserControl.Resources>
<Border Width="640" Background="{DynamicResource Brush.Surface}" BorderBrush="{DynamicResource Brush.Stroke}" BorderThickness="1"
CornerRadius="{StaticResource Radius.Dialog}" Padding="32,28" Effect="{StaticResource Shadow.Popup}">
<StackPanel>
<DockPanel LastChildFill="True">
<ComboBox DockPanel.Dock="Right" VerticalAlignment="Top" MinWidth="120" ItemsSource="{Binding Languages}" SelectedItem="{Binding SelectedLanguage}"
DisplayMemberPath="Name" ToolTip="{l:Loc Tooltips.Welcome.Language}" AutomationProperties.Name="{l:Loc Settings.General.Language}" />
<ui:BrandMarkIcon Width="56" Height="56" ShowPlate="True" />
<StackPanel Margin="16,0,16,0" VerticalAlignment="Center">
<TextBlock Text="{l:Loc Shell.Welcome.Title}" FontSize="20" FontWeight="SemiBold" TextTrimming="CharacterEllipsis" />
<TextBlock Text="{l:Loc Shell.Welcome.Question}" Foreground="{DynamicResource Brush.TextMuted}" Margin="0,4,0,0" TextTrimming="CharacterEllipsis" />
</StackPanel>
</DockPanel>
<StackPanel Margin="0,20,0,0">
<!-- Create a local archive -->
<RadioButton Style="{StaticResource RadioButton.Choice}" GroupName="Welcome" IsChecked="{Binding IsLocal}" ToolTip="{l:Loc Tooltips.Welcome.Local}"
AutomationProperties.Name="{l:Loc Shell.Welcome.Local}">
<DockPanel>
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Subtle}" Content="{l:Loc Shell.Welcome.Change}" Command="{Binding ChangeRootCommand}"
ToolTip="{l:Loc Tooltips.Welcome.Change}" Foreground="{DynamicResource Brush.TextMuted}" />
<ui:Icon Glyph="{StaticResource Icon.Folder}" Size="24" Foreground="{DynamicResource Brush.Accent}" VerticalAlignment="Center" />
<StackPanel Margin="14,0,8,0" VerticalAlignment="Center">
<TextBlock Style="{StaticResource Text.ChoiceTitle}" Text="{l:Loc Shell.Welcome.Local}" />
<TextBlock Style="{StaticResource Text.ChoiceDetail}" Text="{Binding LocalDetail}" Typography.NumeralAlignment="Tabular" />
</StackPanel>
</DockPanel>
</RadioButton>
<!-- Adopt an existing folder -->
<RadioButton Style="{StaticResource RadioButton.Choice}" GroupName="Welcome" IsChecked="{Binding IsAdopt}" ToolTip="{l:Loc Tooltips.Welcome.Adopt}"
AutomationProperties.Name="{l:Loc Shell.Welcome.Adopt}">
<DockPanel>
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Subtle}" Content="{l:Loc Shell.Welcome.Choose}" Command="{Binding ChooseAdoptCommand}"
ToolTip="{l:Loc Tooltips.Welcome.Choose}" Foreground="{DynamicResource Brush.TextMuted}" />
<ui:Icon Glyph="{StaticResource Icon.Archive}" Size="24" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" />
<StackPanel Margin="14,0,8,0" VerticalAlignment="Center">
<TextBlock Style="{StaticResource Text.ChoiceTitle}" Text="{l:Loc Shell.Welcome.Adopt}" />
<TextBlock Style="{StaticResource Text.ChoiceDetail}" Text="{Binding AdoptDetail}" Visibility="{Binding HasAdoptDetail, Converter={StaticResource BoolToVisibility}}" />
</StackPanel>
</DockPanel>
</RadioButton>
<!-- Connect to a server -->
<RadioButton Style="{StaticResource RadioButton.Choice}" GroupName="Welcome" IsChecked="{Binding IsServer}" ToolTip="{l:Loc Tooltips.Welcome.Server}"
AutomationProperties.Name="{l:Loc Shell.Welcome.Server}" Margin="0">
<DockPanel>
<ui:StatusGlyph DockPanel.Dock="Right" Kind="Online" Text="{l:Loc Shell.Welcome.Found}" VerticalAlignment="Center" ToolTip="{l:Loc Tooltips.Welcome.Found}"
Visibility="{Binding IsServerDiscovered, Converter={StaticResource BoolToVisibility}}" />
<ui:Icon Glyph="{StaticResource Icon.Server}" Size="24" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" />
<StackPanel Margin="14,0,8,0" VerticalAlignment="Center">
<TextBlock Style="{StaticResource Text.ChoiceTitle}" Text="{l:Loc Shell.Welcome.Server}" />
<TextBlock Style="{StaticResource Text.ChoiceDetail}" Text="{Binding ServerDetail}" Visibility="{Binding HasServerDetail, Converter={StaticResource BoolToVisibility}}" />
</StackPanel>
</DockPanel>
</RadioButton>
</StackPanel>
<DockPanel Margin="0,20,0,0" LastChildFill="False">
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Primary}" Height="36" Padding="22,0" Content="{l:Loc Shell.Welcome.Continue}"
Command="{Binding ContinueCommand}" ToolTip="{l:Loc Tooltips.Welcome.Continue}" IsDefault="True" />
<CheckBox Content="{l:Loc Shell.Welcome.Consent}" IsChecked="{Binding UsageCounts}" ToolTip="{l:Loc Tooltips.Settings.UsageCounts}" VerticalAlignment="Center"
Foreground="{DynamicResource Brush.TextMuted}" />
</DockPanel>
</StackPanel>
</Border>
</UserControl>