Skip to content

Commit e29a780

Browse files
committed
refactor: repository sidebar
- In `DASHBOARD` page, repository sidebar shows unless we are searching commits - Add a toggle button to hide/show sidebar in `LOCAL CHANGES` page - Always hide sidebar in `STASHES` page Signed-off-by: leo <longshuang@msn.cn>
1 parent 0e0ee6d commit e29a780

10 files changed

Lines changed: 141 additions & 24 deletions

File tree

‎src/Converters/IntConverters.cs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ public static class IntConverters
1414
public static readonly FuncValueConverter<int, bool> IsZero =
1515
new(v => v == 0);
1616

17+
public static readonly FuncValueConverter<int, bool> IsOne =
18+
new(v => v == 1);
19+
1720
public static readonly FuncValueConverter<int, bool> IsNotOne =
1821
new(v => v != 1);
1922

‎src/Resources/Icons.axaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@
127127
<StreamGeometry x:Key="Icons.Search">M702 677 590 565a148 148 0 10-25 27L676 703zm-346-200a115 115 0 11115 115A115 115 0 01355 478z</StreamGeometry>
128128
<StreamGeometry x:Key="Icons.Settings">M928 500a21 21 0 00-19-20L858 472a11 11 0 01-9-9c-1-6-2-13-3-19a11 11 0 015-12l46-25a21 21 0 0010-26l-8-22a21 21 0 00-24-13l-51 10a11 11 0 01-12-6c-3-6-6-11-10-17a11 11 0 011-13l34-39a21 21 0 001-28l-15-18a20 20 0 00-27-4l-45 27a11 11 0 01-13-1c-5-4-10-9-15-12a11 11 0 01-3-12l19-49a21 21 0 00-9-26l-20-12a21 21 0 00-27 6L650 193a9 9 0 01-11 3c-1-1-12-5-20-7a11 11 0 01-7-10l1-52a21 21 0 00-17-22l-23-4a21 21 0 00-24 14L532 164a11 11 0 01-11 7h-20a11 11 0 01-11-7l-17-49a21 21 0 00-24-15l-23 4a21 21 0 00-17 22l1 52a11 11 0 01-8 11c-5 2-15 6-19 7c-4 1-8 0-12-4l-33-40A21 21 0 00313 146l-20 12A21 21 0 00285 184l19 49a11 11 0 01-3 12c-5 4-10 8-15 12a11 11 0 01-13 1L228 231a21 21 0 00-27 4L186 253a21 21 0 001 28L221 320a11 11 0 011 13c-3 5-7 11-10 17a11 11 0 01-12 6l-51-10a21 21 0 00-24 13l-8 22a21 21 0 0010 26l46 25a11 11 0 015 12l0 3c-1 6-2 11-3 16a11 11 0 01-9 9l-51 8A21 21 0 0096 500v23A21 21 0 00114 544l51 8a11 11 0 019 9c1 6 2 13 3 19a11 11 0 01-5 12l-46 25a21 21 0 00-10 26l8 22a21 21 0 0024 13l51-10a11 11 0 0112 6c3 6 6 11 10 17a11 11 0 01-1 13l-34 39a21 21 0 00-1 28l15 18a20 20 0 0027 4l45-27a11 11 0 0113 1c5 4 10 9 15 12a11 11 0 013 12l-19 49a21 21 0 009 26l20 12a21 21 0 0027-6L374 832c3-3 7-5 10-4c7 3 12 5 20 7a11 11 0 018 10l-1 52a21 21 0 0017 22l23 4a21 21 0 0024-14l17-50a11 11 0 0111-7h20a11 11 0 0111 7l17 49a21 21 0 0020 15a19 19 0 004 0l23-4a21 21 0 0017-22l-1-52a11 11 0 018-10c8-3 13-5 18-7l1 0c6-2 9 0 11 3l34 41A21 21 0 00710 878l20-12a21 21 0 009-26l-18-49a11 11 0 013-12c5-4 10-8 15-12a11 11 0 0113-1l45 27a21 21 0 0027-4l15-18a21 21 0 00-1-28l-34-39a11 11 0 01-1-13c3-5 7-11 10-17a11 11 0 0112-6l51 10a21 21 0 0024-13l8-22a21 21 0 00-10-26l-46-25a11 11 0 01-5-12l0-3c1-6 2-11 3-16a11 11 0 019-9l51-8a21 21 0 0018-21v-23zm-565 188a32 32 0 01-51 5a270 270 0 011-363a32 32 0 0151 6l91 161a32 32 0 010 31zM512 782a270 270 0 01-57-6a32 32 0 01-20-47l92-160a32 32 0 0127-16h184a32 32 0 0130 41c-35 109-137 188-257 188zm15-328L436 294a32 32 0 0121-47a268 268 0 0155-6c120 0 222 79 257 188a32 32 0 01-30 41h-184a32 32 0 01-28-16z</StreamGeometry>
129129
<StreamGeometry x:Key="Icons.Settings2">M360 623c-32 0-62 11-89 32s-46 48-54 79H94c-8 3-15 7-20 14s-9 15-10 26c-1 11 2 19 10 26s17 10 28 10h115c8 32 26 58 54 79 28 21 58 32 91 32s64-11 91-32c28-21 46-48 54-79h421c8-3 15-7 22-14 7-7 10-15 10-24s-4-18-12-26c-8-8-17-12-28-12H507c-8-32-26-58-54-79s-58-32-89-32h-4zm0 75c21 0 39 7 54 22 15 15 22 32 22 52s-7 37-22 52c-15 15-32 22-52 22-20 0-37-7-52-22s-22-32-22-52 7-37 22-52 32-22 54-22h-4zM662 103c-34 0-66 11-93 32-28 21-46 48-54 79H94c-8 3-15 7-20 14s-8 15-8 24 3 18 10 26c7 8 15 12 26 12h413c8 32 26 58 54 79 28 21 58 32 91 32 33 0 64-11 91-32s46-48 54-79h123c8-3 15-7 22-14s10-15 10-26-4-19-12-26-17-10-28-10H805c-8-32-26-58-54-79s-58-32-89-32zm-4 75c21 0 39 7 54 22 15 15 22 32 22 52s-7 37-22 52c-15 15-32 22-52 22-20 0-37-7-52-22s-22-32-22-52 7-37 22-52 32-22 54-22h-4z</StreamGeometry>
130+
<StreamGeometry x:Key="Icons.Sidebar.Collapsed">M864 277a117 117 0 00-117-117h-469A117 117 0 00160 277v469a117 117 0 00117 117h469a117 117 0 00117-117v-469zm64 469a181 181 0 01-181 181h-469a181 181 0 01-181-181v-469A181 181 0 01277 96h469a181 181 0 01181 181v469zM256 320a64 64 0 11128 0v384a64 64 0 01-128 0v-384z</StreamGeometry>
131+
<StreamGeometry x:Key="Icons.Sidebar.Expanded">M858 213a47 47 0 00-47-47H422v691h388a47 47 0 0047-47V213zm77 597a124 124 0 01-124 124H213A124 124 0 0190 811V213c0-68 55-124 124-124h597c68 0 124 55 124 124v597z</StreamGeometry>
130132
<StreamGeometry x:Key="Icons.Skip">M622 718v137q0 9-7 16t-16 7H462q-9 0-16-7t-7-16v-137q0-9 7-16t16-7h137q9 0 16 7t7 16zm181-343q0 31-9 58t-20 44-31 34-33 25-35 20q-23 13-39 37t-16 38q0 10-7 19t-16 9H459q-9 0-15-11T439 626v-26q0-47 37-89T558 449q34-15 48-32t14-43q0-24-27-42T532 313q-37 0-62 17-20 14-61 66-7 9-18 9-7 0-14-5L283 329q-7-6-9-14t3-16q91-152 265-152 46 0 92 18t83 47 61 73 23 91z</StreamGeometry>
131133
<StreamGeometry x:Key="Icons.SoftwareUpdate">M900 287c40 69 60 144 60 225s-20 156-60 225c-40 69-94 123-163 163-69 40-144 60-225 60s-156-20-225-60c-69-40-123-94-163-163C84 668 64 593 64 512s20-156 60-225 94-123 163-163c69-40 144-60 225-60s156 20 225 60 123 94 163 163zM762 512c0-9-3-16-9-22L578 315l-44-44c-6-6-13-9-22-9s-16 3-22 9l-44 44-176 176c-6 6-9 13-9 22s3 16 9 22l44 44c6 6 13 9 22 9s16-3 22-9l92-92v269c0 9 3 16 9 22 6 6 13 9 22 9h62c8 0 16-3 22-9 6-6 9-13 9-22V486l92 92c6 6 13 9 22 9 8 0 16-3 22-9l44-44c6-6 9-13 9-22z</StreamGeometry>
132134
<StreamGeometry x:Key="Icons.SquashIntoParent">M512 939C465 939 427 900 427 853 427 806 465 768 512 768 559 768 597 806 597 853 597 900 559 939 512 939M555 85 555 555 747 363 807 423 512 719 217 423 277 363 469 555 469 85 555 85Z</StreamGeometry>

