mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-03-15 04:14:47 +00:00
UI: Change the background updater notification to a persistent button on the status bar when not in a game
This commit is contained in:
parent
13388e972a
commit
1024aa8757
4 changed files with 52 additions and 11 deletions
|
@ -17747,6 +17747,31 @@
|
|||
"zh_TW": "更新已停用!"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ID": "UpdaterBackgroundStatusBarButtonText",
|
||||
"Translations": {
|
||||
"ar_SA": "",
|
||||
"de_DE": "",
|
||||
"el_GR": "",
|
||||
"en_US": "Update Available!",
|
||||
"es_ES": "",
|
||||
"fr_FR": "",
|
||||
"he_IL": "",
|
||||
"it_IT": "",
|
||||
"ja_JP": "",
|
||||
"ko_KR": "",
|
||||
"no_NO": "",
|
||||
"pl_PL": "",
|
||||
"pt_BR": "",
|
||||
"ru_RU": "",
|
||||
"sv_SE": "",
|
||||
"th_TH": "",
|
||||
"tr_TR": "",
|
||||
"uk_UA": "",
|
||||
"zh_CN": "",
|
||||
"zh_TW": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"ID": "ControllerSettingsRotate90",
|
||||
"Translations": {
|
||||
|
@ -23873,4 +23898,4 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ using Avalonia.Media.Imaging;
|
|||
using Avalonia.Platform.Storage;
|
||||
using Avalonia.Threading;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using DynamicData;
|
||||
using DynamicData.Binding;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
|
@ -104,6 +105,13 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
[ObservableProperty] private bool _isSubMenuOpen;
|
||||
[ObservableProperty] private ApplicationContextMenu _listAppContextMenu;
|
||||
[ObservableProperty] private ApplicationContextMenu _gridAppContextMenu;
|
||||
[ObservableProperty] private bool _updateAvailable;
|
||||
|
||||
public static AsyncRelayCommand UpdateCommand => Commands.Create(async () =>
|
||||
{
|
||||
if (Updater.CanUpdate(true))
|
||||
await Updater.BeginUpdateAsync(true);
|
||||
});
|
||||
|
||||
private bool _showLoadProgress;
|
||||
private bool _isGameRunning;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
Background="{DynamicResource ThemeContentBackgroundColor}"
|
||||
DockPanel.Dock="Bottom"
|
||||
IsVisible="{Binding ShowMenuAndStatusBar}"
|
||||
ColumnDefinitions="Auto,Auto,*,Auto,Auto">
|
||||
ColumnDefinitions="Auto,Auto,*,Auto,Auto,Auto">
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="5"
|
||||
|
@ -280,9 +280,24 @@
|
|||
Text="{Binding GpuNameText}"
|
||||
TextAlignment="Start" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
<StackPanel
|
||||
Grid.Column="4"
|
||||
Margin="0,0,5,0"
|
||||
IsVisible="{Binding EnableNonGameRunningControls}"
|
||||
Orientation="Horizontal">
|
||||
<Button Margin="0, 0, 5, 0"
|
||||
Command="{Binding UpdateCommand}">
|
||||
<TextBlock
|
||||
Margin="-5"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{ext:Locale UpdaterBackgroundStatusBarButtonText}" />
|
||||
</Button>
|
||||
<controls:MiniVerticalSeparator IsVisible="{Binding UpdateAvailable}" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Column="5"
|
||||
Margin="0,0,5,0"
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="{Binding ShowFirmwareStatus}"
|
||||
Orientation="Horizontal">
|
||||
|
|
|
@ -413,15 +413,8 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
case UpdaterType.CheckInBackground:
|
||||
if ((await Updater.CheckVersionAsync()).TryGet(out (Version Current, Version Incoming) versions))
|
||||
{
|
||||
string newVersionString = ReleaseInformation.IsCanaryBuild
|
||||
? $"Canary {versions.Current} -> Canary {versions.Incoming}"
|
||||
: $"{versions.Current} -> {versions.Incoming}";
|
||||
|
||||
if (versions.Current < versions.Incoming)
|
||||
NotificationHelper.ShowInformation(
|
||||
title: "Update Available",
|
||||
text: newVersionString,
|
||||
onClick: () => _ = Updater.BeginUpdateAsync());
|
||||
Dispatcher.UIThread.Post(() => RyujinxApp.MainWindow.ViewModel.UpdateAvailable = true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue