|
@@ -11,10 +11,15 @@
|
|
xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
|
|
xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
|
|
xmlns:helpers="clr-namespace:PixiEditor.Helpers.UI"
|
|
xmlns:helpers="clr-namespace:PixiEditor.Helpers.UI"
|
|
xmlns:cmds="clr-namespace:PixiEditor.Models.Commands.XAML"
|
|
xmlns:cmds="clr-namespace:PixiEditor.Models.Commands.XAML"
|
|
|
|
+ xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
mc:Ignorable="d"
|
|
mc:Ignorable="d"
|
|
Focusable="True"
|
|
Focusable="True"
|
|
- d:DesignHeight="60" d:DesignWidth="250" Name="uc"
|
|
|
|
|
|
+ d:DesignHeight="35" d:DesignWidth="250" Name="uc"
|
|
MouseLeave="LayerItem_OnMouseLeave" MouseEnter="LayerItem_OnMouseEnter">
|
|
MouseLeave="LayerItem_OnMouseLeave" MouseEnter="LayerItem_OnMouseEnter">
|
|
|
|
+ <UserControl.Resources>
|
|
|
|
+ <conv:BoolToBrushConverter x:Key="LayerBorderConverter" FalseBrush="White" TrueBrush="Black"/>
|
|
|
|
+ <conv:BoolToBrushConverter x:Key="MaskBorderConverter" FalseBrush="Black" TrueBrush="White"/>
|
|
|
|
+ </UserControl.Resources>
|
|
<Border BorderThickness="0 0 0 0.5" BorderBrush="Gray" MinWidth="60" Focusable="True">
|
|
<Border BorderThickness="0 0 0 0.5" BorderBrush="Gray" MinWidth="60" Focusable="True">
|
|
<Border.Background>
|
|
<Border.Background>
|
|
<Binding ElementName="uc" Path="Layer.Selection">
|
|
<Binding ElementName="uc" Path="Layer.Selection">
|
|
@@ -38,7 +43,7 @@
|
|
<Grid AllowDrop="True" DragEnter="Grid_DragEnter" Drop="Grid_Drop_Top" DragLeave="Grid_DragLeave" Grid.Row="0" Grid.ColumnSpan="3" Background="Transparent"/>
|
|
<Grid AllowDrop="True" DragEnter="Grid_DragEnter" Drop="Grid_Drop_Top" DragLeave="Grid_DragLeave" Grid.Row="0" Grid.ColumnSpan="3" Background="Transparent"/>
|
|
<Grid Grid.Row="1" Grid.RowSpan="3" Margin="0,-10,0,0" VerticalAlignment="Center" AllowDrop="False">
|
|
<Grid Grid.Row="1" Grid.RowSpan="3" Margin="0,-10,0,0" VerticalAlignment="Center" AllowDrop="False">
|
|
<Grid.ColumnDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
- <ColumnDefinition Width="30"/>
|
|
|
|
|
|
+ <ColumnDefinition Width="24"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
</Grid.ColumnDefinitions>
|
|
<CheckBox Style="{StaticResource ImageCheckBox}" VerticalAlignment="Center"
|
|
<CheckBox Style="{StaticResource ImageCheckBox}" VerticalAlignment="Center"
|
|
@@ -47,17 +52,69 @@
|
|
Grid.Column="0" Height="16" />
|
|
Grid.Column="0" Height="16" />
|
|
<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Left">
|
|
<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Left">
|
|
<Rectangle Width="{Binding Path=(helpers:TreeViewItemHelper.Indent).Value, Mode=OneWay, RelativeSource={RelativeSource AncestorType=ItemsPresenter}}" Fill="Transparent" StrokeThickness="0"/>
|
|
<Rectangle Width="{Binding Path=(helpers:TreeViewItemHelper.Indent).Value, Mode=OneWay, RelativeSource={RelativeSource AncestorType=ItemsPresenter}}" Fill="Transparent" StrokeThickness="0"/>
|
|
- <Border Width="30" Height="30" BorderThickness="1" BorderBrush="Black" Background="{StaticResource MainColor}"
|
|
|
|
- Margin="5, 0, 10, 0">
|
|
|
|
|
|
+ <Border
|
|
|
|
+ Width="30" Height="30"
|
|
|
|
+ BorderThickness="1"
|
|
|
|
+ Background="{StaticResource MainColor}"
|
|
|
|
+ MouseDown="LayerMouseDown">
|
|
|
|
+ <Border.BorderBrush>
|
|
|
|
+ <MultiBinding Converter="{StaticResource LayerBorderConverter}">
|
|
|
|
+ <Binding ElementName="uc" Path="Layer.ShouldDrawOnMask"/>
|
|
|
|
+ <Binding ElementName="uc" Path="Layer.HasMaskBindable"/>
|
|
|
|
+ </MultiBinding>
|
|
|
|
+ </Border.BorderBrush>
|
|
<Image Source="{Binding Layer.PreviewBitmap,ElementName=uc}" Stretch="Uniform" Width="20" Height="20"
|
|
<Image Source="{Binding Layer.PreviewBitmap,ElementName=uc}" Stretch="Uniform" Width="20" Height="20"
|
|
- RenderOptions.BitmapScalingMode="NearestNeighbor"/>
|
|
|
|
|
|
+ RenderOptions.BitmapScalingMode="NearestNeighbor" IsHitTestVisible="False"/>
|
|
</Border>
|
|
</Border>
|
|
-
|
|
|
|
- <controls:EditableTextBlock
|
|
|
|
- x:Name="editableTextBlock"
|
|
|
|
- FontSize="15"
|
|
|
|
- VerticalAlignment="Center"
|
|
|
|
- Text="{Binding Layer.NameBindable, ElementName=uc, Mode=TwoWay}" />
|
|
|
|
|
|
+ <Border
|
|
|
|
+ Width="30" Height="30"
|
|
|
|
+ BorderThickness="1"
|
|
|
|
+ Background="{StaticResource MainColor}"
|
|
|
|
+ Margin="3,0,0,0"
|
|
|
|
+ Visibility="{Binding Layer.HasMaskBindable, ElementName=uc, Converter={conv:BoolToVisibilityConverter}}"
|
|
|
|
+ MouseDown="MaskMouseDown">
|
|
|
|
+ <Border.BorderBrush>
|
|
|
|
+ <MultiBinding Converter="{StaticResource MaskBorderConverter}">
|
|
|
|
+ <Binding ElementName="uc" Path="Layer.ShouldDrawOnMask"/>
|
|
|
|
+ </MultiBinding>
|
|
|
|
+ </Border.BorderBrush>
|
|
|
|
+ <Grid IsHitTestVisible="False">
|
|
|
|
+ <Image Source="{Binding Layer.MaskPreviewBitmap,ElementName=uc}" Stretch="Uniform" Width="20" Height="20"
|
|
|
|
+ RenderOptions.BitmapScalingMode="NearestNeighbor" IsHitTestVisible="False"/>
|
|
|
|
+ <Path
|
|
|
|
+ Data="M 2 0 L 10 8 L 18 0 L 20 2 L 12 10 L 20 18 L 18 20 L 10 12 L 2 20 L 0 18 L 8 10 L 0 2 Z"
|
|
|
|
+ Fill="{StaticResource PixiRed}" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
|
|
+ Visibility="{Binding Layer.MaskIsVisibleBindable, ElementName=uc, Converter={InverseBoolToVisibilityConverter}}"/>
|
|
|
|
+ </Grid>
|
|
|
|
+ </Border>
|
|
|
|
+ <StackPanel Margin="3,0,5,0">
|
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
|
+ <TextBlock d:Text="100" Foreground="White">
|
|
|
|
+ <TextBlock.Text>
|
|
|
|
+ <Binding ElementName="uc" Path="Layer.OpacityBindable" Converter="{conv:MultiplyConverter}" StringFormat="N0">
|
|
|
|
+ <Binding.ConverterParameter>
|
|
|
|
+ <sys:Double>100.0</sys:Double>
|
|
|
|
+ </Binding.ConverterParameter>
|
|
|
|
+ </Binding>
|
|
|
|
+ </TextBlock.Text>
|
|
|
|
+ </TextBlock>
|
|
|
|
+ <TextBlock Foreground="White">%</TextBlock>
|
|
|
|
+ <TextBlock
|
|
|
|
+ Margin="5,0,0,0"
|
|
|
|
+ d:Text="Normal"
|
|
|
|
+ Foreground="White"
|
|
|
|
+ Text="{Binding Layer.BlendModeBindable, ElementName=uc, Converter={conv:BlendModeToStringConverter}}"/>
|
|
|
|
+ </StackPanel>
|
|
|
|
+ <controls:EditableTextBlock
|
|
|
|
+ x:Name="editableTextBlock"
|
|
|
|
+ FontSize="12"
|
|
|
|
+ VerticalAlignment="Center"
|
|
|
|
+ d:Text="New Layer"
|
|
|
|
+ Text="{Binding Layer.NameBindable, ElementName=uc, Mode=TwoWay}" />
|
|
|
|
+ </StackPanel>
|
|
|
|
+ <WrapPanel Orientation="Vertical">
|
|
|
|
+
|
|
|
|
+ </WrapPanel>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<Grid Margin="0, 0, 0, -2.5" DragEnter="Grid_DragEnter" VerticalAlignment="Bottom" Height="10" Drop="Grid_Drop_Below" DragLeave="Grid_DragLeave" Grid.Row="2" Grid.Column="0" AllowDrop="True" Background="Transparent" Name="dropBelowGrid"/>
|
|
<Grid Margin="0, 0, 0, -2.5" DragEnter="Grid_DragEnter" VerticalAlignment="Bottom" Height="10" Drop="Grid_Drop_Below" DragLeave="Grid_DragLeave" Grid.Row="2" Grid.Column="0" AllowDrop="True" Background="Transparent" Name="dropBelowGrid"/>
|
|
<Grid Margin="0, 0, 0, -2.5" VerticalAlignment="Bottom" Height="10" Grid.Row="2" Grid.Column="1" Background="{Binding ElementName=dropBelowGrid, Path=Background}"/>
|
|
<Grid Margin="0, 0, 0, -2.5" VerticalAlignment="Bottom" Height="10" Grid.Row="2" Grid.Column="1" Background="{Binding ElementName=dropBelowGrid, Path=Background}"/>
|
|
@@ -73,6 +130,11 @@
|
|
<MenuItem Header="Move upwards" Command="{cmds:Command PixiEditor.Layer.MoveSelectedMemberUpwards}"/>
|
|
<MenuItem Header="Move upwards" Command="{cmds:Command PixiEditor.Layer.MoveSelectedMemberUpwards}"/>
|
|
<MenuItem Header="Move downwards" Command="{cmds:Command PixiEditor.Layer.MoveSelectedMemberDownwards}"/>
|
|
<MenuItem Header="Move downwards" Command="{cmds:Command PixiEditor.Layer.MoveSelectedMemberDownwards}"/>
|
|
<Separator/>
|
|
<Separator/>
|
|
|
|
+ <MenuItem Header="Create mask" Command="{cmds:Command PixiEditor.Layer.CreateMask}"/>
|
|
|
|
+ <MenuItem Header="Delete mask" Command="{cmds:Command PixiEditor.Layer.DeleteMask}"/>
|
|
|
|
+ <MenuItem Header="Enable mask" Command="{cmds:Command PixiEditor.Layer.EnableMask}"/>
|
|
|
|
+ <MenuItem Header="Disable mask" Command="{cmds:Command PixiEditor.Layer.DisableMask}"/>
|
|
|
|
+ <Separator/>
|
|
<MenuItem Header="Merge selected" Command="{cmds:Command PixiEditor.Layer.MergeSelected}"/>
|
|
<MenuItem Header="Merge selected" Command="{cmds:Command PixiEditor.Layer.MergeSelected}"/>
|
|
<MenuItem Header="Merge with above" Command="{cmds:Command PixiEditor.Layer.MergeWithAbove}"/>
|
|
<MenuItem Header="Merge with above" Command="{cmds:Command PixiEditor.Layer.MergeWithAbove}"/>
|
|
<MenuItem Header="Merge with below" Command="{cmds:Command PixiEditor.Layer.MergeWithBelow}"/>
|
|
<MenuItem Header="Merge with below" Command="{cmds:Command PixiEditor.Layer.MergeWithBelow}"/>
|