|
@@ -13,119 +13,136 @@
|
|
|
xmlns:ui1="clr-namespace:PixiEditor.AvaloniaUI.Helpers.UI"
|
|
|
xmlns:palettes1="clr-namespace:PixiEditor.AvaloniaUI.Views.Palettes"
|
|
|
xmlns:indicators1="clr-namespace:PixiEditor.AvaloniaUI.Views.Indicators"
|
|
|
+ xmlns:palettes="clr-namespace:PixiEditor.AvaloniaUI.Models.Palettes"
|
|
|
mc:Ignorable="d"
|
|
|
Height="600" Width="850"
|
|
|
x:Name="palettesBrowser"
|
|
|
Title="PALETTE_BROWSER">
|
|
|
- <Grid Background="{DynamicResource ThemeBackgroundBrush1}" Focusable="True" PointerPressed="Grid_MouseDown">
|
|
|
+ <Grid Background="{DynamicResource ThemeBackgroundBrush}" Focusable="True" PointerPressed="Grid_MouseDown">
|
|
|
<Grid.RowDefinitions>
|
|
|
- <RowDefinition Height="45"/>
|
|
|
- <RowDefinition Height="1*"/>
|
|
|
+ <RowDefinition Height="45" />
|
|
|
+ <RowDefinition Height="1*" />
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
- <DockPanel Background="{DynamicResource ThemeBackgroundBrush}" Grid.Row="0">
|
|
|
+ <DockPanel Background="{DynamicResource ThemeBackgroundBrush1}" Grid.Row="0">
|
|
|
<StackPanel HorizontalAlignment="Left" Margin="10" Orientation="Horizontal" VerticalAlignment="Center">
|
|
|
- <Label ui:Translator.Key="SORT_BY" VerticalAlignment="Center"/>
|
|
|
- <ComboBox x:Name="sortingComboBox" VerticalAlignment="Center" SelectedIndex="0" SelectionChanged="SortingComboBox_SelectionChanged">
|
|
|
- <ComboBoxItem ui:Translator.Key="DEFAULT"/>
|
|
|
- <ComboBoxItem ui:Translator.Key="ALPHABETICAL"/>
|
|
|
- <ComboBoxItem ui:Translator.Key="COLOR_COUNT"/>
|
|
|
+ <Label ui:Translator.Key="SORT_BY" VerticalAlignment="Center" />
|
|
|
+ <ComboBox x:Name="sortingComboBox" VerticalAlignment="Center" SelectedIndex="0"
|
|
|
+ SelectionChanged="SortingComboBox_SelectionChanged">
|
|
|
+ <ComboBoxItem ui:Translator.Key="DEFAULT" />
|
|
|
+ <ComboBoxItem ui:Translator.Key="ALPHABETICAL" />
|
|
|
+ <ComboBoxItem ui:Translator.Key="COLOR_COUNT" />
|
|
|
</ComboBox>
|
|
|
- <ToggleButton Margin="10 0 0 0" x:Name="toggleBtn"
|
|
|
+ <ToggleButton Margin="10 0 0 0" Name="toggleBtn" Classes="pixi-icon"
|
|
|
IsChecked="{Binding SortAscending, ElementName=palettesBrowser}"
|
|
|
Focusable="False">
|
|
|
- <Image Width="24" Height="24" Source="/Images/ChevronsDown.png">
|
|
|
- <Image.Styles>
|
|
|
- <Style Selector="Image">
|
|
|
- <Setter Property="ui:Translator.TooltipKey" Value="DESCENDING"/>
|
|
|
- </Style>
|
|
|
- <Style Selector="Image.IsChecked">
|
|
|
- <Setter Property="RenderTransform">
|
|
|
- <Setter.Value>
|
|
|
- <RotateTransform Angle="180" CenterX="11.5" CenterY="11.5"/>
|
|
|
- </Setter.Value>
|
|
|
- </Setter>
|
|
|
- <Setter Property="ui:Translator.TooltipKey" Value="ASCENDING"/>
|
|
|
- </Style>
|
|
|
- </Image.Styles>
|
|
|
- </Image>
|
|
|
+ <ToggleButton.Styles>
|
|
|
+ <Style Selector="ToggleButton">
|
|
|
+ <Setter Property="ui:Translator.TooltipKey" Value="DESCENDING" />
|
|
|
+ <Setter Property="Content" Value="{DynamicResource icon-chevrons-down}" />
|
|
|
+ </Style>
|
|
|
+ <Style Selector="ToggleButton[IsChecked=True]">
|
|
|
+ <Setter Property="ui:Translator.TooltipKey" Value="ASCENDING" />
|
|
|
+ <Setter Property="Content" Value="{DynamicResource icon-chevrons-up}" />
|
|
|
+ </Style>
|
|
|
+ </ToggleButton.Styles>
|
|
|
</ToggleButton>
|
|
|
- <Label Margin="10 0 0 0" ui:Translator.Key="NAME" VerticalAlignment="Center"/>
|
|
|
+ <Label Margin="10 0 0 0" ui:Translator.Key="NAME" VerticalAlignment="Center" />
|
|
|
<input:InputBox
|
|
|
- Text="{Binding NameFilter, ElementName=palettesBrowser}"
|
|
|
- VerticalAlignment="Center" Width="150">
|
|
|
+ Text="{Binding NameFilter, ElementName=palettesBrowser}"
|
|
|
+ VerticalAlignment="Center" Width="150">
|
|
|
<Interaction.Behaviors>
|
|
|
<behaviours:TextBoxFocusBehavior SelectOnMouseClick="True" ConfirmOnEnter="True"
|
|
|
- FocusNext="{Binding ElementName=numberInput, Path=FocusNext}"/>
|
|
|
- <behaviours:GlobalShortcutFocusBehavior/>
|
|
|
+ FocusNext="{Binding ElementName=numberInput, Path=FocusNext}" />
|
|
|
+ <behaviours:GlobalShortcutFocusBehavior />
|
|
|
</Interaction.Behaviors>
|
|
|
</input:InputBox>
|
|
|
|
|
|
- <Label Margin="10 0 0 0" ui:Translator.Key="COLORS" VerticalAlignment="Center"/>
|
|
|
- <ComboBox x:Name="colorsComboBox" VerticalAlignment="Center" SelectedIndex="0" SelectionChanged="ColorsComboBox_SelectionChanged">
|
|
|
- <ComboBoxItem ui:Translator.Key="ANY"/>
|
|
|
- <ComboBoxItem ui:Translator.Key="MAX"/>
|
|
|
- <ComboBoxItem ui:Translator.Key="MIN"/>
|
|
|
- <ComboBoxItem ui:Translator.Key="EXACT"/>
|
|
|
+ <Label Margin="10 0 0 0" ui:Translator.Key="COLORS" VerticalAlignment="Center" />
|
|
|
+ <ComboBox x:Name="colorsComboBox" VerticalAlignment="Center" SelectedIndex="0"
|
|
|
+ SelectionChanged="ColorsComboBox_SelectionChanged">
|
|
|
+ <ComboBoxItem ui:Translator.Key="ANY" />
|
|
|
+ <ComboBoxItem ui:Translator.Key="MAX" />
|
|
|
+ <ComboBoxItem ui:Translator.Key="MIN" />
|
|
|
+ <ComboBoxItem ui:Translator.Key="EXACT" />
|
|
|
</ComboBox>
|
|
|
<input:NumberInput Width="50" VerticalAlignment="Center" Margin="10 0 0 0"
|
|
|
FocusNext="True"
|
|
|
- Value="{Binding ColorsNumber, ElementName=palettesBrowser, Mode=TwoWay}"/>
|
|
|
+ Value="{Binding ColorsNumber, ElementName=palettesBrowser, Mode=TwoWay}" />
|
|
|
<CheckBox Margin="10 0 0 0" VerticalAlignment="Center"
|
|
|
- IsChecked="{Binding ShowOnlyFavourites, ElementName=palettesBrowser}" ui:Translator.Key="FAVORITES"/>
|
|
|
+ IsChecked="{Binding ShowOnlyFavourites, ElementName=palettesBrowser}"
|
|
|
+ ui:Translator.Key="FAVORITES" />
|
|
|
</StackPanel>
|
|
|
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 10 0">
|
|
|
- <Button ui:Translator.TooltipKey="ADD_FROM_CURRENT_PALETTE" Command="{Binding ElementName=palettesBrowser, Path=AddFromPaletteCommand}"
|
|
|
- Cursor="Hand" Margin="10 0" Width="24" Height="24">
|
|
|
- <Image Source="/Images/Plus-square.png"/>
|
|
|
- </Button>
|
|
|
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right"
|
|
|
+ Margin="0 0 10 0">
|
|
|
+ <Button ui:Translator.TooltipKey="ADD_FROM_CURRENT_PALETTE"
|
|
|
+ Command="{Binding ElementName=palettesBrowser, Path=AddFromPaletteCommand}"
|
|
|
+ Cursor="Hand" Margin="10 0" Width="24" Height="24" Classes="pixi-icon"
|
|
|
+ Content="{DynamicResource icon-plus-square}"/>
|
|
|
<Button Cursor="Hand" Click="OpenFolder_OnClick" Width="24" Height="24"
|
|
|
- ui:Translator.TooltipKey="OPEN_PALETTES_DIR_TOOLTIP">
|
|
|
- <Image Source="/Images/Folder.png"/>
|
|
|
- </Button>
|
|
|
- <Button HorizontalAlignment="Right" Margin="10 0 0 0" ui:Translator.TooltipKey="BROWSE_ON_LOSPEC_TOOLTIP"
|
|
|
+ ui:Translator.TooltipKey="OPEN_PALETTES_DIR_TOOLTIP"
|
|
|
+ Classes="pixi-icon" Content="{DynamicResource icon-folder}"/>
|
|
|
+ <Button HorizontalAlignment="Right" Margin="10 0 0 0"
|
|
|
+ ui:Translator.TooltipKey="BROWSE_ON_LOSPEC_TOOLTIP"
|
|
|
Width="24" Height="24"
|
|
|
Click="BrowseOnLospec_OnClick"
|
|
|
- CommandParameter="https://lospec.com/palette-list">
|
|
|
- <Image Source="/Images/Globe.png"/>
|
|
|
- </Button>
|
|
|
- <Button HorizontalAlignment="Right" Margin="10 0 0 0" ui:Translator.TooltipKey="IMPORT_FROM_FILE_TOOLTIP"
|
|
|
+ CommandParameter="https://lospec.com/palette-list" Classes="pixi-icon"
|
|
|
+ Content="{DynamicResource icon-globe}"/>
|
|
|
+ <Button HorizontalAlignment="Right" Margin="10 0 0 0"
|
|
|
+ ui:Translator.TooltipKey="IMPORT_FROM_FILE_TOOLTIP"
|
|
|
Width="24" Height="24"
|
|
|
- Click="ImportFromFile_OnClick">
|
|
|
- <Image Source="/Images/hard-drive.png"/>
|
|
|
- </Button>
|
|
|
+ Click="ImportFromFile_OnClick" Classes="pixi-icon"
|
|
|
+ Content="{DynamicResource icon-hard-drive}"/>
|
|
|
</StackPanel>
|
|
|
</DockPanel>
|
|
|
<Grid Grid.Row="1" Margin="10">
|
|
|
- <TextBlock ui:Translator.Key="COULD_NOT_LOAD_PALETTE" Foreground="White" FontSize="20" HorizontalAlignment="Center"
|
|
|
- VerticalAlignment="Center" IsVisible="{Binding !IsVisible, ElementName=itemsControl}"/>
|
|
|
- <StackPanel Panel.ZIndex="10" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
|
- IsVisible="{Binding ElementName=palettesBrowser, Path=SortedResults.Count, Converter={converters:CountToVisibilityConverter}}">
|
|
|
- <TextBlock ui:Translator.Key="NO_PALETTES_FOUND" Foreground="White" FontSize="20" TextAlignment="Center"/>
|
|
|
- <TextBlock Margin="0 10 0 0">
|
|
|
- <TextBlock ui:Translator.Key="LOSPEC_LINK_TEXT"
|
|
|
- ui1:Hyperlink.Url="https://lospec.com/palette-list"/>
|
|
|
- </TextBlock>
|
|
|
- <Image Width="128" Height="128" Source="/Images/Search.png"/>
|
|
|
- </StackPanel>
|
|
|
- <ScrollViewer x:Name="scrollViewer" Margin="5" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" ScrollChanged="ScrollViewer_ScrollChanged">
|
|
|
+ <indicators1:LoadingIndicator
|
|
|
+ IsVisible="{Binding IsFetching, ElementName=palettesBrowser}"
|
|
|
+ HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
|
+ ZIndex="10"
|
|
|
+ Height="150" Width="150"/>
|
|
|
+
|
|
|
+ <Panel IsVisible="{Binding ElementName=palettesBrowser, Path=!IsFetching}">
|
|
|
+ <TextBlock ui:Translator.Key="COULD_NOT_LOAD_PALETTE"
|
|
|
+ Foreground="{DynamicResource ThemeForegroundBrush}" FontSize="20"
|
|
|
+ HorizontalAlignment="Center"
|
|
|
+ VerticalAlignment="Center" IsVisible="{Binding !IsVisible, ElementName=itemsControl}" />
|
|
|
+ <StackPanel Panel.ZIndex="10" Orientation="Vertical" HorizontalAlignment="Center"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ IsVisible="{Binding ElementName=palettesBrowser, Path=SortedResults.Count, Converter={converters:CountToVisibilityConverter}}">
|
|
|
+ <TextBlock ui:Translator.Key="NO_PALETTES_FOUND"
|
|
|
+ Foreground="{DynamicResource ThemeForegroundBrush}" FontSize="20"
|
|
|
+ TextAlignment="Center" />
|
|
|
+ <TextBlock Margin="0 10 0 0">
|
|
|
+ <TextBlock ui:Translator.Key="LOSPEC_LINK_TEXT"
|
|
|
+ ui1:Hyperlink.Url="https://lospec.com/palette-list" />
|
|
|
+ </TextBlock>
|
|
|
+ <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
|
+ FontSize="128" Text="{DynamicResource icon-search}" Classes="pixi-icon"
|
|
|
+ Foreground="{DynamicResource ThemeForegroundSecondaryBrush}"/>
|
|
|
+ </StackPanel>
|
|
|
+ </Panel>
|
|
|
+
|
|
|
+ <ScrollViewer x:Name="scrollViewer" Margin="5" HorizontalScrollBarVisibility="Disabled"
|
|
|
+ VerticalScrollBarVisibility="Auto" ScrollChanged="ScrollViewer_ScrollChanged">
|
|
|
<ItemsControl x:Name="itemsControl" ItemsSource="{Binding SortedResults, ElementName=palettesBrowser}"
|
|
|
IsVisible="{Binding PaletteList.FetchedCorrectly, ElementName=palettesBrowser}">
|
|
|
- <ItemsControl.ItemTemplate>
|
|
|
- <DataTemplate>
|
|
|
+ <ItemsControl.ItemsPanel>
|
|
|
+ <ItemsPanelTemplate>
|
|
|
+ <VirtualizingStackPanel Orientation="Vertical" />
|
|
|
+ </ItemsPanelTemplate>
|
|
|
+ </ItemsControl.ItemsPanel>
|
|
|
+ <ItemsControl.DataTemplates>
|
|
|
+ <DataTemplate x:DataType="palettes:Palette">
|
|
|
<palettes1:PaletteItem Palette="{Binding}"
|
|
|
- OnRename="PaletteItem_OnRename"
|
|
|
- ToggleFavouriteCommand="{Binding ToggleFavouriteCommand, ElementName=palettesBrowser}"
|
|
|
- DeletePaletteCommand="{Binding DeletePaletteCommand, ElementName=palettesBrowser}"
|
|
|
- ImportPaletteCommand="{Binding ImportPaletteCommand, ElementName=palettesBrowser}"/>
|
|
|
+ OnRename="PaletteItem_OnRename"
|
|
|
+ ToggleFavouriteCommand="{Binding ToggleFavouriteCommand, ElementName=palettesBrowser}"
|
|
|
+ DeletePaletteCommand="{Binding DeletePaletteCommand, ElementName=palettesBrowser}"
|
|
|
+ ImportPaletteCommand="{Binding ImportPaletteCommand, ElementName=palettesBrowser}" />
|
|
|
</DataTemplate>
|
|
|
- </ItemsControl.ItemTemplate>
|
|
|
+ </ItemsControl.DataTemplates>
|
|
|
</ItemsControl>
|
|
|
</ScrollViewer>
|
|
|
- <indicators1:LoadingIndicator
|
|
|
- IsVisible="{Binding IsFetching, ElementName=palettesBrowser}"
|
|
|
- HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
|
- Height="50"/>
|
|
|
</Grid>
|
|
|
</Grid>
|
|
|
-</dialogs:PixiEditorPopup>
|
|
|
+</dialogs:PixiEditorPopup>
|