diff options
| author | Ac_K <Acoustik666@gmail.com> | 2023-01-09 04:37:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-09 03:37:20 +0000 |
| commit | 610eecc1c1fec2203fff1ebd71cd10798fbcc05a (patch) | |
| tree | 5855ddb337ac613df0d912264ce02b5341c48aa8 /Ryujinx.Ava/UI/Windows | |
| parent | 492056abf6c97696075f16101009aa463c319832 (diff) | |
ava: Fixes regressions from refactoring (#4237)
* ava: Fix regressions from #4178
* Remove duplicated code
* real fix for right click menu
Co-Authored-By: Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com>
* Remove ContentDialogOverlay
Co-authored-by: Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com>
Diffstat (limited to 'Ryujinx.Ava/UI/Windows')
| -rw-r--r-- | Ryujinx.Ava/UI/Windows/AboutWindow.axaml | 460 | ||||
| -rw-r--r-- | Ryujinx.Ava/UI/Windows/AboutWindow.axaml.cs | 11 |
2 files changed, 232 insertions, 239 deletions
diff --git a/Ryujinx.Ava/UI/Windows/AboutWindow.axaml b/Ryujinx.Ava/UI/Windows/AboutWindow.axaml index f446890c..7bd3e20d 100644 --- a/Ryujinx.Ava/UI/Windows/AboutWindow.axaml +++ b/Ryujinx.Ava/UI/Windows/AboutWindow.axaml @@ -1,253 +1,247 @@ <UserControl + x:Class="Ryujinx.Ava.UI.Windows.AboutWindow" xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" xmlns:flex="clr-namespace:Avalonia.Flexbox;assembly=Avalonia.Flexbox" + xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 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" - mc:Ignorable="d" + Width="550" + Height="260" + Margin="0,-12,0,0" 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"> - <Design.DataContext> - <viewModel:AboutWindowViewModel /> - </Design.DataContext> - <Grid - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - <Grid + x:DataType="viewModel:AboutWindowViewModel" + Focusable="True" + mc:Ignorable="d"> + <Design.DataContext> + <viewModel:AboutWindowViewModel /> + </Design.DataContext> + <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <Grid Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="*" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - <StackPanel - Grid.Row="0" - Spacing="10" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch"> - <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 - MaxHeight="30" - MaxWidth="30" - MinHeight="30" - MinWidth="30" - Padding="8" - CornerRadius="15" - Background="Transparent" - Click="Button_OnClick" - Tag="https://www.patreon.com/ryujinx" - ToolTip.Tip="{locale:Locale AboutPatreonUrlTooltipMessage}"> - <Image Source="{Binding PatreonLogo}" /> - </Button> - <Button - MaxHeight="30" - MaxWidth="30" - MinHeight="30" - MinWidth="30" - Padding="8" - CornerRadius="15" - Background="Transparent" - Click="Button_OnClick" - Tag="https://github.com/Ryujinx/Ryujinx" - ToolTip.Tip="{locale:Locale AboutGithubUrlTooltipMessage}"> - <Image Source="{Binding GithubLogo}" /> - </Button> - <Button - MaxHeight="30" - MaxWidth="30" - MinHeight="30" - MinWidth="30" - Padding="8" - CornerRadius="15" - Background="Transparent" - Click="Button_OnClick" - Tag="https://discordapp.com/invite/N2FmfVc" - ToolTip.Tip="{locale:Locale AboutDiscordUrlTooltipMessage}"> - <Image Source="{Binding DiscordLogo}" /> - </Button> - <Button - MaxHeight="30" - MaxWidth="30" - MinHeight="30" - MinWidth="30" - Padding="8" - CornerRadius="15" - Background="Transparent" - Click="Button_OnClick" - Tag="https://twitter.com/RyujinxEmu" - ToolTip.Tip="{locale:Locale AboutTwitterUrlTooltipMessage}"> - <Image Source="{Binding TwitterLogo}" /> - </Button> - <Button - MaxHeight="30" - MaxWidth="30" - 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> - </StackPanel> - </StackPanel> - </Grid> - <Border + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="*" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <StackPanel + Grid.Row="0" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + Spacing="10"> + <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" + FontSize="10" + LineHeight="12" + Text="{Binding Version}" + TextAlignment="Center" /> + </StackPanel> + <StackPanel + Grid.Row="2" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + Spacing="10"> + <TextBlock + Width="200" + HorizontalAlignment="Center" + FontSize="10" + LineHeight="12" + Text="{locale:Locale AboutDisclaimerMessage}" + TextAlignment="Center" + TextWrapping="Wrap" /> + <TextBlock + Name="AmiiboLabel" + Width="200" + HorizontalAlignment="Center" + FontSize="10" + LineHeight="12" + PointerPressed="AmiiboLabel_OnPointerPressed" + Text="{locale:Locale AboutAmiiboDisclaimerMessage}" + TextAlignment="Center" + TextWrapping="Wrap" /> + <StackPanel + HorizontalAlignment="Center" + Orientation="Horizontal" + Spacing="10"> + <Button + MinWidth="30" + MinHeight="30" + MaxWidth="30" + MaxHeight="30" + Padding="8" + Background="Transparent" + Click="Button_OnClick" + CornerRadius="15" + Tag="https://www.patreon.com/ryujinx" + ToolTip.Tip="{locale:Locale AboutPatreonUrlTooltipMessage}"> + <Image Source="{Binding PatreonLogo}" /> + </Button> + <Button + MinWidth="30" + MinHeight="30" + MaxWidth="30" + MaxHeight="30" + Padding="8" + Background="Transparent" + Click="Button_OnClick" + CornerRadius="15" + Tag="https://github.com/Ryujinx/Ryujinx" + ToolTip.Tip="{locale:Locale AboutGithubUrlTooltipMessage}"> + <Image Source="{Binding GithubLogo}" /> + </Button> + <Button + MinWidth="30" + MinHeight="30" + MaxWidth="30" + MaxHeight="30" + Padding="8" + Background="Transparent" + Click="Button_OnClick" + CornerRadius="15" + Tag="https://discordapp.com/invite/N2FmfVc" + ToolTip.Tip="{locale:Locale AboutDiscordUrlTooltipMessage}"> + <Image Source="{Binding DiscordLogo}" /> + </Button> + <Button + MinWidth="30" + MinHeight="30" + MaxWidth="30" + MaxHeight="30" + Padding="8" + Background="Transparent" + Click="Button_OnClick" + CornerRadius="15" + Tag="https://twitter.com/RyujinxEmu" + ToolTip.Tip="{locale:Locale AboutTwitterUrlTooltipMessage}"> + <Image Source="{Binding TwitterLogo}" /> + </Button> + <Button + MinWidth="30" + MinHeight="30" + MaxWidth="30" + MaxHeight="30" + Padding="8" + Background="Transparent" + Click="Button_OnClick" + CornerRadius="15" + Tag="https://www.ryujinx.org" + ToolTip.Tip="{locale:Locale AboutUrlTooltipMessage}"> + <ui:SymbolIcon Foreground="{DynamicResource ThemeForegroundColor}" Symbol="Link" /> + </Button> + </StackPanel> + </StackPanel> + </Grid> + <Border Grid.Column="1" Width="1" + Margin="20,0" VerticalAlignment="Stretch" BorderBrush="{DynamicResource ThemeControlBorderColor}" - BorderThickness="1,0,0,0" - Margin="20 0"/> - <Grid + BorderThickness="1,0,0,0" /> + <Grid Grid.Column="2" - HorizontalAlignment="Stretch" + HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - <StackPanel - Grid.Row="0" - Margin="0 10 0 0" - Spacing="2"> - <TextBlock - FontWeight="Bold" - FontSize="15" - Text="{locale:Locale AboutRyujinxAboutTitle}" /> - <TextBlock - FontSize="10" - TextWrapping="Wrap" - Text="{locale:Locale AboutRyujinxAboutContent}" /> - </StackPanel> - <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.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <StackPanel + Grid.Row="0" + Margin="0,10,0,0" + Spacing="2"> + <TextBlock + FontSize="15" + FontWeight="Bold" + Text="{locale:Locale AboutRyujinxAboutTitle}" /> + <TextBlock + FontSize="10" + Text="{locale:Locale AboutRyujinxAboutContent}" + TextWrapping="Wrap" /> + </StackPanel> + <StackPanel + Grid.Row="1" + Margin="0,10,0,0" + Spacing="2"> + <TextBlock + FontSize="15" + FontWeight="Bold" + Text="{locale:Locale AboutRyujinxMaintainersTitle}" /> + <TextBlock + FontSize="10" + Text="{Binding Developers}" + TextWrapping="Wrap" /> + <Button + Padding="5" + HorizontalAlignment="Left" + Background="Transparent" + Click="Button_OnClick" + 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 + FontSize="15" + FontWeight="Bold" + Text="{locale:Locale AboutRyujinxSupprtersTitle}" /> + <ScrollViewer + Height="70" + HorizontalScrollBarVisibility="Disabled" + VerticalScrollBarVisibility="Visible"> + <TextBlock + Name="SupportersTextBlock" + VerticalAlignment="Top" + FontSize="10" + Text="{Binding Supporters}" + TextWrapping="Wrap" /> + </ScrollViewer> + </StackPanel> + </Grid> + </Grid> </UserControl>
\ No newline at end of file diff --git a/Ryujinx.Ava/UI/Windows/AboutWindow.axaml.cs b/Ryujinx.Ava/UI/Windows/AboutWindow.axaml.cs index 5dbbbcdd..36a28605 100644 --- a/Ryujinx.Ava/UI/Windows/AboutWindow.axaml.cs +++ b/Ryujinx.Ava/UI/Windows/AboutWindow.axaml.cs @@ -4,6 +4,7 @@ using Avalonia.Interactivity; using Avalonia.Styling; using FluentAvalonia.UI.Controls; using Ryujinx.Ava.Common.Locale; +using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ui.Common.Helper; using System.Threading.Tasks; @@ -22,14 +23,12 @@ namespace Ryujinx.Ava.UI.Windows public static async Task Show() { - var content = new AboutWindow(); - ContentDialog contentDialog = new() { - PrimaryButtonText = "", + PrimaryButtonText = "", SecondaryButtonText = "", - CloseButtonText = LocaleManager.Instance[LocaleKeys.UserProfilesClose], - Content = content + CloseButtonText = LocaleManager.Instance[LocaleKeys.UserProfilesClose], + Content = new AboutWindow() }; Style closeButton = new(x => x.Name("CloseButton")); @@ -41,7 +40,7 @@ namespace Ryujinx.Ava.UI.Windows contentDialog.Styles.Add(closeButton); contentDialog.Styles.Add(closeButtonParent); - await contentDialog.ShowAsync(); + await ContentDialogHelper.ShowAsync(contentDialog); } private void Button_OnClick(object sender, RoutedEventArgs e) |
