Skip to content

Commit 58a86bb

Browse files
committed
ux: move clean up button from sidebar back to toolbar
Signed-off-by: leo <longshuang@msn.cn>
1 parent fa432d4 commit 58a86bb

4 files changed

Lines changed: 15 additions & 19 deletions

File tree

‎src/Views/Repository.axaml‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</Grid.ColumnDefinitions>
1818

1919
<!-- Page Switcher -->
20-
<Grid Grid.Column="0" Width="49" RowDefinitions="Auto,*,Auto,Auto,8">
20+
<Grid Grid.Column="0" Width="49" RowDefinitions="Auto,*,Auto,12">
2121
<ListBox Background="Transparent" SelectedIndex="{Binding SelectedViewIndex, Mode=TwoWay}" SelectionMode="AlwaysSelected">
2222
<ListBox.Styles>
2323
<Style Selector="Path.icon">
@@ -113,16 +113,8 @@
113113
</Grid>
114114
</ListBoxItem>
115115
</ListBox>
116-
116+
117117
<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"
126118
Classes="icon_button"
127119
Width="40" Height="40"
128120
Margin="4,0"

‎src/Views/Repository.axaml.cs‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@ public Repository()
1212
InitializeComponent();
1313
}
1414

15-
private async void Cleanup(object sender, RoutedEventArgs e)
16-
{
17-
if (DataContext is ViewModels.Repository repo)
18-
{
19-
await repo.CleanupAsync();
20-
e.Handled = true;
21-
}
22-
}
23-
2415
private async void OnOpenConfigure(object sender, RoutedEventArgs e)
2516
{
2617
if (DataContext is ViewModels.Repository repo)

‎src/Views/RepositoryToolbar.axaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@
115115
<Button Classes="icon_button" Width="32" Margin="12,0,0,0" Click="OpenCustomActionMenu" ToolTip.Tip="{DynamicResource Text.Repository.CustomActions}">
116116
<Path Width="14" Height="14" Data="{StaticResource Icons.Action}"/>
117117
</Button>
118+
119+
<Button Classes="icon_button" Width="32" Margin="12,0,0,0" Click="Cleanup" ToolTip.Tip="{DynamicResource Text.Repository.Clean}">
120+
<Path Width="14" Height="14" Margin="0,1,0,0" Data="{StaticResource Icons.Clean}"/>
121+
</Button>
118122
</StackPanel>
119123

120124
<StackPanel Grid.Column="2" Orientation="Horizontal">

‎src/Views/RepositoryToolbar.axaml.cs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,15 @@ private async void OpenGitLogs(object sender, RoutedEventArgs e)
513513
}
514514
}
515515

516+
private async void Cleanup(object sender, RoutedEventArgs e)
517+
{
518+
if (DataContext is ViewModels.Repository repo)
519+
{
520+
await repo.CleanupAsync();
521+
e.Handled = true;
522+
}
523+
}
524+
516525
private void NavigateToHead(object sender, RoutedEventArgs e)
517526
{
518527
if (DataContext is ViewModels.Repository { CurrentBranch: { } head } repo)

0 commit comments

Comments
 (0)