From 85b223a3d058d84a868e96963a56fecd8c1f20ac Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 16 May 2025 02:27:42 +0100 Subject: [PATCH] Task/UI usability tweaks (#1314) * Allow About to center in parent * About closes on Escape * ConfirmEmptyCommit dialog closes on Escape * Ignore Dev file * Missed condition --------- Co-authored-by: Martin Smith --- .gitignore | 1 + src/App.axaml.cs | 9 +++++++-- src/Views/About.axaml | 7 ++++++- src/Views/ConfirmEmptyCommit.axaml | 2 ++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 498c7e32..e686a534 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ build/*.rpm build/*.AppImage SourceGit.app/ build.command +src/Properties/launchSettings.json diff --git a/src/App.axaml.cs b/src/App.axaml.cs index 6e45164d..ec0f79c9 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -109,8 +109,13 @@ namespace SourceGit { if (data is Views.ChromelessWindow window) { - if (showAsDialog && Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime { MainWindow: { } owner }) - window.ShowDialog(owner); + if (Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime { MainWindow: { } owner }) + { + if (showAsDialog) + window.ShowDialog(owner); + else + window.Show(owner); + } else window.Show(); diff --git a/src/Views/About.axaml b/src/Views/About.axaml index d0dd7b82..bcc133e4 100644 --- a/src/Views/About.axaml +++ b/src/Views/About.axaml @@ -10,7 +10,7 @@ Title="{DynamicResource Text.About}" Width="520" Height="230" CanResize="False" - WindowStartupLocation="CenterScreen"> + WindowStartupLocation="CenterOwner"> @@ -67,4 +67,9 @@ + + + + + diff --git a/src/Views/ConfirmEmptyCommit.axaml b/src/Views/ConfirmEmptyCommit.axaml index 32a1f2cd..bfa42ef0 100644 --- a/src/Views/ConfirmEmptyCommit.axaml +++ b/src/Views/ConfirmEmptyCommit.axaml @@ -12,6 +12,7 @@ Title="{DynamicResource Text.Warn}" SizeToContent="WidthAndHeight" CanResize="False" + ShowInTaskbar="False" WindowStartupLocation="CenterOwner"> @@ -64,6 +65,7 @@ Height="30" Margin="4,0" Click="CloseWindow" + IsCancel="True" Content="{DynamicResource Text.Cancel}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>