From 6311fa081e295d327ccc7d6c59df3f0aebc893a7 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 18 Jun 2021 09:31:13 +0800 Subject: [PATCH] style: remove refresh button from toolbar, use F5 to reload repository's data instead --- src/Views/Launcher.xaml.cs | 2 +- src/Views/Widgets/Dashboard.xaml | 8 +------- src/Views/Widgets/Dashboard.xaml.cs | 18 +++++++++--------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/Views/Launcher.xaml.cs b/src/Views/Launcher.xaml.cs index 74251745..7173ec0e 100644 --- a/src/Views/Launcher.xaml.cs +++ b/src/Views/Launcher.xaml.cs @@ -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; } diff --git a/src/Views/Widgets/Dashboard.xaml b/src/Views/Widgets/Dashboard.xaml index 63884874..ce05cf7a 100644 --- a/src/Views/Widgets/Dashboard.xaml +++ b/src/Views/Widgets/Dashboard.xaml @@ -81,13 +81,7 @@ - diff --git a/src/Views/Widgets/Dashboard.xaml.cs b/src/Views/Widgets/Dashboard.xaml.cs index e9f0bf30..f6c800c8 100644 --- a/src/Views/Widgets/Dashboard.xaml.cs +++ b/src/Views/Widgets/Dashboard.xaml.cs @@ -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!!!");