Category editor redesign, English as default language
- Category editor: icon tile per category opens an icon + color picker (no clipped mini combo boxes), placeholders explained, live preview - Header glyph removed; dialog follows the shared styles - Dialogs opened from Settings are owned by the active window (category editor could open behind the settings window) - Default language is English; German via Settings > Language Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,55 +2,66 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="{Binding [Categories]}"
|
||||
Width="780" SizeToContent="Height" MaxHeight="720"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
ResizeMode="NoResize"
|
||||
ShowInTaskbar="False"
|
||||
WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent"
|
||||
MouseLeftButtonDown="Window_MouseLeftButtonDown">
|
||||
Width="760" SizeToContent="Height" MaxHeight="760"
|
||||
WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False"
|
||||
WindowStyle="None" AllowsTransparency="True" Background="Transparent"
|
||||
FontFamily="{StaticResource UiFont}" FontSize="13" Foreground="{DynamicResource TextPrimaryBrush}"
|
||||
UseLayoutRounding="True"
|
||||
MouseLeftButtonDown="Window_MouseLeftButtonDown" KeyDown="Window_KeyDown">
|
||||
<Window.Resources>
|
||||
<SolidColorBrush x:Key="PrimaryBrush" Color="#6366F1"/>
|
||||
<SolidColorBrush x:Key="DangerBrush" Color="#EF4444"/>
|
||||
<SolidColorBrush x:Key="TextPrimaryBrush" Color="#1E293B"/>
|
||||
<SolidColorBrush x:Key="TextSecondaryBrush" Color="#64748B"/>
|
||||
<SolidColorBrush x:Key="BorderBrush" Color="#CBD5E1"/>
|
||||
<SolidColorBrush x:Key="CardBrush" Color="#FFFFFF"/>
|
||||
<SolidColorBrush x:Key="InputBackgroundBrush" Color="#F1F5F9"/>
|
||||
<SolidColorBrush x:Key="HoverBrush" Color="#E2E8F0"/>
|
||||
|
||||
<Style x:Key="Input" TargetType="TextBox">
|
||||
<Setter Property="Background" Value="{DynamicResource InputBackgroundBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
|
||||
<Setter Property="CaretBrush" Value="{DynamicResource TextPrimaryBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Padding" Value="8,5"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Height" Value="34"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TextBox">
|
||||
<Border x:Name="Bd" CornerRadius="6" BorderThickness="1" Background="{TemplateBinding Background}"
|
||||
BorderBrush="{DynamicResource BorderBrush}" Padding="9,0">
|
||||
<ScrollViewer x:Name="PART_ContentHost" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource TextTertiaryBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsKeyboardFocused" Value="True">
|
||||
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DialogButton" TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Padding" Value="18,8"/>
|
||||
<Style x:Key="ColHead" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="11.5"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextSecondaryBrush}"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Code" TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="4"/>
|
||||
<Setter Property="Padding" Value="5,0"/>
|
||||
<Setter Property="Margin" Value="0,0,5,0"/>
|
||||
<Setter Property="Background" Value="{DynamicResource HoverBrush}"/>
|
||||
</Style>
|
||||
|
||||
<!-- one glyph / color choice inside the picker popup -->
|
||||
<Style x:Key="PickButton" TargetType="Button">
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Margin" Value="2"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="8" Padding="{TemplateBinding Padding}">
|
||||
<Border x:Name="Bd" Width="32" Height="32" CornerRadius="6" Background="Transparent">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bd" Property="Opacity" Value="0.85"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="bd" Property="Opacity" Value="0.35"/>
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
@@ -59,9 +70,9 @@
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<Border CornerRadius="10" Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Margin="10">
|
||||
<Border Margin="12" CornerRadius="10" Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="20" ShadowDepth="5" Opacity="0.25" Direction="270" Color="Black"/>
|
||||
<DropShadowEffect BlurRadius="24" ShadowDepth="6" Opacity="0.28" Direction="270" Color="Black"/>
|
||||
</Border.Effect>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
@@ -71,95 +82,136 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Header -->
|
||||
<Border Background="Transparent" CornerRadius="12,12,0,0" Padding="20,14,12,6">
|
||||
<Grid>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" FontFamily="Segoe MDL2 Assets" FontSize="15" Foreground="{DynamicResource TextPrimaryBrush}" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding [Categories]}" FontSize="16" FontWeight="SemiBold" Foreground="{DynamicResource TextPrimaryBrush}" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<Button Content="" Style="{StaticResource IconButton}" FontSize="10" HorizontalAlignment="Right" Click="Cancel_Click" IsCancel="True"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!-- header -->
|
||||
<DockPanel Margin="24,18,14,0">
|
||||
<Button DockPanel.Dock="Right" Content="" Style="{StaticResource IconButton}" FontSize="10" Click="Cancel_Click" ToolTip="Esc"/>
|
||||
<TextBlock Text="{Binding [Categories]}" FontSize="18" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
</DockPanel>
|
||||
|
||||
<!-- Hint + column titles -->
|
||||
<StackPanel Grid.Row="1" Margin="18,14,18,4">
|
||||
<TextBlock Text="{Binding [CategoriesHint]}" FontSize="12" TextWrapping="Wrap" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<Grid Margin="0,12,0,0">
|
||||
<!-- explanation + column heads -->
|
||||
<StackPanel Grid.Row="1" Margin="24,6,24,0">
|
||||
<TextBlock Text="{Binding [CategoriesIntro]}" FontSize="12.5" TextWrapping="Wrap" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<WrapPanel Margin="0,8,0,0" TextElement.FontSize="12" TextElement.Foreground="{DynamicResource TextSecondaryBrush}">
|
||||
<Border Style="{StaticResource Code}"><TextBlock Text="{}{0}" FontFamily="Consolas" Foreground="{DynamicResource TextPrimaryBrush}"/></Border>
|
||||
<TextBlock Text="{Binding [CatPlaceholderYears]}" Margin="0,0,16,0" VerticalAlignment="Center"/>
|
||||
<Border Style="{StaticResource Code}"><TextBlock Text="{}{o}" FontFamily="Consolas" Foreground="{DynamicResource TextPrimaryBrush}"/></Border>
|
||||
<TextBlock Text="{Binding [CatPlaceholderOrdinal]}" VerticalAlignment="Center"/>
|
||||
</WrapPanel>
|
||||
|
||||
<Grid Margin="0,18,8,6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="56"/>
|
||||
<ColumnDefinition Width="56"/>
|
||||
<ColumnDefinition Width="52"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="170"/>
|
||||
<ColumnDefinition Width="200"/>
|
||||
<ColumnDefinition Width="190"/>
|
||||
<ColumnDefinition Width="34"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Text="{Binding [CatIcon]}" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding [Color]}" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<TextBlock Grid.Column="2" Text="{Binding [Name]}" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource TextSecondaryBrush}"/>
|
||||
<TextBlock Grid.Column="3" Text="{Binding [CatText]}" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource TextSecondaryBrush}" Margin="8,0,0,0"/>
|
||||
<TextBlock Grid.Column="4" Text="{Binding [CatExample]}" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource TextSecondaryBrush}" Margin="8,0,0,0"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding [Name]}" Style="{StaticResource ColHead}"/>
|
||||
<TextBlock Grid.Column="2" Text="{Binding [CatText]}" Style="{StaticResource ColHead}" Margin="10,0,0,0"/>
|
||||
<TextBlock Grid.Column="3" Text="{Binding [CatExample]}" Style="{StaticResource ColHead}" Margin="14,0,0,0"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Rows -->
|
||||
<ScrollViewer Grid.Row="2" VerticalScrollBarVisibility="Auto" Margin="18,0,10,0" MaxHeight="440">
|
||||
<!-- rows -->
|
||||
<ScrollViewer Grid.Row="2" VerticalScrollBarVisibility="Auto" Margin="24,0,16,0" MaxHeight="420">
|
||||
<ItemsControl x:Name="Rows" Margin="0,0,8,0">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="56"/>
|
||||
<ColumnDefinition Width="56"/>
|
||||
<ColumnDefinition Width="52"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="170"/>
|
||||
<ColumnDefinition Width="200"/>
|
||||
<ColumnDefinition Width="190"/>
|
||||
<ColumnDefinition Width="34"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ComboBox Grid.Column="0" Width="50" Height="30" HorizontalAlignment="Left"
|
||||
ItemsSource="{Binding Glyphs, RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
SelectedItem="{Binding Glyph}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" FontFamily="Segoe MDL2 Assets" FontSize="14"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<!-- icon tile: click opens icon + color picker -->
|
||||
<ToggleButton x:Name="Tile" Width="38" Height="34" HorizontalAlignment="Left" Cursor="Hand"
|
||||
AutomationProperties.Name="{Binding DataContext[CatChangeLook], RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
ToolTip="{Binding DataContext[CatChangeLook], RelativeSource={RelativeSource AncestorType=Window}}">
|
||||
<ToggleButton.Template>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Border x:Name="Bd" CornerRadius="8" BorderThickness="1" BorderBrush="Transparent"
|
||||
Background="{Binding Color, Converter={StaticResource HexToBrush}, ConverterParameter=0.16}">
|
||||
<TextBlock Text="{Binding Glyph}" FontFamily="{StaticResource IconFont}" FontSize="15"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{Binding Color, Converter={StaticResource HexToBrush}}"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Bd" Property="BorderBrush" Value="{Binding Color, Converter={StaticResource HexToBrush}, ConverterParameter=0.6}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="Bd" Property="BorderBrush" Value="{Binding Color, Converter={StaticResource HexToBrush}}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</ToggleButton.Template>
|
||||
</ToggleButton>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=Tile, Mode=TwoWay}" PlacementTarget="{Binding ElementName=Tile}" Placement="Bottom"
|
||||
StaysOpen="False" AllowsTransparency="True" PopupAnimation="Fade" VerticalOffset="4">
|
||||
<Border Background="{DynamicResource MenuBackgroundBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1"
|
||||
CornerRadius="8" Padding="10" Margin="6,0,6,10" Width="244">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="14" ShadowDepth="3" Opacity="0.22" Color="Black"/>
|
||||
</Border.Effect>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding DataContext[CatIcon], RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
FontSize="11.5" FontWeight="SemiBold" Foreground="{DynamicResource TextSecondaryBrush}" Margin="2,0,0,4"/>
|
||||
<ItemsControl ItemsSource="{Binding Glyphs, RelativeSource={RelativeSource AncestorType=Window}}">
|
||||
<ItemsControl.ItemsPanel><ItemsPanelTemplate><WrapPanel/></ItemsPanelTemplate></ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button Style="{StaticResource PickButton}" Click="PickGlyph_Click" Tag="{Binding}">
|
||||
<TextBlock Text="{Binding}" FontFamily="{StaticResource IconFont}" FontSize="15"
|
||||
Foreground="{DynamicResource TextPrimaryBrush}"/>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<TextBlock Text="{Binding DataContext[Color], RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
FontSize="11.5" FontWeight="SemiBold" Foreground="{DynamicResource TextSecondaryBrush}" Margin="2,10,0,4"/>
|
||||
<ItemsControl ItemsSource="{Binding Palette, RelativeSource={RelativeSource AncestorType=Window}}">
|
||||
<ItemsControl.ItemsPanel><ItemsPanelTemplate><WrapPanel/></ItemsPanelTemplate></ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button Style="{StaticResource PickButton}" Click="PickColor_Click" Tag="{Binding}">
|
||||
<Ellipse Width="18" Height="18" Fill="{Binding Converter={StaticResource HexToBrush}}"/>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Popup>
|
||||
|
||||
<ComboBox Grid.Column="1" Width="50" Height="30" HorizontalAlignment="Left"
|
||||
ItemsSource="{Binding Palette, RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
SelectedItem="{Binding Color}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Ellipse Width="14" Height="14" Fill="{Binding Converter={StaticResource HexToBrush}}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<TextBox Grid.Column="1" Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource Input}"/>
|
||||
<TextBox Grid.Column="2" Text="{Binding Format, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource Input}" Margin="10,0,0,0"/>
|
||||
|
||||
<TextBox Grid.Column="2" Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource Input}"/>
|
||||
<TextBox Grid.Column="3" Text="{Binding Format, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource Input}" Margin="8,0,0,0"/>
|
||||
<TextBlock Grid.Column="3" Margin="14,0,0,0" VerticalAlignment="Center" FontSize="12.5" TextTrimming="CharacterEllipsis"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}" Loaded="Example_Loaded" Tag="{Binding}"/>
|
||||
|
||||
<TextBlock Grid.Column="4" Margin="8,0,0,0" VerticalAlignment="Center" FontSize="11" TextTrimming="CharacterEllipsis"
|
||||
Foreground="{Binding Color, Converter={StaticResource HexToBrush}}"
|
||||
Loaded="Example_Loaded" Tag="{Binding}"/>
|
||||
|
||||
<Button Grid.Column="5" Content="" FontFamily="Segoe MDL2 Assets" FontSize="12" Width="28" Height="28"
|
||||
Background="Transparent" BorderThickness="0" Cursor="Hand" Foreground="{DynamicResource DangerBrush}"
|
||||
Click="Delete_Click" Tag="{Binding}" ToolTip="{Binding DataContext[Delete], RelativeSource={RelativeSource AncestorType=Window}}"/>
|
||||
<Button Grid.Column="4" Content="" Style="{StaticResource IconButton}" HorizontalAlignment="Right"
|
||||
Click="Delete_Click" Tag="{Binding}"
|
||||
ToolTip="{Binding DataContext[Delete], RelativeSource={RelativeSource AncestorType=Window}}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
|
||||
<!-- Buttons -->
|
||||
<DockPanel Grid.Row="3" Margin="18,12,18,18">
|
||||
<Button DockPanel.Dock="Left" Content="{Binding [AddCategory]}" Style="{StaticResource DialogButton}" Click="Add_Click"/>
|
||||
<!-- buttons -->
|
||||
<DockPanel Grid.Row="3" Margin="24,16,24,20">
|
||||
<Button DockPanel.Dock="Left" Style="{StaticResource SubtleButton}" Click="Add_Click">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" FontFamily="{StaticResource IconFont}" FontSize="11" VerticalAlignment="Center" Margin="0,1,8,0"/>
|
||||
<TextBlock Text="{Binding [AddCategoryShort]}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Content="{Binding [Cancel]}" Style="{StaticResource DialogButton}" Click="Cancel_Click"/>
|
||||
<Button Content="{Binding [Save]}" Style="{StaticResource DialogButton}" Click="Save_Click" IsDefault="True"
|
||||
Background="{DynamicResource PrimaryBrush}" Foreground="White" BorderThickness="0" Margin="8,0,0,0"/>
|
||||
<Button Content="{Binding [Cancel]}" Style="{StaticResource SubtleButton}" Click="Cancel_Click"/>
|
||||
<Button Content="{Binding [Save]}" Style="{StaticResource PrimaryButton}" Click="Save_Click" IsDefault="True" Margin="8,0,0,0"/>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user