|
@@ -3,38 +3,68 @@
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
- xmlns:local="clr-namespace:PixiEditor.Views" xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
|
|
|
|
|
|
+ xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
|
|
|
+ xmlns:local="clr-namespace:PixiEditor.Views" xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters" xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours"
|
|
mc:Ignorable="d"
|
|
mc:Ignorable="d"
|
|
- Width="270" Height="120" Name="uc">
|
|
|
|
|
|
+ Width="270" Height="320" Name="uc">
|
|
<UserControl.Resources>
|
|
<UserControl.Resources>
|
|
<converters:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
|
|
<converters:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
|
|
|
|
+ <converters:NotifyableColorToHexConverter x:Key="NotifyableColorToHexConverter"/>
|
|
</UserControl.Resources>
|
|
</UserControl.Resources>
|
|
- <Grid Background="{StaticResource AccentColor}" MouseMove="Image_MouseMove">
|
|
|
|
|
|
+ <Grid Background="{StaticResource AccentColor}">
|
|
<Grid.RowDefinitions>
|
|
<Grid.RowDefinitions>
|
|
|
|
+ <RowDefinition Height="100*"/>
|
|
<RowDefinition Height="53"/>
|
|
<RowDefinition Height="53"/>
|
|
- <RowDefinition Height="8*"/>
|
|
|
|
- <RowDefinition Height="17*"/>
|
|
|
|
|
|
+ <RowDefinition Height="129*"/>
|
|
|
|
+ <RowDefinition Height="38*"/>
|
|
</Grid.RowDefinitions>
|
|
</Grid.RowDefinitions>
|
|
- <Image Source="/Images/ColorPalette.png" Name="colorPalette" MouseDown="Image_MouseMove" Stretch="Fill" VerticalAlignment="Center" Height="50"/>
|
|
|
|
- <StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
|
|
|
|
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
|
|
|
|
+ <Grid HorizontalAlignment="Left" Margin="20,0,0,0" Width="70" Height="70">
|
|
|
|
+ <Button Opacity="0.3" ToolTip="Swap colors (X)" Click="Button_Click" Width="25" Height="25" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="0 0 0 3" Style="{StaticResource ImageButtonStyle}">
|
|
|
|
+ <Button.Background>
|
|
|
|
+ <ImageBrush ImageSource="/Images/SwapArrows.png" Stretch="Fill"/>
|
|
|
|
+ </Button.Background>
|
|
|
|
+ </Button>
|
|
|
|
+ <Grid Height="40" Width="40" HorizontalAlignment="Right" VerticalAlignment="Bottom">
|
|
|
|
+ <Rectangle Stroke="Black" StrokeThickness="1" Panel.ZIndex="1">
|
|
|
|
+ <Rectangle.Fill>
|
|
|
|
+ <SolidColorBrush Color="{Binding SecondaryColor, ElementName=uc}"/>
|
|
|
|
+ </Rectangle.Fill>
|
|
|
|
+ </Rectangle>
|
|
|
|
+ <Image Source="/Images/transparentbg.png" Panel.ZIndex="0" Stretch="None"/>
|
|
|
|
+ </Grid>
|
|
|
|
+ <Grid Height="40" Width="40" HorizontalAlignment="Left" VerticalAlignment="Top">
|
|
|
|
+ <Rectangle Stroke="Black" StrokeThickness="1" Panel.ZIndex="3">
|
|
|
|
+ <Rectangle.Fill>
|
|
|
|
+ <SolidColorBrush Color="{Binding Path=SelectedColor.Color, ElementName=uc}"/>
|
|
|
|
+ </Rectangle.Fill>
|
|
|
|
+ </Rectangle>
|
|
|
|
+ <Image Source="/Images/transparentbg.png" Panel.ZIndex="2" Stretch="None"/>
|
|
|
|
+ </Grid>
|
|
|
|
+ </Grid>
|
|
|
|
+ <Image Grid.Row="1" Source="/Images/ColorPalette.png" Name="colorPalette" MouseUp="colorPalette_MouseUp" MouseDown="colorPalette_MouseDown" Stretch="Fill" VerticalAlignment="Center" Height="50"/>
|
|
|
|
+ <StackPanel Grid.Row="2" Orientation="Vertical" Margin="0,10,0,10" HorizontalAlignment="Center" Width="232">
|
|
|
|
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,10">
|
|
<TextBlock Text="R" Foreground="White" Padding="5,0,5,0"/>
|
|
<TextBlock Text="R" Foreground="White" Padding="5,0,5,0"/>
|
|
- <TextBox Style="{StaticResource DarkTextBoxStyle}" Width="40" Text="{Binding Path=SelectedColor.R, Mode=TwoWay, ElementName=uc}"/>
|
|
|
|
|
|
+ <Slider Width="170" Minimum="0" Maximum="255" IsMoveToPointEnabled="True" TickFrequency="1" IsSnapToTickEnabled="True" SmallChange="1" LargeChange="10" Value="{Binding Path=SelectedColor.R, Mode=TwoWay, ElementName=uc}"/>
|
|
|
|
+ <local:NumberInput Min="0" Max="255" Margin="5,0,0,0" Width="40" Value="{Binding Path=SelectedColor.R, Mode=TwoWay, ElementName=uc}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
|
|
- <TextBlock Text="G" Foreground="White" Padding="5,0,5,0"/>
|
|
|
|
- <TextBox Style="{StaticResource DarkTextBoxStyle}" Width="50" Text="{Binding Path=SelectedColor.G, ElementName=uc}"/>
|
|
|
|
|
|
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,10">
|
|
|
|
+ <TextBlock Text="G" Foreground="White" Padding="4,0,5,0"/>
|
|
|
|
+ <Slider Width="170" Minimum="0" Maximum="255" IsMoveToPointEnabled="True" TickFrequency="1" IsSnapToTickEnabled="True" SmallChange="1" LargeChange="10" Value="{Binding Path=SelectedColor.G, Mode=TwoWay, ElementName=uc}"/>
|
|
|
|
+ <local:NumberInput Min="0" Max="255" Margin="5,0,0,0" Width="40" Value="{Binding Path=SelectedColor.G, Mode=TwoWay, ElementName=uc}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
|
|
|
|
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,10">
|
|
<TextBlock Text="B" Foreground="White" Padding="5,0,5,0"/>
|
|
<TextBlock Text="B" Foreground="White" Padding="5,0,5,0"/>
|
|
- <TextBox Style="{StaticResource DarkTextBoxStyle}" Width="50" Text="{Binding Path=SelectedColor.B, ElementName=uc}"/>
|
|
|
|
|
|
+ <Slider Width="170" Minimum="0" Maximum="255" IsMoveToPointEnabled="True" TickFrequency="1" IsSnapToTickEnabled="True" SmallChange="1" LargeChange="10" Value="{Binding Path=SelectedColor.B, Mode=TwoWay, ElementName=uc}"/>
|
|
|
|
+ <local:NumberInput Min="0" Max="255" Margin="5,0,0,0" Width="40" Value="{Binding Path=SelectedColor.B, Mode=TwoWay, ElementName=uc}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
|
|
- <TextBlock Text="A" Foreground="White" Padding="5,0,5,0"/>
|
|
|
|
- <TextBox Style="{StaticResource DarkTextBoxStyle}" Width="50" Text="{Binding Path=SelectedColor.A, ElementName=uc}"/>
|
|
|
|
|
|
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,10">
|
|
|
|
+ <TextBlock Text="A" Foreground="White" Padding="4,0,5,0"/>
|
|
|
|
+ <Slider Width="170" Minimum="0" Maximum="255" IsMoveToPointEnabled="True" TickFrequency="1" IsSnapToTickEnabled="True" SmallChange="1" LargeChange="10" Value="{Binding Path=SelectedColor.A, Mode=TwoWay, ElementName=uc}"/>
|
|
|
|
+ <local:NumberInput Min="0" Max="255" Margin="5,0,0,0" Width="40" Value="{Binding Path=SelectedColor.A, Mode=TwoWay, ElementName=uc}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
- <Grid Grid.Row="2">
|
|
|
|
|
|
+ <Grid Grid.Row="3">
|
|
<Grid.ColumnDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="39*"/>
|
|
<ColumnDefinition Width="39*"/>
|
|
<ColumnDefinition Width="28*"/>
|
|
<ColumnDefinition Width="28*"/>
|
|
@@ -42,9 +72,12 @@
|
|
</Grid.ColumnDefinitions>
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel Orientation="Horizontal" Grid.Column="0" VerticalAlignment="Center" Margin="10,0,0,0" Height="26">
|
|
<StackPanel Orientation="Horizontal" Grid.Column="0" VerticalAlignment="Center" Margin="10,0,0,0" Height="26">
|
|
<Label Content="Hex" Foreground="White"/>
|
|
<Label Content="Hex" Foreground="White"/>
|
|
- <TextBox VerticalAlignment="Center" Style="{StaticResource DarkTextBoxStyle}" Width="65" Text="{Binding Path=SelectedColor, ElementName=uc}"/>
|
|
|
|
|
|
+ <TextBox VerticalAlignment="Center" Style="{StaticResource DarkTextBoxStyle}" Width="65" Text="{Binding Path=SelectedColor,Converter={StaticResource NotifyableColorToHexConverter}, ElementName=uc}">
|
|
|
|
+ <i:Interaction.Behaviors>
|
|
|
|
+ <behaviours:TextBoxFocusBehavior/>
|
|
|
|
+ </i:Interaction.Behaviors>
|
|
|
|
+ </TextBox>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
- <Rectangle Fill="{Binding Path=SelectedColor, ElementName=uc, Converter={StaticResource ColorToBrushConverter}}" Stroke="#FF3C3C3C" StrokeThickness="2" Grid.Column="2"/>
|
|
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|
|
</UserControl>
|