浏览代码

Added eye checkbox and updated screenshot

flabbet 4 年之前
父节点
当前提交
694c662dd1

+ 1 - 0
PixiEditor/App.xaml

@@ -13,6 +13,7 @@
                 <ResourceDictionary Source="Styles/AnchorPointToggleButtonStyle.xaml" />
                 <ResourceDictionary Source="Styles/DockingManagerStyle.xaml" />
                 <ResourceDictionary Source="Styles/DarkScrollBarStyle.xaml" />
+                <ResourceDictionary Source="Styles/ImageCheckBoxStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
         </ResourceDictionary>
     </Application.Resources>

二进制
PixiEditor/Images/Eye-off.png


二进制
PixiEditor/Images/Eye.png


+ 4 - 0
PixiEditor/PixiEditor.csproj

@@ -28,6 +28,8 @@
 
   <ItemGroup>
     <None Remove="Images\AnchorDot.png" />
+    <None Remove="Images\Eye-off.png" />
+    <None Remove="Images\Eye.png" />
     <None Remove="Images\MoveImage.png" />
     <None Remove="Images\MoveViewportImage.png" />
     <None Remove="Images\PixiEditorLogo.png" />
@@ -61,6 +63,8 @@
     <Resource Include="Images\CircleImage.png" />
     <Resource Include="Images\EraserImage.png" />
     <Resource Include="Images\BrightnessImage.png" />
+    <Resource Include="Images\Eye-off.png" />
+    <Resource Include="Images\Eye.png" />
     <Resource Include="Images\LineImage.png" />
     <Resource Include="Images\MoveImage.png" />
     <Resource Include="Images\MoveViewportImage.png" />

+ 21 - 0
PixiEditor/Styles/ImageCheckBoxStyle.xaml

@@ -0,0 +1,21 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:local="clr-namespace:PixiEditor.Styles">
+    <Style TargetType="{x:Type CheckBox}" x:Key="ImageCheckBox">
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type CheckBox}">
+                    <StackPanel Orientation="Horizontal">
+                        <Image Cursor="Hand" x:Name="checkboxImage" Source="../Images/Eye-off.png" Width="36"/>
+                        <ContentPresenter/>
+                    </StackPanel>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="checkboxImage" Property="Source" Value="../Images/Eye.png"/>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+</ResourceDictionary>

+ 1 - 1
PixiEditor/Views/LayerItem.xaml

@@ -26,7 +26,7 @@
                 <ColumnDefinition Width="199*" />
                 <ColumnDefinition Width="35" />
             </Grid.ColumnDefinitions>
-            <CheckBox VerticalAlignment="Center"
+            <CheckBox Style="{StaticResource ImageCheckBox}" VerticalAlignment="Center"
                       IsThreeState="False" HorizontalAlignment="Center"
                       IsChecked="{Binding Path=IsVisible, Mode=TwoWay}" Grid.Column="0" Height="16" />
             <local:EditableTextBlock

二进制
Screenshot.png