mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-04 03:36:26 +02:00
misc: chore: [ci skip] Reduce duplicated close button & command space styling for dialogs
This commit is contained in:
parent
f7976753fd
commit
57c22a1f32
5 changed files with 26 additions and 44 deletions
|
@ -4,6 +4,7 @@ using Avalonia.Controls.ApplicationLifetimes;
|
|||
using Avalonia.Input;
|
||||
using Avalonia.Layout;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Styling;
|
||||
using Avalonia.Threading;
|
||||
using FluentAvalonia.Core;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
|
@ -21,6 +22,23 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
private static bool _isChoiceDialogOpen;
|
||||
private static ContentDialogOverlayWindow _contentDialogOverlayWindow;
|
||||
|
||||
public static ContentDialog ApplyStyles(
|
||||
this ContentDialog contentDialog,
|
||||
double closeButtonWidth = 80,
|
||||
HorizontalAlignment buttonSpaceAlignment = HorizontalAlignment.Right)
|
||||
{
|
||||
Style closeButton = new(x => x.Name("CloseButton"));
|
||||
closeButton.Setters.Add(new Setter(Layoutable.WidthProperty, closeButtonWidth));
|
||||
|
||||
Style closeButtonParent = new(x => x.Name("CommandSpace"));
|
||||
closeButtonParent.Setters.Add(new Setter(Layoutable.HorizontalAlignmentProperty, buttonSpaceAlignment));
|
||||
|
||||
contentDialog.Styles.Add(closeButton);
|
||||
contentDialog.Styles.Add(closeButtonParent);
|
||||
|
||||
return contentDialog;
|
||||
}
|
||||
|
||||
private async static Task<UserResult> ShowContentDialog(
|
||||
string title,
|
||||
object content,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue