misc: chore: [ci skip] Reduce duplicated close button & command space styling for dialogs

This commit is contained in:
Evan Husted 2025-03-04 02:56:59 -06:00
parent f7976753fd
commit 57c22a1f32
5 changed files with 26 additions and 44 deletions

View file

@ -1,6 +1,7 @@
using Avalonia.Controls;
using Avalonia.Input.Platform;
using Avalonia.Interactivity;
using Avalonia.Layout;
using Avalonia.Styling;
using FluentAvalonia.UI.Controls;
using Ryujinx.Ava.Common.Locale;
@ -29,17 +30,7 @@ namespace Ryujinx.Ava.UI.Views.Misc
Content = new ApplicationDataView { ViewModel = new ApplicationDataViewModel(appData) }
};
Style closeButton = new(x => x.Name("CloseButton"));
closeButton.Setters.Add(new Setter(WidthProperty, 160d));
Style closeButtonParent = new(x => x.Name("CommandSpace"));
closeButtonParent.Setters.Add(new Setter(HorizontalAlignmentProperty,
Avalonia.Layout.HorizontalAlignment.Center));
contentDialog.Styles.Add(closeButton);
contentDialog.Styles.Add(closeButtonParent);
await ContentDialogHelper.ShowAsync(contentDialog);
await ContentDialogHelper.ShowAsync(contentDialog.ApplyStyles(160, HorizontalAlignment.Center));
}
public ApplicationDataView()

View file

@ -32,17 +32,7 @@ namespace Ryujinx.Ava.UI.Views.Misc
Content = new DlcSelectView { ViewModel = viewModel }
};
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);
await ContentDialogHelper.ShowAsync(contentDialog.ApplyStyles());
return viewModel.SelectedDlc;
}