|
@@ -1,14 +1,15 @@
|
|
-<Window x:Class="PixiEditor.Views.Dialogs.PalettesBrowser"
|
|
|
|
|
|
+<Window
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
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.UserControls.Palettes" xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
|
|
|
|
- mc:Ignorable="d"
|
|
|
|
|
|
+ xmlns:local="clr-namespace:PixiEditor.Views.UserControls.Palettes" xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
|
|
xmlns:gif="http://wpfanimatedgif.codeplex.com" xmlns:usercontrols="clr-namespace:PixiEditor.Views.UserControls" xmlns:views="clr-namespace:PixiEditor.Views"
|
|
xmlns:gif="http://wpfanimatedgif.codeplex.com" xmlns:usercontrols="clr-namespace:PixiEditor.Views.UserControls" xmlns:views="clr-namespace:PixiEditor.Views"
|
|
xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours"
|
|
xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours"
|
|
|
|
+ xmlns:PixiEditor="clr-namespace:PixiEditor" x:Class="PixiEditor.Views.Dialogs.PalettesBrowser"
|
|
|
|
+ mc:Ignorable="d"
|
|
Title="Palettes Browser" WindowStartupLocation="CenterScreen" MinWidth="200" Height="600" Width="850" WindowStyle="None"
|
|
Title="Palettes Browser" WindowStartupLocation="CenterScreen" MinWidth="200" Height="600" Width="850" WindowStyle="None"
|
|
- Name="palettesBrowser">
|
|
|
|
|
|
+ x:Name="palettesBrowser">
|
|
<Window.Resources>
|
|
<Window.Resources>
|
|
<BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
|
|
<BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
|
|
</Window.Resources>
|
|
</Window.Resources>
|
|
@@ -27,7 +28,6 @@
|
|
<RowDefinition Height="35" />
|
|
<RowDefinition Height="35" />
|
|
<RowDefinition Height="55"/>
|
|
<RowDefinition Height="55"/>
|
|
<RowDefinition Height="1*"/>
|
|
<RowDefinition Height="1*"/>
|
|
- <RowDefinition Height="20"/>
|
|
|
|
</Grid.RowDefinitions>
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<DockPanel Grid.Row="0" Background="{StaticResource MainColor}">
|
|
<DockPanel Grid.Row="0" Background="{StaticResource MainColor}">
|
|
@@ -38,20 +38,20 @@
|
|
<DockPanel Background="{StaticResource MainColor}" Grid.Row="1">
|
|
<DockPanel Background="{StaticResource MainColor}" Grid.Row="1">
|
|
<StackPanel HorizontalAlignment="Left" Margin="10" Orientation="Horizontal" VerticalAlignment="Center">
|
|
<StackPanel HorizontalAlignment="Left" Margin="10" Orientation="Horizontal" VerticalAlignment="Center">
|
|
<Label Content="Sort by:" Style="{StaticResource BaseLabel}" VerticalAlignment="Center" FontSize="16"/>
|
|
<Label Content="Sort by:" Style="{StaticResource BaseLabel}" VerticalAlignment="Center" FontSize="16"/>
|
|
- <ComboBox Name="sortingComboBox" FontSize="16" VerticalAlignment="Center" SelectionChanged="SortingComboBox_SelectionChanged">
|
|
|
|
- <ComboBoxItem IsSelected="True">Default</ComboBoxItem>
|
|
|
|
- <ComboBoxItem>Alphabetical</ComboBoxItem>
|
|
|
|
- <ComboBoxItem>Color Count</ComboBoxItem>
|
|
|
|
|
|
+ <ComboBox x:Name="sortingComboBox" FontSize="16" VerticalAlignment="Center" SelectionChanged="SortingComboBox_SelectionChanged">
|
|
|
|
+ <ComboBoxItem IsSelected="True" Content="Default"/>
|
|
|
|
+ <ComboBoxItem Content="Alphabetical"/>
|
|
|
|
+ <ComboBoxItem Content="Color Count"/>
|
|
</ComboBox>
|
|
</ComboBox>
|
|
- <ToggleButton Margin="10 0 0 0" Name="toggleBtn"
|
|
|
|
- IsChecked="{Binding ElementName=palettesBrowser, Path=SortAscending}"
|
|
|
|
|
|
+ <ToggleButton Margin="10 0 0 0" x:Name="toggleBtn"
|
|
|
|
+ IsChecked="{Binding SortAscending, ElementName=palettesBrowser}"
|
|
Focusable="False"
|
|
Focusable="False"
|
|
Style="{StaticResource PixiEditorDockThemeToolButtonStyle}">
|
|
Style="{StaticResource PixiEditorDockThemeToolButtonStyle}">
|
|
<Image Width="24" Height="24" Source="/Images/ChevronsDown.png">
|
|
<Image Width="24" Height="24" Source="/Images/ChevronsDown.png">
|
|
<Image.Style>
|
|
<Image.Style>
|
|
<Style TargetType="{x:Type Image}">
|
|
<Style TargetType="{x:Type Image}">
|
|
<Style.Triggers>
|
|
<Style.Triggers>
|
|
- <DataTrigger Binding="{Binding ElementName=toggleBtn, Path=IsChecked}" Value="true">
|
|
|
|
|
|
+ <DataTrigger Binding="{Binding IsChecked, ElementName=toggleBtn}" Value="true">
|
|
<Setter Property="RenderTransform">
|
|
<Setter Property="RenderTransform">
|
|
<Setter.Value>
|
|
<Setter.Value>
|
|
<RotateTransform Angle="180" CenterX="11.5" CenterY="11.5"/>
|
|
<RotateTransform Angle="180" CenterX="11.5" CenterY="11.5"/>
|
|
@@ -59,7 +59,7 @@
|
|
</Setter>
|
|
</Setter>
|
|
<Setter Property="ToolTip" Value="Ascending"/>
|
|
<Setter Property="ToolTip" Value="Ascending"/>
|
|
</DataTrigger>
|
|
</DataTrigger>
|
|
- <DataTrigger Binding="{Binding ElementName=toggleBtn, Path=IsChecked}" Value="false">
|
|
|
|
|
|
+ <DataTrigger Binding="{Binding IsChecked, ElementName=toggleBtn}" Value="false">
|
|
<Setter Property="ToolTip" Value="Descending"/>
|
|
<Setter Property="ToolTip" Value="Descending"/>
|
|
</DataTrigger>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style.Triggers>
|
|
@@ -69,23 +69,22 @@
|
|
</ToggleButton>
|
|
</ToggleButton>
|
|
<Label Margin="10 0 0 0" Content="Name:" Style="{StaticResource BaseLabel}" VerticalAlignment="Center" FontSize="16"/>
|
|
<Label Margin="10 0 0 0" Content="Name:" Style="{StaticResource BaseLabel}" VerticalAlignment="Center" FontSize="16"/>
|
|
<usercontrols:InputBox FontSize="16"
|
|
<usercontrols:InputBox FontSize="16"
|
|
- Text="{Binding ElementName=palettesBrowser, Path=NameFilter,
|
|
|
|
- Delay=100, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
|
+ Text="{Binding NameFilter, Delay=100, ElementName=palettesBrowser, UpdateSourceTrigger=PropertyChanged}"
|
|
VerticalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Style="{StaticResource DarkTextBoxStyle}" Width="150" />
|
|
Style="{StaticResource DarkTextBoxStyle}" Width="150" />
|
|
|
|
|
|
<Label Margin="10 0 0 0" Content="Colors:" Style="{StaticResource BaseLabel}" VerticalAlignment="Center" FontSize="16"/>
|
|
<Label Margin="10 0 0 0" Content="Colors:" Style="{StaticResource BaseLabel}" VerticalAlignment="Center" FontSize="16"/>
|
|
- <ComboBox Name="colorsComboBox" FontSize="16" VerticalAlignment="Center" SelectionChanged="ColorsComboBox_SelectionChanged">
|
|
|
|
- <ComboBoxItem IsSelected="True">Any</ComboBoxItem>
|
|
|
|
- <ComboBoxItem>Max</ComboBoxItem>
|
|
|
|
- <ComboBoxItem>Min</ComboBoxItem>
|
|
|
|
- <ComboBoxItem>Exact</ComboBoxItem>
|
|
|
|
|
|
+ <ComboBox x:Name="colorsComboBox" FontSize="16" VerticalAlignment="Center" SelectionChanged="ColorsComboBox_SelectionChanged">
|
|
|
|
+ <ComboBoxItem IsSelected="True" Content="Any"/>
|
|
|
|
+ <ComboBoxItem Content="Max"/>
|
|
|
|
+ <ComboBoxItem Content="Min"/>
|
|
|
|
+ <ComboBoxItem Content="Exact"/>
|
|
</ComboBox>
|
|
</ComboBox>
|
|
<views:NumberInput Width="50" FontSize="16" VerticalAlignment="Center" Margin="10 0 0 0"
|
|
<views:NumberInput Width="50" FontSize="16" VerticalAlignment="Center" Margin="10 0 0 0"
|
|
FocusNext="True"
|
|
FocusNext="True"
|
|
- Value="{Binding ElementName=palettesBrowser, Path=ColorsNumber, Mode=TwoWay}"/>
|
|
|
|
|
|
+ Value="{Binding ColorsNumber, ElementName=palettesBrowser, Mode=TwoWay}"/>
|
|
<CheckBox Margin="10 0 0 0" VerticalAlignment="Center" FontSize="16"
|
|
<CheckBox Margin="10 0 0 0" VerticalAlignment="Center" FontSize="16"
|
|
- IsChecked="{Binding ElementName=palettesBrowser, Path=ShowOnlyFavourites}">Favourites</CheckBox>
|
|
|
|
|
|
+ IsChecked="{Binding ShowOnlyFavourites, ElementName=palettesBrowser}" Content="Favourites"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 10 0">
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 10 0">
|
|
<Button ToolTip="Add from current palette" Click="AddFromPalette_OnClick" Cursor="Hand" Margin="10 0" Style="{StaticResource ImageButtonStyle}" Width="24" Height="24">
|
|
<Button ToolTip="Add from current palette" Click="AddFromPalette_OnClick" Cursor="Hand" Margin="10 0" Style="{StaticResource ImageButtonStyle}" Width="24" Height="24">
|
|
@@ -94,21 +93,25 @@
|
|
<Button Cursor="Hand" Click="OpenFolder_OnClick" Style="{StaticResource ImageButtonStyle}" Width="24" Height="24">
|
|
<Button Cursor="Hand" Click="OpenFolder_OnClick" Style="{StaticResource ImageButtonStyle}" Width="24" Height="24">
|
|
<Image Source="/Images/Folder.png"/>
|
|
<Image Source="/Images/Folder.png"/>
|
|
</Button>
|
|
</Button>
|
|
|
|
+ <Button HorizontalAlignment="Right" Margin="10 0 0 0" ToolTip="Browse palettes on Lospec"
|
|
|
|
+ Style="{StaticResource ImageButtonStyle}" Width="24" Height="24"
|
|
|
|
+ Click="BrowseOnLospec_OnClick"
|
|
|
|
+ CommandParameter="https://lospec.com/palette-list">
|
|
|
|
+ <Image Source="/Images/Globe.png"/>
|
|
|
|
+ </Button>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</DockPanel>
|
|
</DockPanel>
|
|
<Grid Grid.Row="2" Margin="10">
|
|
<Grid Grid.Row="2" Margin="10">
|
|
<TextBlock Text="Couldn't fetch palettes" Foreground="White" FontSize="20" HorizontalAlignment="Center"
|
|
<TextBlock Text="Couldn't fetch palettes" Foreground="White" FontSize="20" HorizontalAlignment="Center"
|
|
- VerticalAlignment="Center" Visibility="{Binding ElementName=itemsControl,
|
|
|
|
- Path=Visibility, Converter={converters:OppositeVisibilityConverter}}"/>
|
|
|
|
- <ScrollViewer Name="scrollViewer" Margin="5" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" ScrollChanged="ScrollViewer_ScrollChanged">
|
|
|
|
- <ItemsControl Name="itemsControl" ItemsSource="{Binding ElementName=palettesBrowser, Path=SortedResults}"
|
|
|
|
- Visibility="{Binding ElementName=palettesBrowser, Path=PaletteList.FetchedCorrectly,
|
|
|
|
- Converter={StaticResource BoolToVisibilityConverter}}">
|
|
|
|
|
|
+ VerticalAlignment="Center" Visibility="{Binding Visibility, Converter={converters:OppositeVisibilityConverter}, ElementName=itemsControl}"/>
|
|
|
|
+ <ScrollViewer x:Name="scrollViewer" Margin="5" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" ScrollChanged="ScrollViewer_ScrollChanged">
|
|
|
|
+ <ItemsControl x:Name="itemsControl" ItemsSource="{Binding SortedResults, ElementName=palettesBrowser}"
|
|
|
|
+ Visibility="{Binding PaletteList.FetchedCorrectly, Converter={StaticResource BoolToVisibilityConverter}, ElementName=palettesBrowser}">
|
|
<ItemsControl.ItemTemplate>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<DataTemplate>
|
|
<local:PaletteItem Palette="{Binding}"
|
|
<local:PaletteItem Palette="{Binding}"
|
|
OnRename="PaletteItem_OnRename"
|
|
OnRename="PaletteItem_OnRename"
|
|
- ToggleFavouriteCommand="{Binding ElementName=palettesBrowser, Path=ToggleFavouriteCommand}"
|
|
|
|
|
|
+ ToggleFavouriteCommand="{Binding ToggleFavouriteCommand, ElementName=palettesBrowser}"
|
|
DeletePaletteCommand="{Binding DeletePaletteCommand, ElementName=palettesBrowser}"
|
|
DeletePaletteCommand="{Binding DeletePaletteCommand, ElementName=palettesBrowser}"
|
|
ImportPaletteCommand="{Binding ImportPaletteCommand, ElementName=palettesBrowser}"/>
|
|
ImportPaletteCommand="{Binding ImportPaletteCommand, ElementName=palettesBrowser}"/>
|
|
</DataTemplate>
|
|
</DataTemplate>
|
|
@@ -116,7 +119,7 @@
|
|
</ItemsControl>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
</ScrollViewer>
|
|
<Image gif:ImageBehavior.AnimatedSource="/Images/Processing.gif" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
<Image gif:ImageBehavior.AnimatedSource="/Images/Processing.gif" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
- Visibility="{Binding ElementName=palettesBrowser, Path=IsFetching, Converter={StaticResource BoolToVisibilityConverter}}"
|
|
|
|
|
|
+ Visibility="{Binding IsFetching, Converter={StaticResource BoolToVisibilityConverter}, ElementName=palettesBrowser}"
|
|
Height="50" gif:ImageBehavior.AnimationSpeedRatio="1.5"/>
|
|
Height="50" gif:ImageBehavior.AnimationSpeedRatio="1.5"/>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|