Browse Source

Added undo/redo buttons next to the tool settings

CPKreuz 4 years ago
parent
commit
2b27c83df6
2 changed files with 25 additions and 2 deletions
  1. 19 0
      PixiEditor/Styles/ThemeStyle.xaml
  2. 6 2
      PixiEditor/Views/MainWindow.xaml

+ 19 - 0
PixiEditor/Styles/ThemeStyle.xaml

@@ -120,6 +120,25 @@
         </Setter>
     </Style>
 
+    <Style TargetType="Button" x:Key="ToolSettingsGlyphButton"
+           BasedOn="{StaticResource BaseDarkButton}">
+        <Setter Property="TextBlock.FontFamily" Value="Segoe MDL2 Assets"/>
+        <Setter Property="TextBlock.FontSize" Value="15"/>
+        <Setter Property="TextBlock.Width" Value="50"/>
+
+        <Style.Triggers>
+            <Trigger Property="IsEnabled" Value="True">
+                <Setter Property="Background" Value="Transparent" />
+                <Setter Property="Foreground" Value="White" />
+            </Trigger>
+            <Trigger Property="IsMouseOver" Value="True">
+                <Setter Property="Background" Value="#FF515151" />
+                <Setter Property="Foreground" Value="White" />
+                <Setter Property="Cursor" Value="Hand" />
+            </Trigger>
+        </Style.Triggers>
+    </Style>
+    
 
     <Style TargetType="TextBox" x:Key="DarkTextBoxStyle">
         <Setter Property="Background" Value="#202020" />

+ 6 - 2
PixiEditor/Views/MainWindow.xaml

@@ -175,8 +175,12 @@
         </DockPanel>
         <StackPanel Background="{StaticResource MainColor}" Orientation="Horizontal" Grid.ColumnSpan="3" Grid.Column="0"
                      Grid.Row="1">
-            <Label Style="{StaticResource BaseLabel}" Margin="10,0,0,0" FontSize="12" VerticalAlignment="Center" Content="{Binding BitmapManager.SelectedTool.ToolName}"/>
-            <Label Style="{StaticResource BaseLabel}" Padding="0" FontSize="12" VerticalAlignment="Center" Content="tool"/>
+            <Button Command="{Binding UndoSubViewModel.UndoCommand}" Style="{StaticResource ToolSettingsGlyphButton}" Content="&#xE7A7;"/>
+            <Button Command="{Binding UndoSubViewModel.RedoCommand}" Style="{StaticResource ToolSettingsGlyphButton}" Content="&#xE7A6;"/>
+            <Grid Margin="5,5,10,5" Background="{StaticResource BrighterAccentColor}" Width="5"/>
+            <Label Style="{StaticResource BaseLabel}" FontSize="12"
+                   VerticalAlignment="Center" Content="{Binding BitmapManager.SelectedTool.ToolName}"
+                   ToolTip="{Binding BitmapManager.SelectedTool.ActionDisplay}"/>
             <ItemsControl ItemsSource="{Binding BitmapManager.SelectedTool.Toolbar.Settings}">
                 <ItemsControl.ItemsPanel>
                     <ItemsPanelTemplate>