Skip to content

Commit 48cbe8d

Browse files
committed
Add independent sidebar toggle to Dashboard
1 parent 63c13c2 commit 48cbe8d

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎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 IsSidebarCollapsedInDashboard
51+
{
52+
get => _isSidebarCollapsedInDashboard;
53+
set => SetProperty(ref _isSidebarCollapsedInDashboard, value);
54+
}
55+
5056
public bool IsSidebarCollapsedInLocalChanges
5157
{
5258
get => _isSidebarCollapsedInLocalChanges;
@@ -81,6 +87,7 @@ public GridLength CommitDetailFilesLeftWidth
8187
private GridLength _stashesLeftWidth = new GridLength(300, GridUnitType.Pixel);
8288
private GridLength _commitDetailChangesLeftWidth = new GridLength(256, GridUnitType.Pixel);
8389
private GridLength _commitDetailFilesLeftWidth = new GridLength(256, GridUnitType.Pixel);
90+
private bool _isSidebarCollapsedInDashboard = false;
8491
private bool _isSidebarCollapsedInLocalChanges = false;
8592
}
8693
}

‎src/Views/Histories.axaml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
<DataGrid.Columns>
106106
<DataGridTemplateColumn Width="*" IsReadOnly="True">
107107
<DataGridTemplateColumn.Header>
108-
<Border Padding="48,0">
108+
<Border Padding="72,0">
109109
<TextBlock Classes="table_header" Text="{DynamicResource Text.Histories.Header.GraphAndSubject}" HorizontalAlignment="Center"/>
110110
</Border>
111111
</DataGridTemplateColumn.Header>
@@ -253,6 +253,10 @@
253253
Margin="4,0,0,0"
254254
VerticalAlignment="Center"
255255
Spacing="6">
256+
<ToggleButton Classes="sidebar_expander"
257+
Width="18" Height="18"
258+
VerticalAlignment="Center"
259+
IsChecked="{Binding Source={x:Static vm:Preferences.Instance}, Path=Layout.IsSidebarCollapsedInDashboard, Mode=TwoWay}"/>
256260
<ToggleButton Classes="line_path" Width="18" IsChecked="{Binding IsSearchingCommits, Mode=TwoWay}">
257261
<ToolTip.Tip>
258262
<TextBlock>

‎src/Views/LauncherPage.axaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
<MultiBinding Converter="{x:Static BoolConverters.And}">
5454
<Binding Path="IsDashboardVisible"/>
5555
<Binding Path="Histories.IsSearchingCommits" Converter="{x:Static BoolConverters.Not}"/>
56+
<Binding Source="{x:Static vm:Preferences.Instance}" Path="Layout.IsSidebarCollapsedInDashboard" Converter="{x:Static BoolConverters.Not}"/>
5657
</MultiBinding>
5758
<MultiBinding Converter="{x:Static BoolConverters.And}">
5859
<Binding Path="IsWorkingCopyVisible"/>

0 commit comments

Comments
 (0)