style<Dashboard>: remove refresh button from toolbar, use F5 to reload repository's data instead

This commit is contained in:
leo 2021-06-18 09:31:13 +08:00
parent 4b9923b84c
commit 6311fa081e
3 changed files with 11 additions and 17 deletions

View file

@ -134,7 +134,7 @@ namespace SourceGit.Views {
if (Keyboard.IsKeyDown(Key.F5)) {
var dashboard = container.Get(tabs.Current) as Widgets.Dashboard;
if (dashboard != null) dashboard.Refresh(null, null);
if (dashboard != null) dashboard.Refresh();
e.Handled = true;
return;
}

View file

@ -81,13 +81,7 @@
<Button Click="OpenConfigure" Margin="6,0" BorderThickness="0" ToolTip="{StaticResource Text.Dashboard.Configure.Tip}">
<StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Setting}"/>
<TextBlock Margin="4,0,0,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.Configure}"/>
</StackPanel>
</Button>
<Button Click="Refresh" Margin="6,0" BorderThickness="0" ToolTip="{StaticResource Text.Dashboard.Refresh.Tip}">
<StackPanel Orientation="Horizontal">
<Path Width="13" Height="13" Data="{StaticResource Icon.Loading}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.Dashboard.Refresh}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.Configure}"/>
</StackPanel>
</Button>
</StackPanel>

View file

@ -96,6 +96,15 @@ namespace SourceGit.Views.Widgets {
#endregion
#region DATA
public void Refresh() {
UpdateBraches();
UpdateWorkingCopy();
UpdateStashes();
UpdateTags();
UpdateSubmodules();
UpdateSubTrees();
}
private void NavigateTo(string commitId) {
workspace.SelectedIndex = 0;
(pages.Get("histories") as Histories).NavigateTo(commitId);
@ -289,15 +298,6 @@ namespace SourceGit.Views.Widgets {
e.Handled = true;
}
public void Refresh(object sender, RoutedEventArgs e) {
UpdateBraches();
UpdateWorkingCopy();
UpdateStashes();
UpdateTags();
UpdateSubmodules();
UpdateSubTrees();
}
private void OpenFetch(object sender, RoutedEventArgs e) {
if (repo.Remotes.Count == 0) {
Models.Exception.Raise("No remotes added to this repository!!!");