‎src/Resources/Locales/en_US.axaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,7 @@
10291029
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">You can stage this file now.</x:String>
10301030
<x:String x:Key="Text.WorkingCopy.ClearCommitHistories" xml:space="preserve">Clear History</x:String>
10311031
<x:String x:Key="Text.WorkingCopy.ClearCommitHistories.Confirm" xml:space="preserve">Are you sure you want to clear all commit message history? This action cannot be undone.</x:String>
1032+
<x:String x:Key="Text.WorkingCopy.CollapseSidebar" xml:space="preserve">Hide Sidebar</x:String>
10321033
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">COMMIT</x:String>
10331034
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">COMMIT &amp; PUSH</x:String>
10341035
<x:String x:Key="Text.WorkingCopy.CommitMessageHelper" xml:space="preserve">Template/History</x:String>
@@ -1045,6 +1046,7 @@
10451046
<x:String x:Key="Text.WorkingCopy.Conflicts.UseMine" xml:space="preserve">USE MINE</x:String>
10461047
<x:String x:Key="Text.WorkingCopy.Conflicts.UseTheirs" xml:space="preserve">USE THEIRS</x:String>
10471048
<x:String x:Key="Text.WorkingCopy.DiscardAll" xml:space="preserve">DISCARD ALL</x:String>
1049+
<x:String x:Key="Text.WorkingCopy.ExpandSidebar" xml:space="preserve">Show Sidebar</x:String>
10481050
<x:String x:Key="Text.WorkingCopy.FilterChanges" xml:space="preserve">Filter Changes...</x:String>
10491051
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">INCLUDE UNTRACKED FILES</x:String>
10501052
<x:String x:Key="Text.WorkingCopy.NoCommitHistories" xml:space="preserve">NO RECENT INPUT MESSAGES</x:String>

‎src/Resources/Locales/zh_CN.axaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,7 @@
10331033
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">现在您已可将其加入暂存区中</x:String>
10341034
<x:String x:Key="Text.WorkingCopy.ClearCommitHistories" xml:space="preserve">清空历史提交信息</x:String>
10351035
<x:String x:Key="Text.WorkingCopy.ClearCommitHistories.Confirm" xml:space="preserve">您确定要清空所有的历史提交信息记录吗(执行操作后无法撤回)?</x:String>
1036+
<x:String x:Key="Text.WorkingCopy.CollapseSidebar" xml:space="preserve">隐藏左侧栏</x:String>
10361037
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">提交</x:String>
10371038
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">提交并推送</x:String>
10381039
<x:String x:Key="Text.WorkingCopy.CommitMessageHelper" xml:space="preserve">历史输入/模板</x:String>
@@ -1049,6 +1050,7 @@
10491050
<x:String x:Key="Text.WorkingCopy.Conflicts.UseMine" xml:space="preserve">使用 MINE</x:String>
10501051
<x:String x:Key="Text.WorkingCopy.Conflicts.UseTheirs" xml:space="preserve">使用 THEIRS</x:String>
10511052
<x:String x:Key="Text.WorkingCopy.DiscardAll" xml:space="preserve">放弃所有更改</x:String>
1053+
<x:String x:Key="Text.WorkingCopy.ExpandSidebar" xml:space="preserve">显示左侧栏</x:String>
10521054
<x:String x:Key="Text.WorkingCopy.FilterChanges" xml:space="preserve">查找变更...</x:String>
10531055
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">显示未跟踪文件</x:String>
10541056
<x:String x:Key="Text.WorkingCopy.NoCommitHistories" xml:space="preserve">没有提交信息记录</x:String>

