Skip to content

Commit 39949bb

Browse files
committed
ux: app style
Signed-off-by: leo <longshuang@msn.cn>
1 parent 104ed5b commit 39949bb

11 files changed

Lines changed: 275 additions & 243 deletions

src/Views/CommitChanges.axaml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,26 @@
4545
</Grid>
4646

4747
<!-- Changes -->
48-
<Border Grid.Row="1" Margin="0,4,0,0" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1" Background="{DynamicResource Brush.Contents}">
49-
<v:ChangeCollectionView ViewMode="{Binding Source={x:Static vm:Preferences.Instance}, Path=CommitChangeViewMode}"
50-
EnableCompactFolders="{Binding Source={x:Static vm:Preferences.Instance}, Path=EnableCompactFoldersInChangesTree}"
51-
Changes="{Binding VisibleChanges, Mode=OneWay}"
52-
Selection="{Binding ChangeSelection, Mode=TwoWay}"
53-
ContextRequested="OnChangeContextRequested"
54-
KeyDown="OnChangeCollectionViewKeyDown"/>
48+
<Border Grid.Row="1"
49+
Margin="0,4,0,0"
50+
BorderBrush="{DynamicResource Brush.Border2}"
51+
BorderThickness="1"
52+
CornerRadius="4,4,0,0">
53+
<Border CornerRadius="4,4,0,0"
54+
Background="{DynamicResource Brush.Contents}"
55+
ClipToBounds="True">
56+
<v:ChangeCollectionView ViewMode="{Binding Source={x:Static vm:Preferences.Instance}, Path=CommitChangeViewMode}"
57+
EnableCompactFolders="{Binding Source={x:Static vm:Preferences.Instance}, Path=EnableCompactFoldersInChangesTree}"
58+
Changes="{Binding VisibleChanges, Mode=OneWay}"
59+
Selection="{Binding ChangeSelection, Mode=TwoWay}"
60+
ContextRequested="OnChangeContextRequested"
61+
KeyDown="OnChangeCollectionViewKeyDown"/>
62+
</Border>
5563
</Border>
64+
5665

5766
<!-- Summary -->
58-
<Border Grid.Row="2" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1,0,1,1" Background="Transparent">
67+
<Border Grid.Row="2" CornerRadius="0,0,4,4" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1,0,1,1" Background="Transparent">
5968
<TextBlock Margin="4,0,0,0"
6069
Foreground="{DynamicResource Brush.FG2}"
6170
HorizontalAlignment="Left" VerticalAlignment="Center">
@@ -72,7 +81,7 @@
7281
Focusable="False"/>
7382

7483
<Grid Grid.Column="2">
75-
<Border BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
84+
<Border CornerRadius="4" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
7685
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
7786
<Path Width="64" Height="64" Data="{StaticResource Icons.Diff}" Fill="{DynamicResource Brush.FG2}"/>
7887
<TextBlock Margin="0,16,0,0"

src/Views/Compare.axaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,15 @@
176176
</Grid>
177177

178178
<!-- Changes -->
179-
<Border Grid.Row="1" Margin="0,4,0,0" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1" Background="{DynamicResource Brush.Contents}">
180-
<v:ChangeCollectionView ViewMode="{Binding Source={x:Static vm:Preferences.Instance}, Path=CommitChangeViewMode}"
181-
EnableCompactFolders="{Binding Source={x:Static vm:Preferences.Instance}, Path=EnableCompactFoldersInChangesTree}"
182-
Changes="{Binding VisibleChanges, Mode=OneWay}"
183-
Selection="{Binding ChangeSelection, Mode=TwoWay}"
184-
ContextRequested="OnChangeContextRequested"
185-
KeyDown="OnChangeCollectionViewKeyDown"/>
179+
<Border Grid.Row="1" CornerRadius="4,4,0,0" Margin="0,4,0,0" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1">
180+
<Border CornerRadius="4,4,0,0" Background="{DynamicResource Brush.Contents}" ClipToBounds="True">
181+
<v:ChangeCollectionView ViewMode="{Binding Source={x:Static vm:Preferences.Instance}, Path=CommitChangeViewMode}"
182+
EnableCompactFolders="{Binding Source={x:Static vm:Preferences.Instance}, Path=EnableCompactFoldersInChangesTree}"
183+
Changes="{Binding VisibleChanges, Mode=OneWay}"
184+
Selection="{Binding ChangeSelection, Mode=TwoWay}"
185+
ContextRequested="OnChangeContextRequested"
186+
KeyDown="OnChangeCollectionViewKeyDown"/>
187+
</Border>
186188
</Border>
187189

