mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-03-15 04:14:47 +00:00
UI: More advanced IsVisible binding for update available button (idk why it's always showing)
This commit is contained in:
parent
aab9b58542
commit
a205ec374b
4 changed files with 15 additions and 8 deletions
|
@ -23898,4 +23898,4 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -283,10 +283,14 @@
|
|||
<StackPanel
|
||||
Grid.Column="4"
|
||||
Margin="0,0,5,0"
|
||||
IsVisible="{Binding EnableNonGameRunningControls}"
|
||||
Orientation="Horizontal">
|
||||
<StackPanel.IsVisible>
|
||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||
<Binding Path="EnableNonGameRunningControls" />
|
||||
<Binding Path="UpdateAvailable" />
|
||||
</MultiBinding>
|
||||
</StackPanel.IsVisible>
|
||||
<Button Margin="0, 0, 5, 0"
|
||||
IsVisible="{Binding UpdateAvailable}"
|
||||
Command="{Binding UpdateCommand}">
|
||||
<TextBlock
|
||||
Margin="-5"
|
||||
|
@ -294,7 +298,7 @@
|
|||
VerticalAlignment="Center"
|
||||
Text="{ext:Locale UpdaterBackgroundStatusBarButtonText}" />
|
||||
</Button>
|
||||
<controls:MiniVerticalSeparator IsVisible="{Binding UpdateAvailable}" />
|
||||
<controls:MiniVerticalSeparator Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Column="5"
|
||||
|
|
|
@ -413,8 +413,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
case UpdaterType.CheckInBackground:
|
||||
if ((await Updater.CheckVersionAsync()).TryGet(out (Version Current, Version Incoming) versions))
|
||||
{
|
||||
if (versions.Current < versions.Incoming)
|
||||
Dispatcher.UIThread.Post(() => RyujinxApp.MainWindow.ViewModel.UpdateAvailable = true);
|
||||
Dispatcher.UIThread.Post(() => RyujinxApp.MainWindow.ViewModel.UpdateAvailable = versions.Current < versions.Incoming);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ namespace Ryujinx.Ava
|
|||
|
||||
_running = false;
|
||||
|
||||
return (currentVersion, null);
|
||||
return default;
|
||||
}
|
||||
|
||||
return (currentVersion, newVersion);
|
||||
|
@ -178,7 +178,11 @@ namespace Ryujinx.Ava
|
|||
|
||||
_running = true;
|
||||
|
||||
(Version currentVersion, Version newVersion) = (await CheckVersionAsync(showVersionUpToDate)).OrDefault();
|
||||
Optional<(Version, Version)> versionTuple = await CheckVersionAsync(showVersionUpToDate);
|
||||
|
||||
if (_running is false || !versionTuple.HasValue) return;
|
||||
|
||||
(Version currentVersion, Version newVersion) = versionTuple.Value;
|
||||
|
||||
if (newVersion <= currentVersion)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue