Skip to content

Commit 85b223a

Browse files
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 <martin.smith@purplebricks.com>
1 parent 6c62789 commit 85b223a

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ build/*.rpm
3838
build/*.AppImage
3939
SourceGit.app/
4040
build.command
41+
src/Properties/launchSettings.json

src/App.axaml.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,13 @@ public static void ShowWindow(object data, bool showAsDialog)
109109
{
110110
if (data is Views.ChromelessWindow window)
111111
{
112-
if (showAsDialog && Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime { MainWindow: { } owner })
113-
window.ShowDialog(owner);
112+
if (Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime { MainWindow: { } owner })
113+
{
114+
if (showAsDialog)
115+
window.ShowDialog(owner);
116+
else
117+
window.Show(owner);
118+
}
114119
else
115120
window.Show();
116121

src/Views/About.axaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Title="{DynamicResource Text.About}"
1111
Width="520" Height="230"
1212
CanResize="False"
13-
WindowStartupLocation="CenterScreen">
13+
WindowStartupLocation="CenterOwner">
1414
<Grid RowDefinitions="Auto,*">
1515
<!-- TitleBar -->
1616
<Grid Grid.Row="0" Height="28" IsVisible="{Binding !#ThisControl.UseSystemWindowFrame}">
@@ -67,4 +67,9 @@
6767
</StackPanel>
6868
</Grid>
6969
</Grid>
70+
71+
<Window.KeyBindings>
72+
<KeyBinding Gesture="Escape" Command="{Binding #ThisControl.Close}"/>
73+
</Window.KeyBindings>
74+
7075
</v:ChromelessWindow>

src/Views/ConfirmEmptyCommit.axaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
Title="{DynamicResource Text.Warn}"
1313
SizeToContent="WidthAndHeight"
1414
CanResize="False"
15+
ShowInTaskbar="False"
1516
WindowStartupLocation="CenterOwner">
1617
<Grid RowDefinitions="Auto,Auto,Auto">
1718
<!-- TitleBar -->
@@ -64,6 +65,7 @@
6465
Height="30"
6566
Margin="4,0"
6667
Click="CloseWindow"
68+
IsCancel="True"
6769
Content="{DynamicResource Text.Cancel}"
6870
HorizontalContentAlignment="Center"
6971
VerticalContentAlignment="Center"/>

0 commit comments

Comments
 (0)