ux: new style for repository sub-view switcher

This commit is contained in:
leo 2024-11-27 10:02:26 +08:00
parent 4fc32b2b59
commit cb9110baef
No known key found for this signature in database
2 changed files with 28 additions and 12 deletions

View file

@ -341,7 +341,7 @@
<x:String x:Key="Text.GitLFS.Remote" xml:space="preserve">Remote:</x:String>
<x:String x:Key="Text.GitLFS.Track" xml:space="preserve">Track files named '{0}'</x:String>
<x:String x:Key="Text.GitLFS.TrackByExtension" xml:space="preserve">Track all *{0} files</x:String>
<x:String x:Key="Text.Histories" xml:space="preserve">Histories</x:String>
<x:String x:Key="Text.Histories" xml:space="preserve">HISTORY</x:String>
<x:String x:Key="Text.Histories.DisplayMode" xml:space="preserve">Switch Horizontal/Vertical Layout</x:String>
<x:String x:Key="Text.Histories.Header.Author" xml:space="preserve">AUTHOR</x:String>
<x:String x:Key="Text.Histories.Header.AuthorTime" xml:space="preserve">AUTHOR TIME</x:String>
@ -621,7 +621,7 @@
<x:String x:Key="Text.StashCM.Pop" xml:space="preserve">Pop</x:String>
<x:String x:Key="Text.StashDropConfirm" xml:space="preserve">Drop Stash</x:String>
<x:String x:Key="Text.StashDropConfirm.Label" xml:space="preserve">Drop:</x:String>
<x:String x:Key="Text.Stashes" xml:space="preserve">Stashes</x:String>
<x:String x:Key="Text.Stashes" xml:space="preserve">STASHES</x:String>
<x:String x:Key="Text.Stashes.Changes" xml:space="preserve">CHANGES</x:String>
<x:String x:Key="Text.Stashes.Stashes" xml:space="preserve">STASHES</x:String>
<x:String x:Key="Text.Statistics" xml:space="preserve">Statistics</x:String>
@ -668,7 +668,7 @@
<x:String x:Key="Text.Welcome.ScanDefaultCloneDir" xml:space="preserve">Rescan Repositories in Default Clone Dir</x:String>
<x:String x:Key="Text.Welcome.Search" xml:space="preserve">Search Repositories...</x:String>
<x:String x:Key="Text.Welcome.Sort" xml:space="preserve">Sort</x:String>
<x:String x:Key="Text.WorkingCopy" xml:space="preserve">Changes</x:String>
<x:String x:Key="Text.WorkingCopy" xml:space="preserve">LOCAL CHANGES</x:String>
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore" xml:space="preserve">Git Ignore</x:String>
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.Extension" xml:space="preserve">Ignore all *{0} files</x:String>
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.ExtensionInSameFolder" xml:space="preserve">Ignore *{0} files in the same folder</x:String>

View file

@ -42,6 +42,16 @@
<Border CornerRadius="6" ClipToBounds="True">
<ListBox Background="Transparent" SelectedIndex="{Binding SelectedViewIndex, Mode=TwoWay}">
<ListBox.Styles>
<Style Selector="Path.icon">
<Setter Property="Width" Value="12"/>
<Setter Property="Height" Value="12"/>
<Setter Property="Margin" Value="8,0,6,0"/>
<Setter Property="Fill" Value="{DynamicResource Brush.FG2}"/>
</Style>
<Style Selector="TextBlock.header">
<Setter Property="Foreground" Value="{DynamicResource Brush.FG2}"/>
<Setter Property="FontWeight" Value="Bold"/>
</Style>
<Style Selector="ListBoxItem">
<Setter Property="Height" Value="28"/>
<Setter Property="Margin" Value="0"/>
@ -58,6 +68,12 @@
<Style Selector="ListBoxItem:selected Grid.view_mode">
<Setter Property="Background" Value="{DynamicResource Brush.AccentHovered}"/>
</Style>
<Style Selector="ListBoxItem:selected TextBlock.header">
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
</Style>
<Style Selector="ListBoxItem:selected Path.icon">
<Setter Property="Fill" Value="{DynamicResource Brush.FG1}"/>
</Style>
</ListBox.Styles>
<ListBox.ItemsPanel>
@ -67,9 +83,9 @@
</ListBox.ItemsPanel>
<ListBoxItem>
<Grid Classes="view_mode" ColumnDefinitions="32,*,Auto,Auto,Auto,Auto">
<Path Grid.Column="0" Width="12" Height="12" Data="{StaticResource Icons.Histories}"/>
<TextBlock Grid.Column="1" Classes="primary" Text="{DynamicResource Text.Histories}"/>
<Grid Classes="view_mode" ColumnDefinitions="Auto,*,Auto,Auto,Auto,Auto">
<Path Grid.Column="0" Classes="icon" Data="{StaticResource Icons.Histories}"/>
<TextBlock Grid.Column="1" Classes="header" Text="{DynamicResource Text.Histories}"/>
<ToggleButton Grid.Column="2"
Classes="layout_direction"
Width="28" Height="26"
@ -102,9 +118,9 @@
</ListBoxItem>
<ListBoxItem>
<Grid Classes="view_mode" ColumnDefinitions="32,*,Auto">
<Path Grid.Column="0" Width="12" Height="12" Data="{StaticResource Icons.Changes}"/>
<TextBlock Grid.Column="1" Classes="primary" Text="{DynamicResource Text.WorkingCopy}"/>
<Grid Classes="view_mode" ColumnDefinitions="Auto,*,Auto">
<Path Grid.Column="0" Classes="icon" Data="{StaticResource Icons.Changes}"/>
<TextBlock Grid.Column="1" Classes="header" Text="{DynamicResource Text.WorkingCopy}"/>
<v:CounterPresenter Grid.Column="2"
Margin="6,0"
VerticalAlignment="Center"
@ -117,9 +133,9 @@
</ListBoxItem>
<ListBoxItem>
<Grid Classes="view_mode" ColumnDefinitions="32,*,Auto">
<Path Grid.Column="0" Width="12" Height="12" Data="{StaticResource Icons.Stashes}"/>
<TextBlock Grid.Column="1" Classes="primary" Text="{DynamicResource Text.Stashes}"/>
<Grid Classes="view_mode" ColumnDefinitions="Auto,*,Auto">
<Path Grid.Column="0" Classes="icon" Data="{StaticResource Icons.Stashes}"/>
<TextBlock Grid.Column="1" Classes="header" Text="{DynamicResource Text.Stashes}"/>
<v:CounterPresenter Grid.Column="2"
Margin="6,0"
VerticalAlignment="Center"