Browse Source

Lospec wip

flabbet 3 years ago
parent
commit
3a41a3c536

+ 12 - 0
PixiEditor/Views/UserControls/Lospec/LospecPaletteBrowser.xaml

@@ -0,0 +1,12 @@
+<UserControl x:Class="PixiEditor.Views.UserControls.Lospec.LospecPaletteBrowser"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:PixiEditor.Views.UserControls"
+             mc:Ignorable="d" 
+             d:DesignHeight="400" d:DesignWidth="250">
+    <Grid>
+            
+    </Grid>
+</UserControl>

+ 28 - 0
PixiEditor/Views/UserControls/Lospec/LospecPaletteBrowser.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PixiEditor.Views.UserControls
+{
+    /// <summary>
+    /// Interaction logic for LospecPaletteBrowser.xaml
+    /// </summary>
+    public partial class LospecPaletteBrowser : UserControl
+    {
+        public LospecPaletteBrowser()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 35 - 0
PixiEditor/Views/UserControls/Lospec/LospecPaletteItem.xaml

@@ -0,0 +1,35 @@
+<UserControl x:Class="PixiEditor.Views.UserControls.Lospec.LospecPaletteItem"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:PixiEditor.Views.UserControls.Lospec"
+             mc:Ignorable="d" 
+             d:DesignHeight="100" d:DesignWidth="250" Name="paletteItem">
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="4*"/>
+            <ColumnDefinition/>
+        </Grid.ColumnDefinitions>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="35"/>
+            <RowDefinition Height="65"/>
+        </Grid.RowDefinitions>
+        <StackPanel Orientation="Vertical" Grid.RowSpan="2" Grid.ColumnSpan="2">
+            <TextBlock Text="Palette Name" Foreground="White"/>
+            <TextBlock Text="Palette Creator" Foreground="White"/>
+        </StackPanel>
+        <ItemsControl Grid.Row="1" Grid.Column="0" ItemsSource="{Binding ElementName=paletteItem, Path=Colors}">
+            <ItemsControl.ItemsPanel>
+                <ItemsPanelTemplate>
+                    <WrapPanel Orientation="Horizontal" IsItemsHost="True"/>
+                </ItemsPanelTemplate>
+            </ItemsControl.ItemsPanel>
+            <ItemsControl.ItemTemplate>
+                <DataTemplate>
+                    <Rectangle Fill="{Binding}"/>
+                </DataTemplate>
+            </ItemsControl.ItemTemplate>
+        </ItemsControl>
+    </Grid>
+</UserControl>

+ 41 - 0
PixiEditor/Views/UserControls/Lospec/LospecPaletteItem.xaml.cs

@@ -0,0 +1,41 @@
+using SkiaSharp;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PixiEditor.Views.UserControls.Lospec
+{
+    /// <summary>
+    /// Interaction logic for LospecPaletteItem.xaml
+    /// </summary>
+    public partial class LospecPaletteItem : UserControl
+    {
+        public ObservableCollection<SKColor> Colors
+        {
+            get { return (ObservableCollection<SKColor>)GetValue(ColorsProperty); }
+            set { SetValue(ColorsProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for Colors.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty ColorsProperty =
+            DependencyProperty.Register("Colors", typeof(ObservableCollection<SKColor>), typeof(LospecPaletteItem));
+
+
+        public LospecPaletteItem()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 1 - 1
PixiEditor/Views/UserControls/Palette.xaml

@@ -59,7 +59,7 @@
                </ItemsControl.ItemsPanel>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                <ItemsControl.ItemTemplate>
                     <DataTemplate>
                     <DataTemplate>
-                        <local:PaletteColor AllowDrop="True" Color="{Binding}" Margin="0 5 5 5" MouseMove="PaletteColor_MouseMove"
+                        <local:PaletteColor ToolTip="Click to select as main color. Drag and drop onto another pallete color to swap them." AllowDrop="True" Color="{Binding}" Margin="0 5 5 5" MouseMove="PaletteColor_MouseMove"
                                             Drop="PaletteColor_Drop"
                                             Drop="PaletteColor_Drop"
                                             AssociatedKey="{Binding Path=(ItemsControl.AlternationIndex), 
                                             AssociatedKey="{Binding Path=(ItemsControl.AlternationIndex), 
                 RelativeSource={RelativeSource TemplatedParent}, Converter={converters:IndexToAssociatedKeyConverter}}">
                 RelativeSource={RelativeSource TemplatedParent}, Converter={converters:IndexToAssociatedKeyConverter}}">