mirror of
https://github.com/GreemDev/Ryujinx
synced 2024-11-21 17:40:52 +01:00
misc: Use a method to create window titles.
This commit is contained in:
parent
40a488799e
commit
5f6d9eef6b
6 changed files with 13 additions and 8 deletions
|
@ -19,9 +19,14 @@ namespace Ryujinx.Ava
|
|||
{
|
||||
public class App : Application
|
||||
{
|
||||
internal static string FormatTitle(LocaleKeys? windowTitleKey = null)
|
||||
=> windowTitleKey is null
|
||||
? $"Ryujinx {Program.Version}"
|
||||
: $"Ryujinx {Program.Version} - {LocaleManager.Instance[windowTitleKey.Value]}";
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
Name = $"Ryujinx {Program.Version}";
|
||||
Name = FormatTitle();
|
||||
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
|
||||
|
|
|
@ -1705,7 +1705,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
Title = $"Ryujinx {Program.Version}";
|
||||
Title = App.FormatTitle();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
|
||||
InitializeComponent();
|
||||
|
||||
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance[LocaleKeys.Amiibo];
|
||||
Title = App.FormatTitle(LocaleKeys.Amiibo);
|
||||
}
|
||||
|
||||
public AmiiboWindow()
|
||||
|
@ -31,7 +31,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
|
||||
if (Program.PreviewerDetached)
|
||||
{
|
||||
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance[LocaleKeys.Amiibo];
|
||||
Title = App.FormatTitle(LocaleKeys.Amiibo);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
|
||||
InitializeComponent();
|
||||
|
||||
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance[LocaleKeys.CheatWindowTitle];
|
||||
Title = App.FormatTitle(LocaleKeys.CheatWindowTitle);
|
||||
}
|
||||
|
||||
public CheatWindow(VirtualFileSystem virtualFileSystem, string titleId, string titleName, string titlePath)
|
||||
|
@ -95,7 +95,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
|
||||
DataContext = this;
|
||||
|
||||
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance[LocaleKeys.CheatWindowTitle];
|
||||
Title = App.FormatTitle(LocaleKeys.CheatWindowTitle);
|
||||
}
|
||||
|
||||
public void Save()
|
||||
|
|
|
@ -79,7 +79,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
|
||||
UiHandler = new AvaHostUIHandler(this);
|
||||
|
||||
ViewModel.Title = $"Ryujinx {Program.Version}";
|
||||
ViewModel.Title = App.FormatTitle();
|
||||
|
||||
// NOTE: Height of MenuBar and StatusBar is not usable here, since it would still be 0 at this point.
|
||||
StatusBarHeight = StatusBarView.StatusBar.MinHeight;
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
|
||||
public SettingsWindow(VirtualFileSystem virtualFileSystem, ContentManager contentManager)
|
||||
{
|
||||
Title = $"Ryujinx {Program.Version} - {LocaleManager.Instance[LocaleKeys.Settings]}";
|
||||
Title = App.FormatTitle(LocaleKeys.Settings);
|
||||
|
||||
ViewModel = new SettingsViewModel(virtualFileSystem, contentManager);
|
||||
DataContext = ViewModel;
|
||||
|
|
Loading…
Reference in a new issue