mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-03-14 22:40:18 +00:00
Start AboutWindow
refactor
This commit is contained in:
parent
2b23463daa
commit
7c00738631
3 changed files with 230 additions and 239 deletions
|
@ -1015,7 +1015,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
|
||||||
public async void OpenAboutWindow()
|
public async void OpenAboutWindow()
|
||||||
{
|
{
|
||||||
await new AboutWindow().ShowDialog(_owner);
|
await AboutWindow.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ChangeLanguage(object obj)
|
public void ChangeLanguage(object obj)
|
||||||
|
|
|
@ -1,21 +1,16 @@
|
||||||
<window:StyleableWindow
|
<UserControl
|
||||||
x:Class="Ryujinx.Ava.UI.Windows.AboutWindow"
|
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
||||||
|
xmlns:flex="clr-namespace:Avalonia.Flexbox;assembly=Avalonia.Flexbox"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:window="clr-namespace:Ryujinx.Ava.UI.Windows"
|
|
||||||
Width="850"
|
|
||||||
Height="550"
|
|
||||||
MinWidth="500"
|
|
||||||
MinHeight="550"
|
|
||||||
d:DesignHeight="350"
|
|
||||||
d:DesignWidth="400"
|
|
||||||
CanResize="False"
|
|
||||||
SizeToContent="Width"
|
|
||||||
WindowStartupLocation="CenterOwner"
|
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="500"
|
||||||
|
d:DesignWidth="750"
|
||||||
|
Height="500"
|
||||||
|
Width="750"
|
||||||
|
x:Class="Ryujinx.Ava.UI.Windows.AboutWindow"
|
||||||
Focusable="True">
|
Focusable="True">
|
||||||
<Grid
|
<Grid
|
||||||
Margin="15"
|
Margin="15"
|
||||||
|
@ -37,48 +32,35 @@
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch">
|
VerticalAlignment="Stretch">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
<RowDefinition />
|
|
||||||
<RowDefinition />
|
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid Grid.Row="0">
|
<Grid Grid.Row="0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Image
|
<Image
|
||||||
Grid.Row="0"
|
|
||||||
Grid.RowSpan="3"
|
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Height="110"
|
Height="100"
|
||||||
MinWidth="50"
|
|
||||||
Margin="5,10,20,10"
|
|
||||||
Source="resm:Ryujinx.Ui.Common.Resources.Logo_Ryujinx.png?assembly=Ryujinx.Ui.Common" />
|
Source="resm:Ryujinx.Ui.Common.Resources.Logo_Ryujinx.png?assembly=Ryujinx.Ui.Common" />
|
||||||
<TextBlock
|
<flex:FlexPanel
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="0,20,0,0"
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
JustifyContent="SpaceBetween"
|
||||||
|
AlignContent="Center"
|
||||||
|
Direction="Column"
|
||||||
|
Margin="5">
|
||||||
|
<TextBlock
|
||||||
FontSize="35"
|
FontSize="35"
|
||||||
Text="Ryujinx"
|
Text="Ryujinx"
|
||||||
TextAlignment="Center" />
|
TextAlignment="Center" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="0,0,0,0"
|
|
||||||
FontSize="16"
|
FontSize="16"
|
||||||
Text="(REE-YOU-JINX)"
|
Text="(REE-YOU-JINX)"
|
||||||
TextAlignment="Center" />
|
TextAlignment="Center" />
|
||||||
<Button
|
<Button
|
||||||
Grid.Row="2"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="0"
|
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
Click="Button_OnClick"
|
Click="Button_OnClick"
|
||||||
|
@ -89,31 +71,34 @@
|
||||||
TextDecorations="Underline"
|
TextDecorations="Underline"
|
||||||
ToolTip.Tip="{locale:Locale AboutUrlTooltipMessage}" />
|
ToolTip.Tip="{locale:Locale AboutUrlTooltipMessage}" />
|
||||||
</Button>
|
</Button>
|
||||||
|
</flex:FlexPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<TextBlock
|
<flex:FlexPanel
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
|
Direction="Column"
|
||||||
|
JustifyContent="FlexEnd"
|
||||||
|
RowSpacing="10"
|
||||||
|
AlignContent="Center"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch">
|
||||||
|
<TextBlock
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{Binding Version}"
|
Text="{Binding Version}"
|
||||||
TextAlignment="Center" />
|
TextAlignment="Center" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="2"
|
|
||||||
Margin="20"
|
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
MaxLines="2"
|
MaxLines="2"
|
||||||
Text="{locale:Locale AboutDisclaimerMessage}"
|
Text="{locale:Locale AboutDisclaimerMessage}"
|
||||||
TextAlignment="Center" />
|
TextAlignment="Center" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Name="AmiiboLabel"
|
Name="AmiiboLabel"
|
||||||
Grid.Row="3"
|
|
||||||
Margin="20"
|
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
MaxLines="2"
|
MaxLines="2"
|
||||||
PointerPressed="AmiiboLabel_OnPointerPressed"
|
PointerPressed="AmiiboLabel_OnPointerPressed"
|
||||||
Text="{locale:Locale AboutAmiiboDisclaimerMessage}"
|
Text="{locale:Locale AboutAmiiboDisclaimerMessage}"
|
||||||
TextAlignment="Center" />
|
TextAlignment="Center" />
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Grid.Row="4"
|
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
|
@ -198,54 +183,44 @@
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
</flex:FlexPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Border
|
<Border
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="2"
|
Width="1"
|
||||||
Margin="5"
|
Margin="20 0"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
BorderBrush="White"
|
BorderBrush="Black"
|
||||||
BorderThickness="1,0,0,0">
|
BorderThickness="1,0,0,0" />
|
||||||
<Separator Width="0" />
|
<flex:FlexPanel
|
||||||
</Border>
|
|
||||||
<Grid
|
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Margin="20"
|
AlignContent="SpaceEvenly"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch">
|
VerticalAlignment="Stretch">
|
||||||
<Grid.RowDefinitions>
|
<StackPanel
|
||||||
<RowDefinition Height="Auto" />
|
Spacing="10">
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Text="{locale:Locale AboutRyujinxAboutTitle}"
|
FontSize="18"
|
||||||
TextDecorations="Underline" />
|
Text="{locale:Locale AboutRyujinxAboutTitle}" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
|
||||||
Margin="20,5,5,5"
|
|
||||||
LineHeight="20"
|
LineHeight="20"
|
||||||
|
TextWrapping="Wrap"
|
||||||
Text="{locale:Locale AboutRyujinxAboutContent}" />
|
Text="{locale:Locale AboutRyujinxAboutContent}" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel
|
||||||
|
Spacing="10">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="2"
|
|
||||||
Margin="0,10,0,0"
|
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Text="{locale:Locale AboutRyujinxMaintainersTitle}"
|
FontSize="18"
|
||||||
TextDecorations="Underline" />
|
Text="{locale:Locale AboutRyujinxMaintainersTitle}" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="3"
|
LineHeight="18"
|
||||||
Margin="20,5,5,5"
|
TextWrapping="Wrap"
|
||||||
LineHeight="20"
|
|
||||||
Text="{Binding Developers}" />
|
Text="{Binding Developers}" />
|
||||||
<Button
|
<Button
|
||||||
Grid.Row="4"
|
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
Click="Button_OnClick"
|
Click="Button_OnClick"
|
||||||
|
@ -253,30 +228,32 @@
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Text="{locale:Locale AboutRyujinxContributorsButtonHeader}"
|
Text="{locale:Locale AboutRyujinxContributorsButtonHeader}"
|
||||||
TextAlignment="Right"
|
TextAlignment="Right"
|
||||||
TextDecorations="Underline"
|
|
||||||
ToolTip.Tip="{locale:Locale AboutRyujinxMaintainersContentTooltipMessage}" />
|
ToolTip.Tip="{locale:Locale AboutRyujinxMaintainersContentTooltipMessage}" />
|
||||||
</Button>
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel
|
||||||
|
Spacing="10">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="5"
|
|
||||||
Margin="0,0,0,0"
|
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Text="{locale:Locale AboutRyujinxSupprtersTitle}"
|
FontSize="18"
|
||||||
TextDecorations="Underline" />
|
Text="{locale:Locale AboutRyujinxSupprtersTitle}" />
|
||||||
<Border
|
<Border
|
||||||
Grid.Row="6"
|
|
||||||
Width="460"
|
|
||||||
Height="200"
|
|
||||||
Margin="20,5"
|
|
||||||
Padding="5"
|
Padding="5"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
BorderBrush="White"
|
BorderBrush="Black"
|
||||||
BorderThickness="1">
|
BorderThickness="1"
|
||||||
|
CornerRadius="5">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Name="SupportersTextBlock"
|
Name="SupportersTextBlock"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Text="{Binding Supporters}"
|
TextTrimming="CharacterEllipsis"
|
||||||
TextWrapping="Wrap" />
|
FontSize="10"
|
||||||
|
MaxLines="10"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
LineHeight="12"
|
||||||
|
Text="{Binding Supporters}" />
|
||||||
</Border>
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</flex:FlexPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</UserControl>
|
||||||
</window:StyleableWindow>
|
|
||||||
|
|
|
@ -1,25 +1,23 @@
|
||||||
using Avalonia.Controls;
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
|
using FluentAvalonia.UI.Controls;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Common.Utilities;
|
using Ryujinx.Common.Utilities;
|
||||||
using Ryujinx.Ui.Common.Helper;
|
using Ryujinx.Ui.Common.Helper;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.NetworkInformation;
|
using System.Net.NetworkInformation;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Button = Avalonia.Controls.Button;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Windows
|
namespace Ryujinx.Ava.UI.Windows
|
||||||
{
|
{
|
||||||
public partial class AboutWindow : StyleableWindow
|
public partial class AboutWindow : UserControl
|
||||||
{
|
{
|
||||||
public AboutWindow()
|
public AboutWindow()
|
||||||
{
|
{
|
||||||
if (Program.PreviewerDetached)
|
|
||||||
{
|
|
||||||
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["MenuBarHelpAbout"];
|
|
||||||
}
|
|
||||||
|
|
||||||
Version = Program.Version;
|
Version = Program.Version;
|
||||||
|
|
||||||
DataContext = this;
|
DataContext = this;
|
||||||
|
@ -34,6 +32,22 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
|
|
||||||
public string Developers => string.Format(LocaleManager.Instance["AboutPageDeveloperListMore"], "gdkchan, Ac_K, Thog, rip in peri peri, LDj3SNuD, emmaus, Thealexbarney, Xpl0itR, GoffyDude, »jD«");
|
public string Developers => string.Format(LocaleManager.Instance["AboutPageDeveloperListMore"], "gdkchan, Ac_K, Thog, rip in peri peri, LDj3SNuD, emmaus, Thealexbarney, Xpl0itR, GoffyDude, »jD«");
|
||||||
|
|
||||||
|
public static async Task Show()
|
||||||
|
{
|
||||||
|
var content = new AboutWindow();
|
||||||
|
ContentDialog contentDialog = new ContentDialog
|
||||||
|
{
|
||||||
|
Title = LocaleManager.Instance["MenuBarHelpAbout"],
|
||||||
|
PrimaryButtonText = "",
|
||||||
|
SecondaryButtonText = "",
|
||||||
|
CloseButtonText = LocaleManager.Instance["UserProfilesClose"],
|
||||||
|
Content = content,
|
||||||
|
Padding = new Thickness(0)
|
||||||
|
};
|
||||||
|
|
||||||
|
await contentDialog.ShowAsync();
|
||||||
|
}
|
||||||
|
|
||||||
private void Button_OnClick(object sender, RoutedEventArgs e)
|
private void Button_OnClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is Button button)
|
if (sender is Button button)
|
||||||
|
|
Loading…
Reference in a new issue