‎src/Resources/Styles.axaml‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,6 +1362,40 @@
13621362
<Setter Property="Opacity" Value="1"/>
13631363
</Style>
13641364

1365+
<Style Selector="ToggleButton.sidebar_expander">
1366+
<Setter Property="Background" Value="Transparent"/>
1367+
<Setter Property="ToolTip.Tip" Value="{DynamicResource Text.WorkingCopy.CollapseSidebar}"/>
1368+
<Setter Property="Template">
1369+
<ControlTemplate>
1370+
<Border Background="Transparent"
1371+
Width="{TemplateBinding Width}"
1372+
Height="{TemplateBinding Height}"
1373+
HorizontalAlignment="Left"
1374+
VerticalAlignment="Center">
1375+
<Path x:Name="ChevronPath"
1376+
Width="16" Height="16"
1377+
Data="{StaticResource Icons.Sidebar.Expanded}"
1378+
Fill="{DynamicResource Brush.FG1}"
1379+
HorizontalAlignment="Center"
1380+
VerticalAlignment="Center"/>
1381+
</Border>
1382+
</ControlTemplate>
1383+
</Setter>
1384+
1385+
<Style Selector="^:checked">
1386+
<Setter Property="ToolTip.Tip" Value="{DynamicResource Text.WorkingCopy.ExpandSidebar}"/>
1387+
</Style>
1388+
<Style Selector="^:checked /template/ Path#ChevronPath">
1389+
<Setter Property="Data" Value="{StaticResource Icons.Sidebar.Collapsed}" />
1390+
</Style>
1391+
<Style Selector="^ Path">
1392+
<Setter Property="Opacity" Value="0.8"/>
1393+
</Style>
1394+
<Style Selector="^:pointerover Path">
1395+
<Setter Property="Opacity" Value="1"/>
1396+
</Style>
1397+
</Style>
1398+
13651399
<Style Selector="Slider">
13661400
<Style.Resources>
13671401
<Thickness x:Key="SliderTopHeaderMargin">0,0,0,4</Thickness>

‎src/ViewModels/LayoutInfo.cs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ public double RepositorySearchCommitWidth
4747
set;
4848
} = 250;
4949

50+
public bool IsSidebarCollapsedInLocalChanges
51+
{
52+
get => _isSidebarCollapsedInLocalChanges;
53+
set => SetProperty(ref _isSidebarCollapsedInLocalChanges, value);
54+
}
55+
5056
public GridLength WorkingCopyLeftWidth
5157
{
5258
get => _workingCopyLeftWidth;
@@ -75,5 +81,6 @@ public GridLength CommitDetailFilesLeftWidth
7581
private GridLength _stashesLeftWidth = new GridLength(300, GridUnitType.Pixel);
7682
private GridLength _commitDetailChangesLeftWidth = new GridLength(256, GridUnitType.Pixel);
7783
private GridLength _commitDetailFilesLeftWidth = new GridLength(256, GridUnitType.Pixel);
84+
private bool _isSidebarCollapsedInLocalChanges = false;
7885
}
7986
}

‎src/Views/LauncherPage.axaml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@
4747
<Binding Path="Histories.IsSearchingCommits"/>
4848
</MultiBinding>
4949
</v:Repository.IsCommitSearchPanelVisible>
50+
51+
<v:Repository.IsNormalSidebarVisible>
52+
<MultiBinding Converter="{x:Static BoolConverters.Or}">
53+
<MultiBinding Converter="{x:Static BoolConverters.And}">
54+
<Binding Path="SelectedViewIndex" Converter="{x:Static c:IntConverters.IsZero}"/>
55+
<Binding Path="Histories.IsSearchingCommits" Converter="{x:Static BoolConverters.Not}"/>
56+
</MultiBinding>
57+
<MultiBinding Converter="{x:Static BoolConverters.And}">
58+
<Binding Path="SelectedViewIndex" Converter="{x:Static c:IntConverters.IsOne}"/>
59+
<Binding Source="{x:Static vm:Preferences.Instance}" Path="Layout.IsSidebarCollapsedInLocalChanges" Converter="{x:Static BoolConverters.Not}"/>
60+
</MultiBinding>
61+
</MultiBinding>
62+
</v:Repository.IsNormalSidebarVisible>
5063
</v:Repository>
5164
</DataTemplate>
5265
</ContentControl.DataTemplates>

‎src/Views/Repository.axaml‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,13 @@
240240
<!-- Main Body -->
241241
<Grid Grid.Row="1" Background="{DynamicResource Brush.Window}">
242242
<Grid.ColumnDefinitions>
243-
<ColumnDefinition Width="{Binding #ThisControl.SidebarWidth, Mode=TwoWay}" MinWidth="200"/>
244-
<ColumnDefinition Width="3"/>
243+
<ColumnDefinition Width="{Binding #ThisControl.SidebarWidth, Mode=TwoWay}" MinWidth="{Binding #ThisControl.SidebarMinWidth, Mode=OneWay}"/>
244+
<ColumnDefinition Width="Auto"/>
245245
<ColumnDefinition Width="*" MinWidth="100"/>
246246
</Grid.ColumnDefinitions>
247247

248248
<!-- Sidebar (Branches/Remotes/Tags/Submodules/Worktrees) -->
249-
<Grid Grid.Column="0"
250-
RowDefinitions="Auto,*"
251-
IsVisible="{Binding !#ThisControl.IsCommitSearchPanelVisible, Mode=OneWay}">
249+
<Grid Grid.Column="0" RowDefinitions="Auto,*" IsVisible="{Binding #ThisControl.IsNormalSidebarVisible, Mode=OneWay}">
252250
<!-- Filter Branches/Tags/Submodules -->
253251
<TextBox Grid.Row="0"
254252
x:Name="FilterBox"
@@ -570,12 +568,19 @@
570568

571569
<!-- Splitter -->
572570
<GridSplitter Grid.Column="1"
573-
MinWidth="1"
571+
Width="3" MinWidth="3" MaxWidth="3"
574572
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
575573
Background="Transparent"
576574
BorderThickness="0,0,1,0"
577575
BorderBrush="{DynamicResource Brush.Border0}"
578-
Focusable="False"/>
576+
Focusable="False">
577+
<GridSplitter.IsVisible>
578+
<MultiBinding Converter="{x:Static BoolConverters.Or}">
579+
<Binding ElementName="ThisControl" Path="IsCommitSearchPanelVisible"/>
580+
<Binding ElementName="ThisControl" Path="IsNormalSidebarVisible"/>
581+
</MultiBinding>
582+
</GridSplitter.IsVisible>
583+
</GridSplitter>
579584

580585
<!-- Right Page -->
581586
<Grid Grid.Column="2">

‎src/Views/Repository.axaml.cs‎

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,38 @@ public bool IsCommitSearchPanelVisible
2222
set
2323
{
2424
if (SetAndRaise(IsCommitSearchPanelVisibleProperty, ref _isCommitSearchPanelVisible, value))
25-
{
26-
var layout = ViewModels.Preferences.Instance.Layout;
27-
if (value)
28-
{
29-
SidebarWidth = new GridLength(layout.RepositorySearchCommitWidth, GridUnitType.Pixel);
30-
}
31-
else
32-
{
33-
SidebarWidth = new GridLength(layout.RepositorySidebarWidth, GridUnitType.Pixel);
34-
UpdateLeftSidebarLayout();
35-
}
36-
}
25+
CalculateSidebarWidth();
26+
}
27+
}
28+
29+
public static readonly DirectProperty<Repository, bool> IsNormalSidebarVisibleProperty =
30+
AvaloniaProperty.RegisterDirect<Repository, bool>(
31+
nameof(IsNormalSidebarVisible),
32+
static o => o.IsNormalSidebarVisible,
33+
static (o, v) => o.IsNormalSidebarVisible = v);
34+
35+
public bool IsNormalSidebarVisible
36+
{
37+
get => _isNormalSidebarVisible;
38+
set
39+
{
40+
if (SetAndRaise(IsNormalSidebarVisibleProperty, ref _isNormalSidebarVisible, value))
41+
CalculateSidebarWidth();
3742
}
3843
}
3944

