Browse Source

Mark the default button (one activated on enter) in all dialogs

Equbuxu 3 years ago
parent
commit
66dbd0929f

+ 2 - 2
PixiEditor/Views/Dialogs/ConfirmationPopup.xaml

@@ -31,7 +31,7 @@
         </DockPanel>
         <StackPanel Grid.Row="2" Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Center"
                     Margin="0,0,10,10">
-            <Button Margin="10,0,10,0" Height="30" Width="60"
+            <Button Margin="10,0,10,0" Height="30" Width="60" IsDefault="True"
                     Command="{Binding Path=DataContext.SetResultAndCloseCommand, ElementName=popup}"
                     Style="{StaticResource DarkRoundButton}" Content="Yes">
                 <Button.CommandParameter>
@@ -49,4 +49,4 @@
                     Command="{Binding DataContext.CancelCommand, ElementName=popup}" />
         </StackPanel>
     </Grid>
-</Window>
+</Window>

+ 1 - 1
PixiEditor/Views/Dialogs/ImportFilePopup.xaml

@@ -45,7 +45,7 @@
                                   ChosenHeight="{Binding ImportHeight,Mode=TwoWay}" />
             </StackPanel>
         </StackPanel>
-        <Button Grid.Row="1" Height="30" Width="60" VerticalAlignment="Bottom" HorizontalAlignment="Right"
+        <Button Grid.Row="1" Height="30" Width="60" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsDefault="True"
                     Margin="10" Style="{StaticResource DarkRoundButton}" Content="OK" Command="{Binding OkCommand}"
                     CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
     </Grid>

+ 1 - 1
PixiEditor/Views/Dialogs/NewFilePopup.xaml

@@ -47,7 +47,7 @@
         </StackPanel>
         <Button VerticalAlignment="Bottom" HorizontalAlignment="Right" FontSize="20" Height="30" Width="120"
                 Style="{StaticResource DarkRoundButton}" Content="Create" Margin="0,0,10,10" Grid.Row="1"
-                Command="{Binding OkCommand}"
+                Command="{Binding OkCommand}" IsDefault="True"
                 CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" 
                 x:Name="createButton"/>
     </Grid>

+ 1 - 1
PixiEditor/Views/Dialogs/NoticePopup.xaml

@@ -35,7 +35,7 @@
         </DockPanel>
         <StackPanel Grid.Row="2" Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Center"
                     Margin="0,0,10,10">
-            <Button Height="30" Width="60"
+            <Button Height="30" Width="60" IsDefault="True"
                     Click="OkButton_Close"
                     Style="{StaticResource DarkRoundButton}" Content="Ok">
             </Button>

+ 2 - 2
PixiEditor/Views/Dialogs/PopupTemplate.xaml

@@ -29,7 +29,7 @@
                     Command="{x:Static SystemCommands.CloseWindowCommand}" />
         </DockPanel>
         <Button Grid.Row="1" Height="30" Width="60" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="10"
-                Style="{StaticResource DarkRoundButton}" Content="OK" Command="{Binding OkCommand}"
+                Style="{StaticResource DarkRoundButton}" Content="OK" Command="{Binding OkCommand}" IsDefault="True"
                 CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
     </Grid>
-</Window>
+</Window>

+ 1 - 1
PixiEditor/Views/Dialogs/ResizeCanvasPopup.xaml

@@ -49,6 +49,6 @@
                                      Width="78" Margin="45,-25,0,0" Height="78" />
         </StackPanel>
         <Button Grid.Row="1" Height="30" Width="60" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="10"
-                Style="{StaticResource DarkRoundButton}" Content="OK" Click="Button_Click" />
+                Style="{StaticResource DarkRoundButton}" Content="OK" Click="Button_Click" IsDefault="True" />
     </Grid>
 </Window>

+ 1 - 1
PixiEditor/Views/Dialogs/ResizeDocumentPopup.xaml

@@ -43,6 +43,6 @@
                               ChosenWidth="{Binding Path=NewWidth, Mode=TwoWay, ElementName=window}" />
         </StackPanel>
         <Button Grid.Row="1" Height="30" Width="60" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="10"
-                Style="{StaticResource DarkRoundButton}" Content="OK" Click="Button_Click" />
+                Style="{StaticResource DarkRoundButton}" Content="OK" Click="Button_Click" IsDefault="True" />
     </Grid>
 </Window>

+ 1 - 1
PixiEditor/Views/Dialogs/SaveFilePopup.xaml

@@ -45,7 +45,7 @@
                         Background="{StaticResource MainColor}" BorderBrush="{Binding PathButtonBorder}"
                         Command="{Binding ChoosePathCommand}" />
         </StackPanel>
-        <Button Grid.Row="1" Height="30" Width="60" VerticalAlignment="Bottom" HorizontalAlignment="Right"
+        <Button Grid.Row="1" Height="30" Width="60" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsDefault="True"
                     Margin="10" Style="{StaticResource DarkRoundButton}" Content="OK" Command="{Binding OkCommand}"
                     CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
     </Grid>