188190
<!-- Loading Status Icon -->
@@ -192,7 +194,7 @@
192194
IsVisible="{Binding IsLoadingChanges}"/>
193195

194196
<!-- Summary -->
195-
<Border Grid.Row="2" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1,0,1,1" Background="Transparent">
197+
<Border Grid.Row="2" CornerRadius="0,0,4,4" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1,0,1,1" Background="Transparent">
196198
<TextBlock Margin="4,0,0,0"
197199
Foreground="{DynamicResource Brush.FG2}"
198200
HorizontalAlignment="Left" VerticalAlignment="Center">
@@ -209,7 +211,7 @@
209211
Focusable="False"/>
210212

211213
<Grid Grid.Column="2">
212-
<Border BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
214+
<Border CornerRadius="4" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
213215
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
214216
<Path Width="64" Height="64" Data="{StaticResource Icons.Diff}" Fill="{DynamicResource Brush.FG2}"/>
215217
<TextBlock Margin="0,16,0,0"

src/Views/Conflict.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
1010
x:Class="SourceGit.Views.Conflict"
1111
x:DataType="vm:Conflict">
12-
<Border Background="{DynamicResource Brush.Window}" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
12+
<Border CornerRadius="4" Background="{DynamicResource Brush.Window}" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
1313
<Grid VerticalAlignment="Center">
1414
<StackPanel Orientation="Vertical" IsVisible="{Binding State, Mode=OneWay, Converter={x:Static ObjectConverters.NotEqual}, ConverterParameter={x:Static m:ConflictFileState.Resolved}}">
1515
<Path Width="64" Height="64" Data="{StaticResource Icons.Conflict}" Fill="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/>

src/Views/DiffView.axaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
xmlns:c="using:SourceGit.Converters"
99
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
1010
x:Class="SourceGit.Views.DiffView"
11-
x:DataType="vm:DiffContext">
12-
<Border BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}" Background="{DynamicResource Brush.Window}">
11+
x:DataType="vm:DiffContext"
12+
CornerRadius="4"
13+
BorderThickness="1"
14+
BorderBrush="{DynamicResource Brush.Border2}">
15+
<Border CornerRadius="4" Background="{DynamicResource Brush.Window}" ClipToBounds="True">
1316
<Grid RowDefinitions="26,*">
1417
<!-- Toolbar -->
1518
<Border Grid.Row="0" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border2}">

src/Views/LauncherPage.axaml

Lines changed: 86 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
1010
x:Class="SourceGit.Views.LauncherPage"
1111
x:DataType="vm:LauncherPage">
12-
<Grid RowDefinitions="36,*">
12+
<Grid RowDefinitions="36,*" Background="{DynamicResource Brush.ToolBar}">
1313
<!-- ToolBar -->
1414
<Border Grid.Row="0"
15-
BorderBrush="{DynamicResource Brush.Border0}"
16-
BorderThickness="0,0,0,1"
17-
Background="{DynamicResource Brush.ToolBar}"
15+
Background="Transparent"
1816
PointerPressed="OnToolBarPointerPressed">
1917
<ContentControl Content="{Binding Data}">
2018
<ContentControl.DataTemplates>
@@ -34,7 +32,13 @@
3432
<ContentControl Content="{Binding Data}">
3533
<ContentControl.DataTemplates>
3634
<DataTemplate DataType="vm:Welcome">
37-
<v: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>
3842
</DataTemplate>
3943

4044
<DataTemplate DataType="vm:Repository">
@@ -59,84 +63,88 @@
5963

6064
<Grid RowDefinitions="Auto,Auto,*" Width="560" HorizontalAlignment="Center">
6165
<!-- Popup -->
62-
<Border Grid.Row="0"
63-
Padding="6,0,6,6"
64-
Background="Transparent"
65-
Effect="drop-shadow(0 0 8 #8F000000)"
66-
IsVisible="{Binding Popup, Converter={x:Static ObjectConverters.IsNotNull}}">
67-
<Border Background="{DynamicResource Brush.Popup}"
68-
BorderThickness="1,0,1,1" BorderBrush="{DynamicResource Brush.PopupBorder}"
69-
CornerRadius="0,0,8,8">
70-
<ContentControl x:Name="PopupPanel" Content="{Binding Popup}" KeyboardNavigation.TabNavigation="Cycle">
71-
<ContentControl.DataTemplates>
72-
<DataTemplate DataType="vm:Popup">
73-
<StackPanel Orientation="Vertical">
74-
<!-- Popup Widget -->
75-
<ContentControl Margin="8,16,8,8"
76-
Content="{Binding}"
77-
IsHitTestVisible="{Binding InProgress, Converter={x:Static BoolConverters.Not}}">
78-
<ContentControl.DataTemplates>
79-
<v:PopupDataTemplates/>
80-
</ContentControl.DataTemplates>
81-
</ContentControl>
66+
<Grid Grid.Row="0" Margin="6,0,6,6">
67+
<Border Background="Transparent"
68+
Effect="drop-shadow(0 0 8 #8F000000)"
69+
IsVisible="{Binding Popup, Converter={x:Static ObjectConverters.IsNotNull}}">
70+
<Border Background="{DynamicResource Brush.Popup}"
71+
BorderThickness="1,0,1,1" BorderBrush="{DynamicResource Brush.PopupBorder}"
72+
CornerRadius="0,0,8,8">
73+
<ContentControl x:Name="PopupPanel" Content="{Binding Popup}" KeyboardNavigation.TabNavigation="Cycle">
74+
<ContentControl.DataTemplates>
75+
<DataTemplate DataType="vm:Popup">
76+
<StackPanel Orientation="Vertical">
77+
<!-- Popup Widget -->
78+
<ContentControl Margin="8,16,8,8"
79+
Content="{Binding}"
80+
IsHitTestVisible="{Binding InProgress, Converter={x:Static BoolConverters.Not}}">
81+
<ContentControl.DataTemplates>
82+
<v:PopupDataTemplates/>
83+
</ContentControl.DataTemplates>
84+
</ContentControl>
8285

