mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-24 00:25:50 +00:00
9e2681f2d7
* 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>
63 lines
No EOL
1.8 KiB
C#
63 lines
No EOL
1.8 KiB
C#
using Avalonia.Controls;
|
|
using Avalonia.Input;
|
|
using Avalonia.Interactivity;
|
|
using Avalonia.Styling;
|
|
using FluentAvalonia.UI.Controls;
|
|
using Ryujinx.Ava.Common.Locale;
|
|
using Ryujinx.Ava.UI.ViewModels;
|
|
using Ryujinx.Ui.Common.Helper;
|
|
using System.Threading.Tasks;
|
|
using Button = Avalonia.Controls.Button;
|
|
|
|
namespace Ryujinx.Ava.UI.Windows
|
|
{
|
|
public partial class AboutWindow : UserControl
|
|
{
|
|
public AboutWindow()
|
|
{
|
|
DataContext = new AboutWindowViewModel();
|
|
|
|
InitializeComponent();
|
|
}
|
|
|
|
public static async Task Show()
|
|
{
|
|
var content = new AboutWindow();
|
|
|
|
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)
|
|
{
|
|
if (sender is Button button)
|
|
{
|
|
OpenHelper.OpenUrl(button.Tag.ToString());
|
|
}
|
|
}
|
|
|
|
private void AmiiboLabel_OnPointerPressed(object sender, PointerPressedEventArgs e)
|
|
{
|
|
if (sender is TextBlock)
|
|
{
|
|
OpenHelper.OpenUrl("https://amiiboapi.com");
|
|
}
|
|
}
|
|
}
|
|
} |