|
8 | 8 | Title="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[App.Title]}" |
9 | 9 | Width="960" Height="640" MinWidth="780" MinHeight="540" |
10 | 10 | WindowStartupLocation="CenterScreen"> |
| 11 | + |
| 12 | + <Window.Resources> |
| 13 | + <!-- Sun icon (for dark mode → switch to light) --> |
| 14 | + <PathGeometry x:Key="SunIcon"> |
| 15 | + M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41M12 6a6 6 0 100 12 6 6 0 000-12z |
| 16 | + </PathGeometry> |
| 17 | + |
| 18 | + <!-- Moon icon (for light mode → switch to dark) --> |
| 19 | + <PathGeometry x:Key="MoonIcon"> |
| 20 | + M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z |
| 21 | + </PathGeometry> |
| 22 | + |
| 23 | + <!-- Globe icon --> |
| 24 | + <PathGeometry x:Key="GlobeIcon"> |
| 25 | + M12 2a10 10 0 100 20 10 10 0 000-20zm-2 18.41A8.04 8.04 0 015.05 13H7.1a16.1 16.1 0 002.9 7.41zM12 20a14.2 14.2 0 01-2.7-7h5.4A14.2 14.2 0 0112 20zm-4.9-9A8.04 8.04 0 0110 3.59 8.04 8.04 0 015.05 11H7.1zm9.8 0h2.05a8.04 8.04 0 00-4.95-7.41A16.1 16.1 0 0116.9 11zm2.05 2h-2.05a16.1 16.1 0 01-2.9 7.41A8.04 8.04 0 0018.95 13zm-11.85 0a8.04 8.04 0 004.95 7.41A16.1 16.1 0 017.1 13z |
| 26 | + </PathGeometry> |
| 27 | + |
| 28 | + <!-- Theme toggle button template --> |
| 29 | + <ControlTemplate x:Key="IconButton"> |
| 30 | + <Border Background="Transparent" CornerRadius="4"> |
| 31 | + <Panel Width="36" Height="36"> |
| 32 | + <ContentPresenter Content="{TemplateBinding Content}" |
| 33 | + HorizontalAlignment="Center" VerticalAlignment="Center"/> |
| 34 | + </Panel> |
| 35 | + </Border> |
| 36 | + </ControlTemplate> |
| 37 | + </Window.Resources> |
| 38 | + |
11 | 39 | <DockPanel> |
12 | 40 | <!-- Left Sidebar --> |
13 | 41 | <Border DockPanel.Dock="Left" Width="200" Background="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}"> |
|
38 | 66 |
|
39 | 67 | <!-- Bottom controls: theme + locale --> |
40 | 68 | <StackPanel Grid.Row="2" Orientation="Horizontal" |
41 | | - HorizontalAlignment="Center" Spacing="4" Margin="8,12"> |
42 | | - <Button Content="{Binding ThemeButtonText}" |
43 | | - Command="{Binding ToggleThemeCommand}" |
| 69 | + HorizontalAlignment="Center" Spacing="0" Margin="4,8"> |
| 70 | + <!-- Theme toggle --> |
| 71 | + <Button Command="{Binding ToggleThemeCommand}" |
44 | 72 | Background="Transparent" BorderThickness="0" |
45 | | - FontSize="16" Width="40" Height="36" |
46 | | - ToolTip.Tip="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Theme.Toggle]}"/> |
47 | | - <Button Content="{Binding LocaleText}" |
48 | | - Command="{Binding ToggleLocaleCommand}" |
| 73 | + Width="44" Height="36" |
| 74 | + ToolTip.Tip="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Theme.Toggle]}"> |
| 75 | + <Panel> |
| 76 | + <Path Data="{StaticResource MoonIcon}" Stretch="Uniform" |
| 77 | + Width="18" Height="18" |
| 78 | + Fill="{DynamicResource SystemControlForegroundBaseHighBrush}" |
| 79 | + IsVisible="{Binding !IsDarkTheme}"/> |
| 80 | + <Path Data="{StaticResource SunIcon}" Stretch="Uniform" |
| 81 | + Width="18" Height="18" |
| 82 | + Fill="{DynamicResource SystemControlForegroundBaseHighBrush}" |
| 83 | + IsVisible="{Binding IsDarkTheme}"/> |
| 84 | + </Panel> |
| 85 | + </Button> |
| 86 | + |
| 87 | + <!-- Locale toggle --> |
| 88 | + <Button Command="{Binding ToggleLocaleCommand}" |
49 | 89 | Background="Transparent" BorderThickness="0" |
50 | | - FontSize="14" Width="40" Height="36"/> |
| 90 | + Width="44" Height="36" |
| 91 | + ToolTip.Tip="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[Theme.Toggle]}"> |
| 92 | + <Grid> |
| 93 | + <Path Data="{StaticResource GlobeIcon}" Stretch="Uniform" |
| 94 | + Width="16" Height="16" |
| 95 | + Fill="{DynamicResource SystemControlForegroundBaseHighBrush}" |
| 96 | + Margin="0,0,0,0"/> |
| 97 | + <TextBlock Text="{Binding LocaleText}" FontSize="9" FontWeight="Bold" |
| 98 | + HorizontalAlignment="Center" VerticalAlignment="Center" |
| 99 | + Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}"/> |
| 100 | + </Grid> |
| 101 | + </Button> |
51 | 102 | </StackPanel> |
52 | 103 | </Grid> |
53 | 104 | </Border> |
|
0 commit comments