83-
<!-- Options -->
84-
<StackPanel Margin="8,4,8,8"
85-
Height="32"
86-
Orientation="Horizontal"
87-
HorizontalAlignment="Right"
88-
IsVisible="{Binding InProgress, Converter={x:Static BoolConverters.Not}}">
89-
<Button Width="0" Height="0"
90-
Click="OnPopupSureByHotKey"
91-
HotKey="Enter"
92-
Focusable="False"/>
93-
<Button Classes="flat primary"
94-
Width="100" Height="28"
95-
Padding="0"
96-
HorizontalContentAlignment="Center"
97-
VerticalContentAlignment="Center"
98-
Content="{DynamicResource Text.Sure}"
99-
Click="OnPopupSure"
100-
ToolTip.Tip="Enter"/>
101-
<Button Classes="flat"
102-
Width="100" Height="28"
103-
Margin="8,0,0,0"
104-
Padding="0"
105-
HorizontalContentAlignment="Center"
106-
VerticalContentAlignment="Center"
107-
Content="{DynamicResource Text.Cancel}"
108-
Click="OnPopupCancel"
109-
ToolTip.Tip="ESC"/>
110-
</StackPanel>
86+
<!-- Options -->
87+
<StackPanel Margin="8,4,8,8"
88+
Height="32"
89+
Orientation="Horizontal"
90+
HorizontalAlignment="Right"
91+
IsVisible="{Binding InProgress, Converter={x:Static BoolConverters.Not}}">
92+
<Button Width="0" Height="0"
93+
Click="OnPopupSureByHotKey"
94+
HotKey="Enter"
95+
Focusable="False"/>
96+
<Button Classes="flat primary"
97+
Width="100" Height="28"
98+
Padding="0"
99+
HorizontalContentAlignment="Center"
100+
VerticalContentAlignment="Center"
101+
Content="{DynamicResource Text.Sure}"
102+
Click="OnPopupSure"
103+
ToolTip.Tip="Enter"/>
104+
<Button Classes="flat"
105+
Width="100" Height="28"
106+
Margin="8,0,0,0"
107+
Padding="0"
108+
HorizontalContentAlignment="Center"
109+
VerticalContentAlignment="Center"
110+
Content="{DynamicResource Text.Cancel}"
111+
Click="OnPopupCancel"
112+
ToolTip.Tip="ESC"/>
113+
</StackPanel>
111114

112-
<!-- Running -->
113-
<v:PopupRunningStatus Margin="12,8"
114-
Focusable="False"
115-
Description="{Binding ProgressDescription}"
116-
IsVisible="{Binding InProgress}"
117-
IsHitTestVisible="False"/>
115+
<!-- Running -->
116+
<v:PopupRunningStatus Margin="12,8"
117+
Focusable="False"
118+
Description="{Binding ProgressDescription}"
119+
IsVisible="{Binding InProgress}"
120+
IsHitTestVisible="False"/>
118121

119-
<!-- Terminate -->
120-
<Button Classes="flat"
121-
Height="28"
122-
Margin="0,0,0,8" Padding="16,0"
123-
HorizontalAlignment="Center"
124-
Content="{DynamicResource Text.Terminate}"
125-
Click="OnPopupTerminate">
126-
<Button.IsVisible>
127-
<MultiBinding Converter="{x:Static BoolConverters.And}">
128-
<Binding Path="InProgress" Mode="OneWay"/>
129-
<Binding Path="CanTerminate" Mode="OneWay"/>
130-
</MultiBinding>
131-
</Button.IsVisible>
132-
</Button>
133-
</StackPanel>
134-
</DataTemplate>
135-
</ContentControl.DataTemplates>
136-
</ContentControl>
122+
<!-- Terminate -->
123+
<Button Classes="flat"
124+
Height="28"
125+
Margin="0,0,0,8" Padding="16,0"
126+
HorizontalAlignment="Center"
127+
Content="{DynamicResource Text.Terminate}"
128+
Click="OnPopupTerminate">
129+
<Button.IsVisible>
130+
<MultiBinding Converter="{x:Static BoolConverters.And}">
131+
<Binding Path="InProgress" Mode="OneWay"/>
132+
<Binding Path="CanTerminate" Mode="OneWay"/>
133+
</MultiBinding>
134+
</Button.IsVisible>
135+
</Button>
136+
</StackPanel>
137+
</DataTemplate>
138+
</ContentControl.DataTemplates>
139+
</ContentControl>
140+
</Border>
137141
</Border>
138-
</Border>
139142

143+
<Rectangle Height="1"
144+
HorizontalAlignment="Stretch" VerticalAlignment="Top"
145+
Fill="{DynamicResource Brush.Border0}"/>
146+
</Grid>
147+
140148
<!-- Notifications Clear Button -->
141149
<Button Grid.Row="1"
142150
Classes="flat primary"

0 commit comments

Comments
 (0)