mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-03-15 05:44:47 +00:00
UI: Give the cheat manager the custom window title bar treatment
Some checks failed
Canary release job / Release for linux-x64 (push) Failing after 1m5s
Canary release job / Release for linux-arm64 (push) Failing after 1m7s
Canary release job / Create tag (push) Has been cancelled
Canary release job / Release for win-x64 (push) Has been cancelled
Canary release job / Release MacOS universal (push) Has been cancelled
Some checks failed
Canary release job / Release for linux-x64 (push) Failing after 1m5s
Canary release job / Release for linux-arm64 (push) Failing after 1m7s
Canary release job / Create tag (push) Has been cancelled
Canary release job / Release for win-x64 (push) Has been cancelled
Canary release job / Release MacOS universal (push) Has been cancelled
This commit is contained in:
parent
7bdf013ba6
commit
c76f32a4ee
4 changed files with 86 additions and 37 deletions
|
@ -20,38 +20,81 @@
|
||||||
</Style>
|
</Style>
|
||||||
</Window.Styles>
|
</Window.Styles>
|
||||||
<Grid Name="CheatGrid" Margin="15" RowDefinitions="Auto,Auto,Auto,*,Auto" ColumnDefinitions="*,*">
|
<Grid Name="CheatGrid" Margin="15" RowDefinitions="Auto,Auto,Auto,*,Auto" ColumnDefinitions="*,*">
|
||||||
<TextBlock
|
<Grid Name="FlushHeader" Grid.Row="1" Column="0" ColumnSpan="2" RowDefinitions="Auto,Auto,Auto" ColumnDefinitions="Auto,*,Auto,*">
|
||||||
Grid.Row="1"
|
<Image
|
||||||
Grid.Column="0"
|
Grid.Row="0"
|
||||||
Grid.ColumnSpan="2"
|
Grid.Column="0"
|
||||||
MaxWidth="500"
|
Name="RyuLogo"
|
||||||
Margin="20,15,20,5"
|
HorizontalAlignment="Left"
|
||||||
HorizontalAlignment="Center"
|
Margin="-7, -22, 7, 0"
|
||||||
VerticalAlignment="Center"
|
Height="28"
|
||||||
LineHeight="18"
|
Width="28" />
|
||||||
Text="{Binding Heading}"
|
<StackPanel Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
TextAlignment="Center"
|
Margin="7, -7, 0, 5"
|
||||||
TextWrapping="Wrap" />
|
Orientation="Horizontal"
|
||||||
<TextBlock
|
VerticalAlignment="Center"
|
||||||
Grid.Row="2"
|
HorizontalAlignment="Stretch">
|
||||||
Grid.Column="0"
|
<TextBlock
|
||||||
MaxWidth="500"
|
MaxWidth="500"
|
||||||
Margin="140,15,20,5"
|
Margin="0,8,5,0"
|
||||||
HorizontalAlignment="Center"
|
LineHeight="30"
|
||||||
VerticalAlignment="Center"
|
Text="{ext:Locale BuildId}"
|
||||||
LineHeight="30"
|
TextAlignment="Center"
|
||||||
Text="{ext:Locale BuildId}"
|
TextWrapping="Wrap" />
|
||||||
TextAlignment="Center"
|
<TextBox
|
||||||
TextWrapping="Wrap" />
|
Margin="0,0,0,0"
|
||||||
<TextBox
|
MinWidth="135"
|
||||||
Grid.Row="2"
|
Text="{Binding BuildId}"
|
||||||
Grid.Column="1"
|
IsReadOnly="True" />
|
||||||
Margin="0,5,110,5"
|
</StackPanel>
|
||||||
MinWidth="160"
|
<TextBlock
|
||||||
HorizontalAlignment="Center"
|
Grid.Row="1"
|
||||||
VerticalAlignment="Center"
|
Grid.Column="0"
|
||||||
Text="{Binding BuildId}"
|
Grid.ColumnSpan="4"
|
||||||
IsReadOnly="True" />
|
MaxWidth="500"
|
||||||
|
Margin="0,10,0,5"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
LineHeight="18"
|
||||||
|
Text="{Binding Heading}"
|
||||||
|
TextAlignment="Center"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
<Grid Name="NormalHeader" Grid.Row="1" Column="0" ColumnSpan="2" RowDefinitions="Auto,Auto,Auto" ColumnDefinitions="*,*">
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
MaxWidth="500"
|
||||||
|
Margin="20,15,20,5"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
LineHeight="18"
|
||||||
|
Text="{Binding Heading}"
|
||||||
|
TextAlignment="Center"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.Column="0"
|
||||||
|
MaxWidth="500"
|
||||||
|
Margin="140,15,20,5"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
LineHeight="30"
|
||||||
|
Text="{ext:Locale BuildId}"
|
||||||
|
TextAlignment="Center"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
<TextBox
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="0,5,110,5"
|
||||||
|
MinWidth="160"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding BuildId}"
|
||||||
|
IsReadOnly="True" />
|
||||||
|
</Grid>
|
||||||
<Border
|
<Border
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
|
|
|
@ -4,6 +4,7 @@ using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.UI.Models;
|
using Ryujinx.Ava.UI.Models;
|
||||||
using Ryujinx.Ava.Systems.AppLibrary;
|
using Ryujinx.Ava.Systems.AppLibrary;
|
||||||
using Ryujinx.Ava.Systems.Configuration;
|
using Ryujinx.Ava.Systems.Configuration;
|
||||||
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
using Ryujinx.HLE.FileSystem;
|
using Ryujinx.HLE.FileSystem;
|
||||||
using Ryujinx.HLE.HOS;
|
using Ryujinx.HLE.HOS;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -32,7 +33,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
Title = RyujinxApp.FormatTitle(LocaleKeys.CheatWindowTitle);
|
Title = RyujinxApp.FormatTitle(LocaleKeys.CheatWindowTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CheatWindow(VirtualFileSystem virtualFileSystem, string titleId, string titleName, string titlePath)
|
public CheatWindow(VirtualFileSystem virtualFileSystem, string titleId, string titleName, string titlePath) : base(useCustomTitleBar: true, 46)
|
||||||
{
|
{
|
||||||
MinWidth = 500;
|
MinWidth = 500;
|
||||||
MinHeight = 650;
|
MinHeight = 650;
|
||||||
|
@ -44,6 +45,10 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
FlushHeader.IsVisible = !ConfigurationState.Instance.ShowTitleBar;
|
||||||
|
NormalHeader.IsVisible = ConfigurationState.Instance.ShowTitleBar;
|
||||||
|
RyuLogo.Source = MainWindowViewModel.IconBitmap;
|
||||||
|
|
||||||
string modsBasePath = ModLoader.GetModsBasePath();
|
string modsBasePath = ModLoader.GetModsBasePath();
|
||||||
string titleModsPath = ModLoader.GetApplicationDir(modsBasePath, titleId);
|
string titleModsPath = ModLoader.GetApplicationDir(modsBasePath, titleId);
|
||||||
ulong titleIdValue = ulong.Parse(titleId, NumberStyles.HexNumber);
|
ulong titleIdValue = ulong.Parse(titleId, NumberStyles.HexNumber);
|
||||||
|
|
|
@ -21,12 +21,10 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
SearchBoxNormal = { Text = titleId ?? string.Empty }
|
SearchBoxNormal = { Text = titleId ?? string.Empty }
|
||||||
});
|
});
|
||||||
|
|
||||||
public CompatibilityListWindow() : base(useCustomTitleBar: true)
|
public CompatibilityListWindow() : base(useCustomTitleBar: true, 37)
|
||||||
{
|
{
|
||||||
Title = RyujinxApp.FormatTitle(LocaleKeys.CompatibilityListTitle);
|
Title = RyujinxApp.FormatTitle(LocaleKeys.CompatibilityListTitle);
|
||||||
|
|
||||||
TitleBar.Height = 37;
|
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
RyuLogo.Source = MainWindowViewModel.IconBitmap;
|
RyuLogo.Source = MainWindowViewModel.IconBitmap;
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
await appWindow.ShowDialog(owner ?? RyujinxApp.MainWindow);
|
await appWindow.ShowDialog(owner ?? RyujinxApp.MainWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected StyleableAppWindow(bool useCustomTitleBar = false)
|
protected StyleableAppWindow(bool useCustomTitleBar = false, double? titleBarHeight = null)
|
||||||
{
|
{
|
||||||
WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
||||||
TransparencyLevelHint = [WindowTransparencyLevel.None];
|
TransparencyLevelHint = [WindowTransparencyLevel.None];
|
||||||
|
@ -34,6 +34,9 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
{
|
{
|
||||||
TitleBar.ExtendsContentIntoTitleBar = !ConfigurationState.Instance.ShowTitleBar;
|
TitleBar.ExtendsContentIntoTitleBar = !ConfigurationState.Instance.ShowTitleBar;
|
||||||
TitleBar.TitleBarHitTestType = ConfigurationState.Instance.ShowTitleBar ? TitleBarHitTestType.Simple : TitleBarHitTestType.Complex;
|
TitleBar.TitleBarHitTestType = ConfigurationState.Instance.ShowTitleBar ? TitleBarHitTestType.Simple : TitleBarHitTestType.Complex;
|
||||||
|
|
||||||
|
if (TitleBar.ExtendsContentIntoTitleBar && titleBarHeight != null)
|
||||||
|
TitleBar.Height = titleBarHeight.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
Icon = MainWindowViewModel.IconBitmap;
|
Icon = MainWindowViewModel.IconBitmap;
|
||||||
|
|
Loading…
Add table
Reference in a new issue