Skip to content

Commit c5f7abc

Browse files
committed
ux: remove unnecessary borders
Signed-off-by: leo <longshuang@msn.cn>
1 parent 979b4a0 commit c5f7abc

2 files changed

Lines changed: 114 additions & 118 deletions

File tree

‎src/Views/LauncherPage.axaml‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@
3232
<ContentControl Content="{Binding Data}">
3333
<ContentControl.DataTemplates>
3434
<DataTemplate DataType="vm:Welcome">
35-
<Border Margin="4,0,4,4"
36-
CornerRadius="4"
37-
BorderThickness="1"
38-
BorderBrush="{DynamicResource Brush.Border0}"
39-
Background="{DynamicResource Brush.Window}">
40-
<v:Welcome/>
41-
</Border>
35+
<v:Welcome Margin="4,0,4,4"
36+
CornerRadius="4"
37+
BorderThickness="1"
38+
BorderBrush="{DynamicResource Brush.Border0}"
39+
Background="{DynamicResource Brush.Window}"/>
4240
</DataTemplate>
4341

4442
<DataTemplate DataType="vm:Repository">

‎src/Views/Repository.axaml‎

Lines changed: 109 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -17,122 +17,120 @@
1717
</Grid.ColumnDefinitions>
1818

1919
<!-- Page Switcher -->
20-
<Border Grid.Column="0" Width="49">
21-
<Grid RowDefinitions="Auto,*,Auto,Auto,8">
22-
<ListBox Background="Transparent" SelectedIndex="{Binding SelectedViewIndex, Mode=TwoWay}" SelectionMode="AlwaysSelected">
23-
<ListBox.Styles>
24-
<Style Selector="Path.icon">
25-
<Setter Property="Width" Value="18"/>
26-
<Setter Property="Height" Value="18"/>
27-
<Setter Property="Fill" Value="{DynamicResource Brush.FG1}"/>
28-
<Setter Property="HorizontalAlignment" Value="Center"/>
29-
<Setter Property="VerticalAlignment" Value="Center"/>
30-
</Style>
31-
<Style Selector="ListBoxItem">
32-
<Setter Property="Height" Value="42"/>
33-
<Setter Property="Margin" Value="4"/>
34-
<Setter Property="Padding" Value="0"/>
35-
<Setter Property="BorderThickness" Value="0"/>
36-
<Setter Property="CornerRadius" Value="4"/>
37-
</Style>
38-
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter">
39-
<Setter Property="Background" Value="#18888888"/>
40-
</Style>
41-
<Style Selector="ListBoxItem:selected /template/ ContentPresenter#PART_ContentPresenter">
42-
<Setter Property="Background" Value="{DynamicResource Brush.AccentHovered}"/>
43-
</Style>
44-
</ListBox.Styles>
20+
<Grid Grid.Column="0" Width="49" RowDefinitions="Auto,*,Auto,Auto,8">
21+
<ListBox Background="Transparent" SelectedIndex="{Binding SelectedViewIndex, Mode=TwoWay}" SelectionMode="AlwaysSelected">
22+
<ListBox.Styles>
23+
<Style Selector="Path.icon">
24+
<Setter Property="Width" Value="18"/>
25+
<Setter Property="Height" Value="18"/>
26+
<Setter Property="Fill" Value="{DynamicResource Brush.FG1}"/>
27+
<Setter Property="HorizontalAlignment" Value="Center"/>
28+
<Setter Property="VerticalAlignment" Value="Center"/>
29+
</Style>
30+
<Style Selector="ListBoxItem">
31+
<Setter Property="Height" Value="42"/>
32+
<Setter Property="Margin" Value="4"/>
33+
<Setter Property="Padding" Value="0"/>
34+
<Setter Property="BorderThickness" Value="0"/>
35+
<Setter Property="CornerRadius" Value="4"/>
36+
</Style>
37+
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter">
38+
<Setter Property="Background" Value="#18888888"/>
39+
</Style>
40+
<Style Selector="ListBoxItem:selected /template/ ContentPresenter#PART_ContentPresenter">
41+
<Setter Property="Background" Value="{DynamicResource Brush.AccentHovered}"/>
42+
</Style>
43+
</ListBox.Styles>
4544

46-
<ListBox.ItemsPanel>
47-
<ItemsPanelTemplate>
48-
<StackPanel Orientation="Vertical"/>
49-
</ItemsPanelTemplate>
50-
</ListBox.ItemsPanel>
45+
<ListBox.ItemsPanel>
46+
<ItemsPanelTemplate>
47+
<StackPanel Orientation="Vertical"/>
48+
</ItemsPanelTemplate>
49+
</ListBox.ItemsPanel>
5150

52-
<ListBoxItem>
53-
<ToolTip.Tip>
54-
<TextBlock>
55-
<Run Text="{DynamicResource Text.Dashboard}" Foreground="{DynamicResource Brush.FG1}"/>
56-
<Run Text=" "/>
57-
<Run Text="{OnPlatform Ctrl+1, macOS=⌘+1}" FontSize="11" Foreground="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"/>
58-
</TextBlock>
59-
</ToolTip.Tip>
60-
<Path Classes="icon" Data="{StaticResource Icons.Dashboard}"/>
61-
</ListBoxItem>
51+
<ListBoxItem>
52+
<ToolTip.Tip>
53+
<TextBlock>
54+
<Run Text="{DynamicResource Text.Dashboard}" Foreground="{DynamicResource Brush.FG1}"/>
55+
<Run Text=" "/>
56+
<Run Text="{OnPlatform Ctrl+1, macOS=⌘+1}" FontSize="11" Foreground="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"/>
57+
</TextBlock>
58+
</ToolTip.Tip>
59+
<Path Classes="icon" Data="{StaticResource Icons.Dashboard}"/>
60+
</ListBoxItem>
6261

63-
<ListBoxItem IsVisible="{Binding !IsBare}">
64-
<ToolTip.Tip>
65-
<TextBlock>
66-
<Run Text="{DynamicResource Text.WorkingCopy}" Foreground="{DynamicResource Brush.FG1}"/>
67-
<Run Text=" "/>
68-
<Run Text="{OnPlatform Ctrl+2, macOS=⌘+2}" FontSize="11" Foreground="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"/>
69-
</TextBlock>
70-
</ToolTip.Tip>
71-
<Grid>
72-
<Path Classes="icon" Data="{StaticResource Icons.Changes}"/>
73-
<Border Height="14"
74-
Margin="0,4,4,0" Padding="5,0"
75-
CornerRadius="7"
76-
HorizontalAlignment="Right" VerticalAlignment="Top"
77-
Background="Red"
78-
IsVisible="{Binding LocalChangesCount, Mode=OneWay, Converter={x:Static c:IntConverters.IsGreaterThanZero}}">
79-
<TextBlock Text="{Binding LocalChangesCount, Mode=OneWay, Converter={x:Static c:IntConverters.ToBadgeWithLimit}}"
80-
Foreground="White"
81-
FontFamily="{DynamicResource Fonts.Monospace}"
82-
FontSize="10"/>
83-
</Border>
84-
<Path Width="12" Height="12"
85-
Margin="0,0,4,4"
86-
HorizontalAlignment="Right" VerticalAlignment="Bottom"
87-
Data="{StaticResource Icons.Info}"
88-
Fill="DarkOrange"
89-
IsVisible="{Binding InProgressContext, Converter={x:Static ObjectConverters.IsNotNull}}"/>
90-
</Grid>
91-
</ListBoxItem>
62+
<ListBoxItem IsVisible="{Binding !IsBare}">
63+
<ToolTip.Tip>
64+
<TextBlock>
65+
<Run Text="{DynamicResource Text.WorkingCopy}" Foreground="{DynamicResource Brush.FG1}"/>
66+
<Run Text=" "/>
67+
<Run Text="{OnPlatform Ctrl+2, macOS=⌘+2}" FontSize="11" Foreground="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"/>
68+
</TextBlock>
69+
</ToolTip.Tip>
70+
<Grid>
71+
<Path Classes="icon" Data="{StaticResource Icons.Changes}"/>
72+
<Border Height="14"
73+
Margin="0,4,4,0" Padding="5,0"
74+
CornerRadius="7"
75+
HorizontalAlignment="Right" VerticalAlignment="Top"
76+
Background="Red"
77+
IsVisible="{Binding LocalChangesCount, Mode=OneWay, Converter={x:Static c:IntConverters.IsGreaterThanZero}}">
78+
<TextBlock Text="{Binding LocalChangesCount, Mode=OneWay, Converter={x:Static c:IntConverters.ToBadgeWithLimit}}"
79+
Foreground="White"
80+
FontFamily="{DynamicResource Fonts.Monospace}"
81+
FontSize="10"/>
82+
</Border>
83+
<Path Width="12" Height="12"
84+
Margin="0,0,4,4"
85+
HorizontalAlignment="Right" VerticalAlignment="Bottom"
86+
Data="{StaticResource Icons.Info}"
87+
Fill="DarkOrange"
88+
IsVisible="{Binding InProgressContext, Converter={x:Static ObjectConverters.IsNotNull}}"/>
89+
</Grid>
90+
</ListBoxItem>
9291

93-
<ListBoxItem IsVisible="{Binding !IsBare}">
94-
<ToolTip.Tip>
95-
<TextBlock>
96-
<Run Text="{DynamicResource Text.Stashes}" Foreground="{DynamicResource Brush.FG1}"/>
97-
<Run Text=" "/>
98-
<Run Text="{OnPlatform Ctrl+3, macOS=⌘+3}" FontSize="11" Foreground="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"/>
99-
</TextBlock>
100-
</ToolTip.Tip>
101-
<Grid>
102-
<Path Classes="icon" Data="{StaticResource Icons.Stashes}"/>
103-
<Border Height="14"
104-
Margin="0,4,4,0" Padding="5,0"
105-
CornerRadius="7"
106-
HorizontalAlignment="Right" VerticalAlignment="Top"
107-
Background="Red"
108-
IsVisible="{Binding StashesCount, Mode=OneWay, Converter={x:Static c:IntConverters.IsGreaterThanZero}}">
109-
<TextBlock Text="{Binding StashesCount, Mode=OneWay, Converter={x:Static c:IntConverters.ToBadgeWithLimit}}"
110-
Foreground="White"
111-
FontFamily="{DynamicResource Fonts.Monospace}"
112-
FontSize="10"/>
113-
</Border>
114-
</Grid>
115-
</ListBoxItem>
116-
</ListBox>
92+
<ListBoxItem IsVisible="{Binding !IsBare}">
93+
<ToolTip.Tip>
94+
<TextBlock>
95+
<Run Text="{DynamicResource Text.Stashes}" Foreground="{DynamicResource Brush.FG1}"/>
96+
<Run Text=" "/>
97+
<Run Text="{OnPlatform Ctrl+3, macOS=⌘+3}" FontSize="11" Foreground="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"/>
98+
</TextBlock>
99+
</ToolTip.Tip>
100+
<Grid>
101+
<Path Classes="icon" Data="{StaticResource Icons.Stashes}"/>
102+
<Border Height="14"
103+
Margin="0,4,4,0" Padding="5,0"
104+
CornerRadius="7"
105+
HorizontalAlignment="Right" VerticalAlignment="Top"
106+
Background="Red"
107+
IsVisible="{Binding StashesCount, Mode=OneWay, Converter={x:Static c:IntConverters.IsGreaterThanZero}}">
108+
<TextBlock Text="{Binding StashesCount, Mode=OneWay, Converter={x:Static c:IntConverters.ToBadgeWithLimit}}"
109+
Foreground="White"
110+
FontFamily="{DynamicResource Fonts.Monospace}"
111+
FontSize="10"/>
112+
</Border>
113+
</Grid>
114+
</ListBoxItem>
115+
</ListBox>
117116

118-
<Button Grid.Row="2"
119-
Classes="icon_button"
120-
Width="40" Height="40"
121-
Margin="4,0"
122-
Click="Cleanup"
123-
ToolTip.Tip="{DynamicResource Text.Repository.Clean}">
124-
<Path Width="18" Height="18" Data="{StaticResource Icons.Clean}"/>
125-
</Button>
126-
<Button Grid.Row="3"
127-
Classes="icon_button"
128-
Width="40" Height="40"
129-
Margin="4,0"
130-
Click="OnOpenConfigure"
131-
ToolTip.Tip="{DynamicResource Text.Repository.Configure}">
132-
<Path Width="18" Height="18" Data="{StaticResource Icons.Settings}"/>
133-
</Button>
134-
</Grid>
135-
</Border>
117+
<Button Grid.Row="2"
118+
Classes="icon_button"
119+
Width="40" Height="40"
120+
Margin="4,0"
121+
Click="Cleanup"
122+
ToolTip.Tip="{DynamicResource Text.Repository.Clean}">
123+
<Path Width="18" Height="18" Data="{StaticResource Icons.Clean}"/>
124+
</Button>
125+
<Button Grid.Row="3"
126+
Classes="icon_button"
127+
Width="40" Height="40"
128+
Margin="4,0"
129+
Click="OnOpenConfigure"
130+
ToolTip.Tip="{DynamicResource Text.Repository.Configure}">
131+
<Path Width="18" Height="18" Data="{StaticResource Icons.Settings}"/>
132+
</Button>
133+
</Grid>
136134

137135
<!-- Right -->
138136
<Border Grid.Column="1"

0 commit comments

Comments
 (0)