45+
public static readonly DirectProperty<Repository, double> SidebarMinWidthProperty =
46+
AvaloniaProperty.RegisterDirect<Repository, double>(
47+
nameof(SidebarMinWidth),
48+
static o => o.SidebarMinWidth,
49+
static (o, v) => o.SidebarMinWidth = v);
50+
51+
public double SidebarMinWidth
52+
{
53+
get => _sidebarMinWidth;
54+
set => SetAndRaise(SidebarMinWidthProperty, ref _sidebarMinWidth, value);
55+
}
56+
4057
public static readonly DirectProperty<Repository, GridLength> SidebarWidthProperty =
4158
AvaloniaProperty.RegisterDirect<Repository, GridLength>(
4259
nameof(SidebarWidth),
@@ -53,7 +70,7 @@ public GridLength SidebarWidth
5370
var layout = ViewModels.Preferences.Instance.Layout;
5471
if (_isCommitSearchPanelVisible)
5572
layout.RepositorySearchCommitWidth = value.Value;
56-
else
73+
else if (_isNormalSidebarVisible)
5774
layout.RepositorySidebarWidth = value.Value;
5875
}
5976
}
@@ -493,7 +510,29 @@ private void OnRightPagePropertyChanged(object sender, AvaloniaPropertyChangedEv
493510
}
494511
}
495512

513+
private void CalculateSidebarWidth()
514+
{
515+
var layout = ViewModels.Preferences.Instance.Layout;
516+
if (_isCommitSearchPanelVisible)
517+
{
518+
SidebarMinWidth = 200;
519+
SidebarWidth = new GridLength(layout.RepositorySearchCommitWidth, GridUnitType.Pixel);
520+
}
521+
else if (_isNormalSidebarVisible)
522+
{
523+
SidebarMinWidth = 200;
524+
SidebarWidth = new GridLength(layout.RepositorySidebarWidth, GridUnitType.Pixel);
525+
}
526+
else
527+
{
528+
SidebarMinWidth = 0;
529+
SidebarWidth = new GridLength(0, GridUnitType.Pixel);
530+
}
531+
}
532+
533+
private bool _isNormalSidebarVisible = true;
496534
private bool _isCommitSearchPanelVisible = false;
535+
private double _sidebarMinWidth = 200;
497536
private GridLength _sidebarWidth;
498537
}
499538
}

‎src/Views/WorkingCopy.axaml‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,20 @@
196196

197197
<!-- Bottom -->
198198
<Border Grid.Row="4" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource Brush.Border0}">
199-
<Button Classes="flat"
200-
HorizontalAlignment="Center" VerticalAlignment="Center"
201-
Content="{DynamicResource Text.WorkingCopy.DiscardAll}"
202-
Command="{Binding DiscardAllChanges}"/>
199+
<Grid ColumnDefinitions="Auto,*,Auto">
200+
<ToggleButton Grid.Column="0"
201+
Classes="sidebar_expander"
202+
Width="32" Height="32"
203+
IsChecked="{Binding Source={x:Static vm:Preferences.Instance}, Path=Layout.IsSidebarCollapsedInLocalChanges, Mode=TwoWay}"
204+
ToolTip.Placement="RightEdgeAlignedBottom"/>
205+
206+
<Button Grid.Column="2"
207+
Classes="flat"
208+
Margin="0,0,8,0"
209+
HorizontalAlignment="Center" VerticalAlignment="Center"
210+
Content="{DynamicResource Text.WorkingCopy.DiscardAll}"
211+
Command="{Binding DiscardAllChanges}"/>
212+
</Grid>
203213
</Border>
204214
</Grid>
205215

0 commit comments

Comments
 (0)