mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2025-01-09 11:17:20 -03:00
UI: Widen compatibility list, and make search box take up all space horizontally
Some checks are pending
Canary release job / Create tag (push) Waiting to run
Canary release job / Release for linux-arm64 (push) Waiting to run
Canary release job / Release for linux-x64 (push) Waiting to run
Canary release job / Release for win-x64 (push) Waiting to run
Canary release job / Release MacOS universal (push) Waiting to run
Some checks are pending
Canary release job / Create tag (push) Waiting to run
Canary release job / Release for linux-arm64 (push) Waiting to run
Canary release job / Release for linux-x64 (push) Waiting to run
Canary release job / Release for win-x64 (push) Waiting to run
Canary release job / Release MacOS universal (push) Waiting to run
This commit is contained in:
parent
30b22ce6ba
commit
323c356d9c
6 changed files with 72 additions and 49 deletions
|
@ -169,8 +169,8 @@
|
||||||
<AdditionalFiles Include="Assets\locales.json" />
|
<AdditionalFiles Include="Assets\locales.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Update="Utilities\Compat\CompatibilityList.axaml.cs">
|
<Compile Update="Utilities\Compat\CompatibilityContentDialog.axaml.cs">
|
||||||
<DependentUpon>CompatibilityList.axaml</DependentUpon>
|
<DependentUpon>CompatibilityContentDialog.axaml</DependentUpon>
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -227,6 +227,6 @@ namespace Ryujinx.Ava.UI.Views.Main
|
||||||
|
|
||||||
public void CloseWindow(object sender, RoutedEventArgs e) => Window.Close();
|
public void CloseWindow(object sender, RoutedEventArgs e) => Window.Close();
|
||||||
|
|
||||||
private async void OpenCompatibilityList(object sender, RoutedEventArgs e) => await CompatibilityList.Show();
|
private async void OpenCompatibilityList(object sender, RoutedEventArgs e) => await CompatibilityContentDialog.Show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
<ui:ContentDialog xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="using:Ryujinx.Ava.Utilities.Compat"
|
||||||
|
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
||||||
|
xmlns:ext="using:Ryujinx.Ava.Common.Markup"
|
||||||
|
x:Class="Ryujinx.Ava.Utilities.Compat.CompatibilityContentDialog"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="600" d:DesignHeight="400"
|
||||||
|
CloseButtonText="{ext:Locale SettingsButtonClose}"
|
||||||
|
DefaultButton="Close"
|
||||||
|
x:DataType="local:CompatibilityViewModel">
|
||||||
|
<ui:ContentDialog.DataContext>
|
||||||
|
<local:CompatibilityViewModel/>
|
||||||
|
</ui:ContentDialog.DataContext>
|
||||||
|
<ui:ContentDialog.Resources>
|
||||||
|
<x:Double x:Key="ContentDialogMaxWidth">900</x:Double>
|
||||||
|
</ui:ContentDialog.Resources>
|
||||||
|
</ui:ContentDialog>
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
using Avalonia.Styling;
|
||||||
|
using FluentAvalonia.UI.Controls;
|
||||||
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.Utilities.Compat
|
||||||
|
{
|
||||||
|
public partial class CompatibilityContentDialog : ContentDialog
|
||||||
|
{
|
||||||
|
protected override Type StyleKeyOverride => typeof(ContentDialog);
|
||||||
|
|
||||||
|
public static async Task Show()
|
||||||
|
{
|
||||||
|
await CompatibilityHelper.InitAsync();
|
||||||
|
|
||||||
|
CompatibilityContentDialog contentDialog = new()
|
||||||
|
{
|
||||||
|
Content = new CompatibilityList { DataContext = new CompatibilityViewModel(RyujinxApp.MainWindow.ViewModel.ApplicationLibrary) }
|
||||||
|
};
|
||||||
|
|
||||||
|
Style closeButton = new(x => x.Name("CloseButton"));
|
||||||
|
closeButton.Setters.Add(new Setter(WidthProperty, 80d));
|
||||||
|
|
||||||
|
Style closeButtonParent = new(x => x.Name("CommandSpace"));
|
||||||
|
closeButtonParent.Setters.Add(new Setter(HorizontalAlignmentProperty, Avalonia.Layout.HorizontalAlignment.Right));
|
||||||
|
|
||||||
|
contentDialog.Styles.Add(closeButton);
|
||||||
|
contentDialog.Styles.Add(closeButtonParent);
|
||||||
|
|
||||||
|
await ContentDialogHelper.ShowAsync(contentDialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CompatibilityContentDialog() => InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -11,25 +11,24 @@
|
||||||
<UserControl.DataContext>
|
<UserControl.DataContext>
|
||||||
<local:CompatibilityViewModel />
|
<local:CompatibilityViewModel />
|
||||||
</UserControl.DataContext>
|
</UserControl.DataContext>
|
||||||
<StackPanel Orientation="Vertical">
|
<Grid RowDefinitions="Auto,*">
|
||||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
<Grid Grid.Row="0" ColumnDefinitions="*,Auto,Auto">
|
||||||
<TextBox Watermark="{ext:Locale CompatibilityListSearchBoxWatermark}" TextChanged="TextBox_OnTextChanged" />
|
<TextBox Grid.Column="0" HorizontalAlignment="Stretch" Watermark="{ext:Locale CompatibilityListSearchBoxWatermark}" TextChanged="TextBox_OnTextChanged" />
|
||||||
<CheckBox Margin="7, 0, 0, 0" IsChecked="{Binding OnlyShowOwnedGames}" />
|
<CheckBox Grid.Column="1" Margin="7, 0, 0, 0" IsChecked="{Binding OnlyShowOwnedGames}" />
|
||||||
<TextBlock Margin="-3, 0, 0, 0" Text="{ext:Locale CompatibilityListOnlyShowOwnedGames}" />
|
<TextBlock Grid.Column="2" Margin="-10, 0, 0, 0" Text="{ext:Locale CompatibilityListOnlyShowOwnedGames}" />
|
||||||
</StackPanel>
|
</Grid>
|
||||||
<ScrollViewer>
|
<ScrollViewer Grid.Row="1">
|
||||||
<ListBox Margin="5"
|
<ListBox Margin="0,5, 0, 0"
|
||||||
Padding="10"
|
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
ItemsSource="{Binding CurrentEntries}">
|
ItemsSource="{Binding CurrentEntries}">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate DataType="{x:Type local:CompatibilityEntry}">
|
<DataTemplate DataType="{x:Type local:CompatibilityEntry}">
|
||||||
<Grid HorizontalAlignment="Center" Width="500" ColumnDefinitions="Auto,Auto,Auto,*"
|
<Grid Width="750" ColumnDefinitions="Auto,Auto,Auto,*"
|
||||||
Margin="5">
|
Margin="5">
|
||||||
<TextBlock Grid.Column="0"
|
<TextBlock Grid.Column="0"
|
||||||
FontFamily="{StaticResource JetBrainsMono}"
|
FontFamily="{StaticResource JetBrainsMono}"
|
||||||
Text="{Binding GameName}"
|
Text="{Binding GameName}"
|
||||||
Width="140"
|
Width="333"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<TextBlock Grid.Column="1"
|
<TextBlock Grid.Column="1"
|
||||||
Width="135"
|
Width="135"
|
||||||
|
@ -55,5 +54,5 @@
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</StackPanel>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
|
@ -1,41 +1,9 @@
|
||||||
using Avalonia;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using Avalonia.Styling;
|
|
||||||
using FluentAvalonia.UI.Controls;
|
|
||||||
using Ryujinx.Ava.Common.Locale;
|
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
|
||||||
using Ryujinx.Ava.UI.Windows;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Ryujinx.Ava.Utilities.Compat
|
namespace Ryujinx.Ava.Utilities.Compat
|
||||||
{
|
{
|
||||||
public partial class CompatibilityList : UserControl
|
public partial class CompatibilityList : UserControl
|
||||||
{
|
{
|
||||||
public static async Task Show()
|
|
||||||
{
|
|
||||||
await CompatibilityHelper.InitAsync();
|
|
||||||
|
|
||||||
ContentDialog contentDialog = new()
|
|
||||||
{
|
|
||||||
PrimaryButtonText = string.Empty,
|
|
||||||
SecondaryButtonText = string.Empty,
|
|
||||||
CloseButtonText = LocaleManager.Instance[LocaleKeys.SettingsButtonClose],
|
|
||||||
Content = new CompatibilityList { DataContext = new CompatibilityViewModel(RyujinxApp.MainWindow.ViewModel.ApplicationLibrary) }
|
|
||||||
};
|
|
||||||
|
|
||||||
Style closeButton = new(x => x.Name("CloseButton"));
|
|
||||||
closeButton.Setters.Add(new Setter(WidthProperty, 80d));
|
|
||||||
|
|
||||||
Style closeButtonParent = new(x => x.Name("CommandSpace"));
|
|
||||||
closeButtonParent.Setters.Add(new Setter(HorizontalAlignmentProperty, Avalonia.Layout.HorizontalAlignment.Right));
|
|
||||||
|
|
||||||
contentDialog.Styles.Add(closeButton);
|
|
||||||
contentDialog.Styles.Add(closeButtonParent);
|
|
||||||
|
|
||||||
await ContentDialogHelper.ShowAsync(contentDialog);
|
|
||||||
}
|
|
||||||
|
|
||||||
public CompatibilityList()
|
public CompatibilityList()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
@ -53,4 +21,3 @@ namespace Ryujinx.Ava.Utilities.Compat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue