Skip to content

Commit 01f55f7

Browse files
committed
ux: new style for page switcher in repository
Signed-off-by: leo <longshuang@msn.cn>
1 parent 1b6f636 commit 01f55f7

1 file changed

Lines changed: 26 additions & 20 deletions

File tree

src/Views/Repository.axaml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<Style Selector="Path.icon">
5959
<Setter Property="Width" Value="12"/>
6060
<Setter Property="Height" Value="12"/>
61-
<Setter Property="Margin" Value="8,0,6,0"/>
61+
<Setter Property="Margin" Value="6,0"/>
6262
<Setter Property="Fill" Value="{DynamicResource Brush.FG2}"/>
6363
</Style>
6464
<Style Selector="TextBlock.header">
@@ -70,13 +70,16 @@
7070
<Setter Property="Margin" Value="0"/>
7171
<Setter Property="Padding" Value="0"/>
7272
<Setter Property="BorderThickness" Value="0"/>
73-
<Setter Property="CornerRadius" Value="4"/>
73+
<Setter Property="CornerRadius" Value="0"/>
7474
</Style>
75-
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter">
75+
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter, ListBoxItem:selected /template/ ContentPresenter#PART_ContentPresenter">
7676
<Setter Property="Background" Value="Transparent"/>
7777
</Style>
78-
<Style Selector="ListBoxItem:selected /template/ ContentPresenter#PART_ContentPresenter">
79-
<Setter Property="Background" Value="{DynamicResource Brush.AccentHovered}"/>
78+
<Style Selector="ListBoxItem:selected">
79+
<Setter Property="BorderBrush" Value="{DynamicResource Brush.FG1}"/>
80+
</Style>
81+
<Style Selector="ListBoxItem:selected Rectangle.indicator">
82+
<Setter Property="Fill" Value="{DynamicResource Brush.FG1}"/>
8083
</Style>
8184
<Style Selector="ListBoxItem:selected TextBlock.header">
8285
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
@@ -93,10 +96,11 @@
9396
</ListBox.ItemsPanel>
9497

9598
<ListBoxItem>
96-
<Grid ColumnDefinitions="Auto,*,Auto">
97-
<Path Grid.Column="0" Classes="icon" Data="{StaticResource Icons.Histories}"/>
98-
<TextBlock Grid.Column="1" Classes="header" Text="{DynamicResource Text.Histories}"/>
99-
<Button Grid.Column="2"
99+
<Grid ColumnDefinitions="4,Auto,*,Auto">
100+
<Rectangle Grid.Column="0" Classes="indicator" Width="4" Height="20" VerticalAlignment="Center"/>
101+
<Path Grid.Column="1" Classes="icon" Data="{StaticResource Icons.Histories}"/>
102+
<TextBlock Grid.Column="2" Classes="header" Text="{DynamicResource Text.Histories}"/>
103+
<Button Grid.Column="3"
100104
Classes="icon_button"
101105
Width="26" Height="26"
102106
Click="OnOpenAdvancedHistoriesOption"
@@ -107,10 +111,11 @@
107111
</ListBoxItem>
108112

109113
<ListBoxItem IsVisible="{Binding !IsBare}">
110-
<Grid ColumnDefinitions="Auto,*,Auto,Auto,Auto">
111-
<Path Grid.Column="0" Classes="icon" Data="{StaticResource Icons.Changes}"/>
112-
<TextBlock Grid.Column="1" Classes="header" Text="{DynamicResource Text.WorkingCopy}"/>
113-
<Border Grid.Column="2"
114+
<Grid ColumnDefinitions="4,Auto,*,Auto,Auto,Auto">
115+
<Rectangle Grid.Column="0" Classes="indicator" Width="4" Height="20" VerticalAlignment="Center"/>
116+
<Path Grid.Column="1" Classes="icon" Data="{StaticResource Icons.Changes}"/>
117+
<TextBlock Grid.Column="2" Classes="header" Text="{DynamicResource Text.WorkingCopy}"/>
118+
<Border Grid.Column="3"
114119
Height="18"
115120
Margin="6,0" Padding="9,0"
116121
CornerRadius="9"
@@ -122,13 +127,13 @@
122127
FontFamily="{DynamicResource Fonts.Monospace}"
123128
FontSize="10"/>
124129
</Border>
125-
<Path Grid.Column="3"
130+
<Path Grid.Column="4"
126131
Width="12" Height="12"
127132
Margin="0,0,6,0"
128133
Data="{StaticResource Icons.Info}"
129134
Fill="DarkOrange"
130135
IsVisible="{Binding InProgressContext, Converter={x:Static ObjectConverters.IsNotNull}}"/>
131-
<Button Grid.Column="4"
136+
<Button Grid.Column="5"
132137
Classes="icon_button"
133138
Width="26" Height="26"
134139
Command="{Binding DiscardAllChanges}"
@@ -139,10 +144,11 @@
139144
</ListBoxItem>
140145

141146
<ListBoxItem IsVisible="{Binding !IsBare}">
142-
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
143-
<Path Grid.Column="0" Classes="icon" Data="{StaticResource Icons.Stashes}"/>
144-
<TextBlock Grid.Column="1" Classes="header" Text="{DynamicResource Text.Stashes}"/>
145-
<Border Grid.Column="2"
147+
<Grid ColumnDefinitions="4,Auto,*,Auto,Auto">
148+
<Rectangle Grid.Column="0" Classes="indicator" Width="4" Height="20" VerticalAlignment="Center"/>
149+
<Path Grid.Column="1" Classes="icon" Data="{StaticResource Icons.Stashes}"/>
150+
<TextBlock Grid.Column="2" Classes="header" Text="{DynamicResource Text.Stashes}"/>
151+
<Border Grid.Column="3"
146152
Height="18"
147153
Margin="6,0" Padding="9,0"
148154
CornerRadius="9"
@@ -154,7 +160,7 @@
154160
FontFamily="{DynamicResource Fonts.Monospace}"
155161
FontSize="10"/>
156162
</Border>
157-
<Button Grid.Column="3"
163+
<Button Grid.Column="4"
158164
Classes="icon_button"
159165
Width="26" Height="26"
160166
Command="{Binding ClearStashes}"

0 commit comments

Comments
 (0)