Skip to content

Commit 9856cfe

Browse files
Display the last update check time on the reload button (Avalonia) (#4615)
1 parent 5424207 commit 9856cfe

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

src/UniGetUI.Avalonia/ViewModels/SoftwarePages/PackagesPageViewModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public partial class PackagesPageViewModel : ViewModelBase
125125
[ObservableProperty] private string _globalQueryText = "";
126126
[ObservableProperty] private bool _newVersionHeaderVisible;
127127
[ObservableProperty] private bool _reloadButtonVisible;
128+
[ObservableProperty] private string _reloadButtonTooltip = "";
128129
[ObservableProperty] private bool _isFilterPaneOpen;
129130
[ObservableProperty] private PackageViewMode _viewMode;
130131
[ObservableProperty] private int _sortFieldIndex;
@@ -374,6 +375,7 @@ private void Loader_FinishedLoading(object? sender, EventArgs e)
374375
}
375376
IsLoading = false;
376377
_lastLoadTime = DateTime.Now;
378+
ReloadButtonTooltip = CoreTools.Translate("Last checked: {0}", _lastLoadTime.ToString(CultureInfo.CurrentCulture));
377379
FilterPackages();
378380
PackagesLoaded?.Invoke(ReloadReason.External);
379381
}

src/UniGetUI.Avalonia/Views/SoftwarePages/AbstractPackagesPage.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
HorizontalAlignment="Right"
137137
VerticalAlignment="Center"
138138
Command="{Binding ReloadCommand}"
139+
ToolTip.Tip="{Binding ReloadButtonTooltip}"
139140
automation:AutomationProperties.Name="{t:Translate Reload}"
140141
automation:AutomationProperties.AcceleratorKey="F5"
141142
IsVisible="{Binding ReloadButtonVisible}">

0 commit comments

Comments
 (0)