Ava GUI: AboutWindow
Refactor (#4196)
* Start `AboutWindow` refactor * Redesign * Update logos + ViewModel * Fix GTK * Cleanup usings * Fix mismatched font size * Update LocaleKeys * Block scoped namespace * Fix appearence on German * Update Ryujinx.Ava/UI/ViewModels/AboutWindowViewModel.cs Co-authored-by: Ac_K <Acoustik666@gmail.com> * Update Ryujinx.Ava/UI/ViewModels/AboutWindowViewModel.cs Co-authored-by: Ac_K <Acoustik666@gmail.com> * Move version number up * Move see all contributors button left * Add a couple `\n` * Tooltips * Layout fix * Update Ryujinx.Ava/UI/ViewModels/AboutWindowViewModel.cs Co-authored-by: Ac_K <Acoustik666@gmail.com> Co-authored-by: Ac_K <Acoustik666@gmail.com>
136
Ryujinx.Ava/UI/ViewModels/AboutWindowViewModel.cs
Normal file
|
@ -0,0 +1,136 @@
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Media.Imaging;
|
||||||
|
using Avalonia.Threading;
|
||||||
|
using Ryujinx.Ava.Common.Locale;
|
||||||
|
using Ryujinx.Common.Utilities;
|
||||||
|
using Ryujinx.Ui.Common.Configuration;
|
||||||
|
using System;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Net.NetworkInformation;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
{
|
||||||
|
public class AboutWindowViewModel : BaseModel
|
||||||
|
{
|
||||||
|
private Bitmap _githubLogo;
|
||||||
|
private Bitmap _discordLogo;
|
||||||
|
private Bitmap _patreonLogo;
|
||||||
|
private Bitmap _twitterLogo;
|
||||||
|
|
||||||
|
private string _version;
|
||||||
|
private string _supporters;
|
||||||
|
|
||||||
|
public Bitmap GithubLogo
|
||||||
|
{
|
||||||
|
get => _githubLogo;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_githubLogo = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Bitmap DiscordLogo
|
||||||
|
{
|
||||||
|
get => _discordLogo;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_discordLogo = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Bitmap PatreonLogo
|
||||||
|
{
|
||||||
|
get => _patreonLogo;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_patreonLogo = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Bitmap TwitterLogo
|
||||||
|
{
|
||||||
|
get => _twitterLogo;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_twitterLogo = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Supporters
|
||||||
|
{
|
||||||
|
get => _supporters;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_supporters = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Version
|
||||||
|
{
|
||||||
|
get => _version;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_version = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Developers
|
||||||
|
{
|
||||||
|
get => string.Format(LocaleManager.Instance[LocaleKeys.AboutPageDeveloperListMore], "gdkchan, Ac_K, marysaka, rip in peri peri, LDj3SNuD, emmaus, Thealexbarney, GoffyDude, TSRBerry, IsaacMarovitz");
|
||||||
|
}
|
||||||
|
|
||||||
|
public AboutWindowViewModel()
|
||||||
|
{
|
||||||
|
Version = Program.Version;
|
||||||
|
|
||||||
|
var assets = AvaloniaLocator.Current.GetService<Avalonia.Platform.IAssetLoader>();
|
||||||
|
|
||||||
|
if (ConfigurationState.Instance.Ui.BaseStyle.Value == "Light")
|
||||||
|
{
|
||||||
|
GithubLogo = new Bitmap(assets.Open(new Uri("resm:Ryujinx.Ui.Common.Resources.Logo_GitHub_Light.png?assembly=Ryujinx.Ui.Common")));
|
||||||
|
DiscordLogo = new Bitmap(assets.Open(new Uri("resm:Ryujinx.Ui.Common.Resources.Logo_Discord_Light.png?assembly=Ryujinx.Ui.Common")));
|
||||||
|
PatreonLogo = new Bitmap(assets.Open(new Uri("resm:Ryujinx.Ui.Common.Resources.Logo_Patreon_Light.png?assembly=Ryujinx.Ui.Common")));
|
||||||
|
TwitterLogo = new Bitmap(assets.Open(new Uri("resm:Ryujinx.Ui.Common.Resources.Logo_Twitter_Light.png?assembly=Ryujinx.Ui.Common")));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GithubLogo = new Bitmap(assets.Open(new Uri("resm:Ryujinx.Ui.Common.Resources.Logo_GitHub_Dark.png?assembly=Ryujinx.Ui.Common")));
|
||||||
|
DiscordLogo = new Bitmap(assets.Open(new Uri("resm:Ryujinx.Ui.Common.Resources.Logo_Discord_Dark.png?assembly=Ryujinx.Ui.Common")));
|
||||||
|
PatreonLogo = new Bitmap(assets.Open(new Uri("resm:Ryujinx.Ui.Common.Resources.Logo_Patreon_Dark.png?assembly=Ryujinx.Ui.Common")));
|
||||||
|
TwitterLogo = new Bitmap(assets.Open(new Uri("resm:Ryujinx.Ui.Common.Resources.Logo_Twitter_Dark.png?assembly=Ryujinx.Ui.Common")));
|
||||||
|
}
|
||||||
|
|
||||||
|
Dispatcher.UIThread.InvokeAsync(DownloadPatronsJson);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task DownloadPatronsJson()
|
||||||
|
{
|
||||||
|
if (!NetworkInterface.GetIsNetworkAvailable())
|
||||||
|
{
|
||||||
|
Supporters = LocaleManager.Instance[LocaleKeys.ConnectionError];
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpClient httpClient = new();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string patreonJsonString = await httpClient.GetStringAsync("https://patreon.ryujinx.org/");
|
||||||
|
|
||||||
|
Supporters = string.Join(", ", JsonHelper.Deserialize<string[]>(patreonJsonString)) + "\n\n";
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Supporters = LocaleManager.Instance[LocaleKeys.ApiError];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1018,7 +1018,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,282 +1,253 @@
|
||||||
<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:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||||
|
xmlns:viewModel="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||||
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="260"
|
||||||
|
d:DesignWidth="550"
|
||||||
|
Height="260"
|
||||||
|
Width="550"
|
||||||
|
x:Class="Ryujinx.Ava.UI.Windows.AboutWindow"
|
||||||
|
x:DataType="viewModel:AboutWindowViewModel"
|
||||||
|
x:CompileBindings="True"
|
||||||
|
Margin="0 -12 0 0"
|
||||||
Focusable="True">
|
Focusable="True">
|
||||||
|
<Design.DataContext>
|
||||||
|
<viewModel:AboutWindowViewModel />
|
||||||
|
</Design.DataContext>
|
||||||
<Grid
|
<Grid
|
||||||
Margin="15"
|
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch">
|
VerticalAlignment="Stretch">
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid
|
<Grid
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="20"
|
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch">
|
VerticalAlignment="Stretch">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="*" />
|
|
||||||
<RowDefinition />
|
|
||||||
<RowDefinition />
|
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid Grid.Row="0">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition />
|
|
||||||
<ColumnDefinition />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Image
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.RowSpan="3"
|
|
||||||
Grid.Column="0"
|
|
||||||
Height="110"
|
|
||||||
MinWidth="50"
|
|
||||||
Margin="5,10,20,10"
|
|
||||||
Source="resm:Ryujinx.Ui.Common.Resources.Logo_Ryujinx.png?assembly=Ryujinx.Ui.Common" />
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="0,20,0,0"
|
|
||||||
FontSize="35"
|
|
||||||
Text="Ryujinx"
|
|
||||||
TextAlignment="Center" />
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="0,0,0,0"
|
|
||||||
FontSize="16"
|
|
||||||
Text="(REE-YOU-JINX)"
|
|
||||||
TextAlignment="Center" />
|
|
||||||
<Button
|
|
||||||
Grid.Row="2"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="0"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Background="Transparent"
|
|
||||||
Click="Button_OnClick"
|
|
||||||
Tag="https://www.ryujinx.org/">
|
|
||||||
<TextBlock
|
|
||||||
Text="www.ryujinx.org"
|
|
||||||
TextAlignment="Center"
|
|
||||||
TextDecorations="Underline"
|
|
||||||
ToolTip.Tip="{locale:Locale AboutUrlTooltipMessage}" />
|
|
||||||
</Button>
|
|
||||||
</Grid>
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="1"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Version}"
|
|
||||||
TextAlignment="Center" />
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="2"
|
|
||||||
Margin="20"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
MaxLines="2"
|
|
||||||
Text="{locale:Locale AboutDisclaimerMessage}"
|
|
||||||
TextAlignment="Center" />
|
|
||||||
<TextBlock
|
|
||||||
Name="AmiiboLabel"
|
|
||||||
Grid.Row="3"
|
|
||||||
Margin="20"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
MaxLines="2"
|
|
||||||
PointerPressed="AmiiboLabel_OnPointerPressed"
|
|
||||||
Text="{locale:Locale AboutAmiiboDisclaimerMessage}"
|
|
||||||
TextAlignment="Center" />
|
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Grid.Row="4"
|
Grid.Row="0"
|
||||||
HorizontalAlignment="Center"
|
Spacing="10"
|
||||||
Orientation="Horizontal"
|
HorizontalAlignment="Stretch"
|
||||||
Spacing="10">
|
VerticalAlignment="Stretch">
|
||||||
<StackPanel Orientation="Vertical" ToolTip.Tip="{locale:Locale AboutPatreonUrlTooltipMessage}">
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image
|
||||||
|
Grid.Column="0"
|
||||||
|
Height="80"
|
||||||
|
Source="resm:Ryujinx.Ui.Common.Resources.Logo_Ryujinx.png?assembly=Ryujinx.Ui.Common" />
|
||||||
|
<flex:FlexPanel
|
||||||
|
Grid.Column="2"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
Direction="Column"
|
||||||
|
JustifyContent="SpaceAround"
|
||||||
|
RowSpacing="2">
|
||||||
|
<TextBlock
|
||||||
|
FontSize="28"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Text="Ryujinx"
|
||||||
|
TextAlignment="Left" />
|
||||||
|
<TextBlock
|
||||||
|
Text="(REE-YOU-JINX)"
|
||||||
|
TextAlignment="Left" />
|
||||||
|
</flex:FlexPanel>
|
||||||
|
</Grid>
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Version}"
|
||||||
|
TextAlignment="Center"
|
||||||
|
FontSize="10"
|
||||||
|
LineHeight="12" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel
|
||||||
|
Grid.Row="2"
|
||||||
|
Spacing="10"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch">
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Width="200"
|
||||||
|
Text="{locale:Locale AboutDisclaimerMessage}"
|
||||||
|
TextAlignment="Center"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
FontSize="10"
|
||||||
|
LineHeight="12" />
|
||||||
|
<TextBlock
|
||||||
|
Name="AmiiboLabel"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Width="200"
|
||||||
|
PointerPressed="AmiiboLabel_OnPointerPressed"
|
||||||
|
Text="{locale:Locale AboutAmiiboDisclaimerMessage}"
|
||||||
|
TextAlignment="Center"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
FontSize="10"
|
||||||
|
LineHeight="12" />
|
||||||
|
<StackPanel
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="10">
|
||||||
<Button
|
<Button
|
||||||
Height="65"
|
MaxHeight="30"
|
||||||
Background="Transparent"
|
MaxWidth="30"
|
||||||
Click="Button_OnClick"
|
MinHeight="30"
|
||||||
Tag="https://www.patreon.com/ryujinx">
|
MinWidth="30"
|
||||||
<Grid>
|
Padding="8"
|
||||||
<Grid.RowDefinitions>
|
CornerRadius="15"
|
||||||
<RowDefinition />
|
Background="Transparent"
|
||||||
<RowDefinition Height="Auto" />
|
Click="Button_OnClick"
|
||||||
</Grid.RowDefinitions>
|
Tag="https://www.patreon.com/ryujinx"
|
||||||
<Image Source="resm:Ryujinx.Ui.Common.Resources.Logo_Patreon.png?assembly=Ryujinx.Ui.Common" />
|
ToolTip.Tip="{locale:Locale AboutPatreonUrlTooltipMessage}">
|
||||||
<TextBlock
|
<Image Source="{Binding PatreonLogo}" />
|
||||||
Grid.Row="1"
|
|
||||||
Margin="0,5,0,0"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Text="Patreon" />
|
|
||||||
</Grid>
|
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Vertical" ToolTip.Tip="{locale:Locale AboutGithubUrlTooltipMessage}">
|
|
||||||
<Button
|
<Button
|
||||||
Height="65"
|
MaxHeight="30"
|
||||||
Background="Transparent"
|
MaxWidth="30"
|
||||||
Click="Button_OnClick"
|
MinHeight="30"
|
||||||
Tag="https://github.com/Ryujinx/Ryujinx">
|
MinWidth="30"
|
||||||
<Grid>
|
Padding="8"
|
||||||
<Grid.RowDefinitions>
|
CornerRadius="15"
|
||||||
<RowDefinition />
|
Background="Transparent"
|
||||||
<RowDefinition Height="Auto" />
|
Click="Button_OnClick"
|
||||||
</Grid.RowDefinitions>
|
Tag="https://github.com/Ryujinx/Ryujinx"
|
||||||
<Image Source="resm:Ryujinx.Ui.Common.Resources.Logo_GitHub.png?assembly=Ryujinx.Ui.Common" />
|
ToolTip.Tip="{locale:Locale AboutGithubUrlTooltipMessage}">
|
||||||
<TextBlock
|
<Image Source="{Binding GithubLogo}" />
|
||||||
Grid.Row="1"
|
|
||||||
Margin="0,5,0,0"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Text="GitHub" />
|
|
||||||
</Grid>
|
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Vertical" ToolTip.Tip="{locale:Locale AboutDiscordUrlTooltipMessage}">
|
|
||||||
<Button
|
<Button
|
||||||
Height="65"
|
MaxHeight="30"
|
||||||
Background="Transparent"
|
MaxWidth="30"
|
||||||
Click="Button_OnClick"
|
MinHeight="30"
|
||||||
Tag="https://discordapp.com/invite/N2FmfVc">
|
MinWidth="30"
|
||||||
<Grid>
|
Padding="8"
|
||||||
<Grid.RowDefinitions>
|
CornerRadius="15"
|
||||||
<RowDefinition />
|
Background="Transparent"
|
||||||
<RowDefinition Height="Auto" />
|
Click="Button_OnClick"
|
||||||
</Grid.RowDefinitions>
|
Tag="https://discordapp.com/invite/N2FmfVc"
|
||||||
<Image Source="resm:Ryujinx.Ui.Common.Resources.Logo_Discord.png?assembly=Ryujinx.Ui.Common" />
|
ToolTip.Tip="{locale:Locale AboutDiscordUrlTooltipMessage}">
|
||||||
<TextBlock
|
<Image Source="{Binding DiscordLogo}" />
|
||||||
Grid.Row="1"
|
|
||||||
Margin="0,5,0,0"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Text="Discord" />
|
|
||||||
</Grid>
|
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Vertical" ToolTip.Tip="{locale:Locale AboutTwitterUrlTooltipMessage}">
|
|
||||||
<Button
|
<Button
|
||||||
Height="65"
|
MaxHeight="30"
|
||||||
Background="Transparent"
|
MaxWidth="30"
|
||||||
Click="Button_OnClick"
|
MinHeight="30"
|
||||||
Tag="https://twitter.com/RyujinxEmu">
|
MinWidth="30"
|
||||||
<Grid>
|
Padding="8"
|
||||||
<Grid.RowDefinitions>
|
CornerRadius="15"
|
||||||
<RowDefinition />
|
Background="Transparent"
|
||||||
<RowDefinition Height="Auto" />
|
Click="Button_OnClick"
|
||||||
</Grid.RowDefinitions>
|
Tag="https://twitter.com/RyujinxEmu"
|
||||||
<Image Source="resm:Ryujinx.Ui.Common.Resources.Logo_Twitter.png?assembly=Ryujinx.Ui.Common" />
|
ToolTip.Tip="{locale:Locale AboutTwitterUrlTooltipMessage}">
|
||||||
<TextBlock
|
<Image Source="{Binding TwitterLogo}" />
|
||||||
Grid.Row="1"
|
</Button>
|
||||||
Margin="0,5,0,0"
|
<Button
|
||||||
HorizontalAlignment="Center"
|
MaxHeight="30"
|
||||||
Text="Twitter" />
|
MaxWidth="30"
|
||||||
</Grid>
|
MinHeight="30"
|
||||||
|
MinWidth="30"
|
||||||
|
Padding="8"
|
||||||
|
CornerRadius="15"
|
||||||
|
Background="Transparent"
|
||||||
|
Click="Button_OnClick"
|
||||||
|
Tag="https://www.ryujinx.org"
|
||||||
|
ToolTip.Tip="{locale:Locale AboutUrlTooltipMessage}">
|
||||||
|
<ui:SymbolIcon
|
||||||
|
Symbol="Link"
|
||||||
|
Foreground="{DynamicResource ThemeForegroundColor}" />
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Border
|
<Border
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="2"
|
Width="1"
|
||||||
Margin="5"
|
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
BorderBrush="White"
|
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
||||||
BorderThickness="1,0,0,0">
|
BorderThickness="1,0,0,0"
|
||||||
<Separator Width="0" />
|
Margin="20 0"/>
|
||||||
</Border>
|
|
||||||
<Grid
|
<Grid
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Margin="20"
|
HorizontalAlignment="Stretch"
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
VerticalAlignment="Stretch">
|
VerticalAlignment="Stretch">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock
|
<StackPanel
|
||||||
FontWeight="Bold"
|
Grid.Row="0"
|
||||||
Text="{locale:Locale AboutRyujinxAboutTitle}"
|
Margin="0 10 0 0"
|
||||||
TextDecorations="Underline" />
|
Spacing="2">
|
||||||
<TextBlock
|
|
||||||
Grid.Row="1"
|
|
||||||
Margin="20,5,5,5"
|
|
||||||
LineHeight="20"
|
|
||||||
Text="{locale:Locale AboutRyujinxAboutContent}" />
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="2"
|
|
||||||
Margin="0,10,0,0"
|
|
||||||
FontWeight="Bold"
|
|
||||||
Text="{locale:Locale AboutRyujinxMaintainersTitle}"
|
|
||||||
TextDecorations="Underline" />
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="3"
|
|
||||||
Margin="20,5,5,5"
|
|
||||||
LineHeight="20"
|
|
||||||
Text="{Binding Developers}" />
|
|
||||||
<Button
|
|
||||||
Grid.Row="4"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Background="Transparent"
|
|
||||||
Click="Button_OnClick"
|
|
||||||
Tag="https://github.com/Ryujinx/Ryujinx/graphs/contributors?type=a">
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Text="{locale:Locale AboutRyujinxContributorsButtonHeader}"
|
FontWeight="Bold"
|
||||||
TextAlignment="Right"
|
FontSize="15"
|
||||||
TextDecorations="Underline"
|
Text="{locale:Locale AboutRyujinxAboutTitle}" />
|
||||||
ToolTip.Tip="{locale:Locale AboutRyujinxMaintainersContentTooltipMessage}" />
|
|
||||||
</Button>
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="5"
|
|
||||||
Margin="0,0,0,0"
|
|
||||||
FontWeight="Bold"
|
|
||||||
Text="{locale:Locale AboutRyujinxSupprtersTitle}"
|
|
||||||
TextDecorations="Underline" />
|
|
||||||
<Border
|
|
||||||
Grid.Row="6"
|
|
||||||
Width="460"
|
|
||||||
Height="200"
|
|
||||||
Margin="20,5"
|
|
||||||
Padding="5"
|
|
||||||
VerticalAlignment="Stretch"
|
|
||||||
BorderBrush="White"
|
|
||||||
BorderThickness="1">
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Name="SupportersTextBlock"
|
FontSize="10"
|
||||||
VerticalAlignment="Top"
|
TextWrapping="Wrap"
|
||||||
Text="{Binding Supporters}"
|
Text="{locale:Locale AboutRyujinxAboutContent}" />
|
||||||
TextWrapping="Wrap" />
|
</StackPanel>
|
||||||
</Border>
|
<StackPanel
|
||||||
|
Grid.Row="1"
|
||||||
|
Margin="0 10 0 0"
|
||||||
|
Spacing="2">
|
||||||
|
<TextBlock
|
||||||
|
FontWeight="Bold"
|
||||||
|
FontSize="15"
|
||||||
|
Text="{locale:Locale AboutRyujinxMaintainersTitle}" />
|
||||||
|
<TextBlock
|
||||||
|
FontSize="10"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Text="{Binding Developers}" />
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Background="Transparent"
|
||||||
|
Click="Button_OnClick"
|
||||||
|
Padding="5"
|
||||||
|
Tag="https://github.com/Ryujinx/Ryujinx/graphs/contributors?type=a">
|
||||||
|
<TextBlock
|
||||||
|
FontSize="10"
|
||||||
|
Text="{locale:Locale AboutRyujinxContributorsButtonHeader}"
|
||||||
|
TextAlignment="Right"
|
||||||
|
ToolTip.Tip="{locale:Locale AboutRyujinxMaintainersContentTooltipMessage}" />
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel
|
||||||
|
Grid.Row="2"
|
||||||
|
Margin="0 10 0 0"
|
||||||
|
Spacing="2">
|
||||||
|
<TextBlock
|
||||||
|
FontWeight="Bold"
|
||||||
|
FontSize="15"
|
||||||
|
Text="{locale:Locale AboutRyujinxSupprtersTitle}" />
|
||||||
|
<ScrollViewer
|
||||||
|
VerticalScrollBarVisibility="Visible"
|
||||||
|
HorizontalScrollBarVisibility="Disabled"
|
||||||
|
Height="70">
|
||||||
|
<TextBlock
|
||||||
|
Name="SupportersTextBlock"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
FontSize="10"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Text="{Binding Supporters}" />
|
||||||
|
</ScrollViewer>
|
||||||
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</window:StyleableWindow>
|
</UserControl>
|
|
@ -1,38 +1,48 @@
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Styling;
|
||||||
|
using FluentAvalonia.UI.Controls;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Common.Utilities;
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
using Ryujinx.Ui.Common.Helper;
|
using Ryujinx.Ui.Common.Helper;
|
||||||
using System.Net.Http;
|
|
||||||
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)
|
DataContext = new AboutWindowViewModel();
|
||||||
{
|
|
||||||
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance[LocaleKeys.MenuBarHelpAbout];
|
|
||||||
}
|
|
||||||
|
|
||||||
Version = Program.Version;
|
|
||||||
|
|
||||||
DataContext = this;
|
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
_ = DownloadPatronsJson();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Supporters { get; set; }
|
public static async Task Show()
|
||||||
public string Version { get; set; }
|
{
|
||||||
|
var content = new AboutWindow();
|
||||||
|
|
||||||
public string Developers => string.Format(LocaleManager.Instance[LocaleKeys.AboutPageDeveloperListMore], "gdkchan, Ac_K, Thog, rip in peri peri, LDj3SNuD, emmaus, Thealexbarney, Xpl0itR, GoffyDude, »jD«");
|
ContentDialog contentDialog = new()
|
||||||
|
{
|
||||||
|
PrimaryButtonText = "",
|
||||||
|
SecondaryButtonText = "",
|
||||||
|
CloseButtonText = LocaleManager.Instance[LocaleKeys.UserProfilesClose],
|
||||||
|
Content = content
|
||||||
|
};
|
||||||
|
|
||||||
|
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 contentDialog.ShowAsync();
|
||||||
|
}
|
||||||
|
|
||||||
private void Button_OnClick(object sender, RoutedEventArgs e)
|
private void Button_OnClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -42,31 +52,6 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task DownloadPatronsJson()
|
|
||||||
{
|
|
||||||
if (!NetworkInterface.GetIsNetworkAvailable())
|
|
||||||
{
|
|
||||||
Supporters = LocaleManager.Instance[LocaleKeys.ConnectionError];
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
HttpClient httpClient = new();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
string patreonJsonString = await httpClient.GetStringAsync("https://patreon.ryujinx.org/");
|
|
||||||
|
|
||||||
Supporters = string.Join(", ", JsonHelper.Deserialize<string[]>(patreonJsonString));
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Supporters = LocaleManager.Instance[LocaleKeys.ApiError];
|
|
||||||
}
|
|
||||||
|
|
||||||
await Dispatcher.UIThread.InvokeAsync(() => SupportersTextBlock.Text = Supporters);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AmiiboLabel_OnPointerPressed(object sender, PointerPressedEventArgs e)
|
private void AmiiboLabel_OnPointerPressed(object sender, PointerPressedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is TextBlock)
|
if (sender is TextBlock)
|
||||||
|
|
Before Width: | Height: | Size: 7.8 KiB |
BIN
Ryujinx.Ui.Common/Resources/Logo_Discord_Dark.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
Ryujinx.Ui.Common/Resources/Logo_Discord_Light.png
Normal file
After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 16 KiB |
BIN
Ryujinx.Ui.Common/Resources/Logo_GitHub_Dark.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
Ryujinx.Ui.Common/Resources/Logo_GitHub_Light.png
Normal file
After Width: | Height: | Size: 5 KiB |
Before Width: | Height: | Size: 7.9 KiB |
BIN
Ryujinx.Ui.Common/Resources/Logo_Patreon_Dark.png
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
Ryujinx.Ui.Common/Resources/Logo_Patreon_Light.png
Normal file
After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 14 KiB |
BIN
Ryujinx.Ui.Common/Resources/Logo_Twitter_Dark.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
Ryujinx.Ui.Common/Resources/Logo_Twitter_Light.png
Normal file
After Width: | Height: | Size: 19 KiB |
|
@ -34,11 +34,15 @@
|
||||||
<EmbeddedResource Include="Resources\Icon_NSP.png" />
|
<EmbeddedResource Include="Resources\Icon_NSP.png" />
|
||||||
<EmbeddedResource Include="Resources\Icon_XCI.png" />
|
<EmbeddedResource Include="Resources\Icon_XCI.png" />
|
||||||
<EmbeddedResource Include="Resources\Logo_Amiibo.png" />
|
<EmbeddedResource Include="Resources\Logo_Amiibo.png" />
|
||||||
<EmbeddedResource Include="Resources\Logo_Discord.png" />
|
|
||||||
<EmbeddedResource Include="Resources\Logo_GitHub.png" />
|
|
||||||
<EmbeddedResource Include="Resources\Logo_Patreon.png" />
|
|
||||||
<EmbeddedResource Include="Resources\Logo_Ryujinx.png" />
|
<EmbeddedResource Include="Resources\Logo_Ryujinx.png" />
|
||||||
<EmbeddedResource Include="Resources\Logo_Twitter.png" />
|
<EmbeddedResource Include="Resources\Logo_Discord_Dark.png" />
|
||||||
|
<EmbeddedResource Include="Resources\Logo_Discord_Light.png" />
|
||||||
|
<EmbeddedResource Include="Resources\Logo_GitHub_Dark.png" />
|
||||||
|
<EmbeddedResource Include="Resources\Logo_GitHub_Light.png" />
|
||||||
|
<EmbeddedResource Include="Resources\Logo_Patreon_Dark.png" />
|
||||||
|
<EmbeddedResource Include="Resources\Logo_Patreon_Light.png" />
|
||||||
|
<EmbeddedResource Include="Resources\Logo_Twitter_Dark.png" />
|
||||||
|
<EmbeddedResource Include="Resources\Logo_Twitter_Light.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
8
Ryujinx/Ui/Windows/AboutWindow.Designer.cs
generated
|
@ -206,7 +206,7 @@ namespace Ryujinx.Ui.Windows
|
||||||
//
|
//
|
||||||
// _patreonLogo
|
// _patreonLogo
|
||||||
//
|
//
|
||||||
_patreonLogo = new Image(new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Patreon.png", 30, 30))
|
_patreonLogo = new Image(new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Patreon_Light.png", 30, 30))
|
||||||
{
|
{
|
||||||
Margin = 10
|
Margin = 10
|
||||||
};
|
};
|
||||||
|
@ -236,7 +236,7 @@ namespace Ryujinx.Ui.Windows
|
||||||
//
|
//
|
||||||
// _githubLogo
|
// _githubLogo
|
||||||
//
|
//
|
||||||
_githubLogo = new Image(new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_GitHub.png", 30, 30))
|
_githubLogo = new Image(new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_GitHub_Light.png", 30, 30))
|
||||||
{
|
{
|
||||||
Margin = 10
|
Margin = 10
|
||||||
};
|
};
|
||||||
|
@ -266,7 +266,7 @@ namespace Ryujinx.Ui.Windows
|
||||||
//
|
//
|
||||||
// _discordLogo
|
// _discordLogo
|
||||||
//
|
//
|
||||||
_discordLogo = new Image(new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Discord.png", 30, 30))
|
_discordLogo = new Image(new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Discord_Light.png", 30, 30))
|
||||||
{
|
{
|
||||||
Margin = 10
|
Margin = 10
|
||||||
};
|
};
|
||||||
|
@ -296,7 +296,7 @@ namespace Ryujinx.Ui.Windows
|
||||||
//
|
//
|
||||||
// _twitterLogo
|
// _twitterLogo
|
||||||
//
|
//
|
||||||
_twitterLogo = new Image(new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Twitter.png", 30, 30))
|
_twitterLogo = new Image(new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Twitter_Light.png", 30, 30))
|
||||||
{
|
{
|
||||||
Margin = 10
|
Margin = 10
|
||||||
};
|
};
|
||||||
|
|