Equbuxu před 3 roky
rodič
revize
993068f35f

+ 43 - 10
src/PixiEditor/Views/UserControls/Layers/LayerControl.xaml

@@ -11,9 +11,10 @@
              xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
              xmlns:helpers="clr-namespace:PixiEditor.Helpers.UI"
              xmlns:cmds="clr-namespace:PixiEditor.Models.Commands.XAML"
+             xmlns:sys="clr-namespace:System;assembly=mscorlib"
              mc:Ignorable="d" 
              Focusable="True"
-             d:DesignHeight="60" d:DesignWidth="250" Name="uc"
+             d:DesignHeight="35" d:DesignWidth="250" Name="uc"
              MouseLeave="LayerItem_OnMouseLeave" MouseEnter="LayerItem_OnMouseEnter">
     <Border BorderThickness="0 0 0 0.5" BorderBrush="Gray" MinWidth="60" Focusable="True">
         <Border.Background>
@@ -38,7 +39,7 @@
             <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.ColumnDefinitions>
-                    <ColumnDefinition Width="30"/>
+                    <ColumnDefinition Width="22"/>
                     <ColumnDefinition Width="*"/>
                 </Grid.ColumnDefinitions>
                 <CheckBox Style="{StaticResource ImageCheckBox}" VerticalAlignment="Center"
@@ -47,17 +48,49 @@
                       Grid.Column="0" Height="16" />
                 <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"/>
-                    <Border Width="30" Height="30" BorderThickness="1" BorderBrush="Black" Background="{StaticResource MainColor}"
-                           Margin="5, 0, 10, 0">
+                    <Border Width="30" Height="30" BorderThickness="1" BorderBrush="Black" Background="{StaticResource MainColor}">
                         <Image Source="{Binding Layer.PreviewBitmap,ElementName=uc}" Stretch="Uniform" Width="20" Height="20"
                        RenderOptions.BitmapScalingMode="NearestNeighbor"/>
                     </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" BorderBrush="Black" Background="{StaticResource MainColor}"
+                            Visibility="{Binding Layer.MaskIsVisibleBindable, ElementName=uc, Converter={conv:BoolToVisibilityConverter}}">
+                        <Grid>
+                            <Image Source="{Binding Layer.MaskPreviewBitmap,ElementName=uc}" Stretch="Uniform" Width="20" Height="20"
+                           RenderOptions.BitmapScalingMode="NearestNeighbor"/>
+                            <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,0,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>
                 <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}"/>