|
@@ -4,70 +4,132 @@
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
xmlns:input="clr-namespace:PixiEditor.Views.Input"
|
|
xmlns:input="clr-namespace:PixiEditor.Views.Input"
|
|
|
xmlns:localization="clr-namespace:PixiEditor.UI.Common.Localization;assembly=PixiEditor.UI.Common"
|
|
xmlns:localization="clr-namespace:PixiEditor.UI.Common.Localization;assembly=PixiEditor.UI.Common"
|
|
|
|
|
+ xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
|
|
|
|
|
+ xmlns:controls="clr-namespace:Drawie.Interop.Avalonia.Core.Controls;assembly=Drawie.Interop.Avalonia.Core"
|
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
|
x:ClassModifier="internal"
|
|
x:ClassModifier="internal"
|
|
|
x:Class="PixiEditor.Views.Input.BrushPicker">
|
|
x:Class="PixiEditor.Views.Input.BrushPicker">
|
|
|
- <ToggleButton>
|
|
|
|
|
- <ToggleButton.Styles>
|
|
|
|
|
- <Style Selector="FlyoutPresenter">
|
|
|
|
|
- <Setter Property="Cursor" Value="Arrow"/>
|
|
|
|
|
- </Style>
|
|
|
|
|
- </ToggleButton.Styles>
|
|
|
|
|
- <ToggleButton.Flyout>
|
|
|
|
|
- <Flyout
|
|
|
|
|
- IsOpen="{Binding IsChecked, RelativeSource={RelativeSource AncestorType=ToggleButton}, Mode=TwoWay}"
|
|
|
|
|
- Placement="BottomEdgeAlignedLeft"
|
|
|
|
|
- ShowMode="Transient">
|
|
|
|
|
- <Grid Width="300" Height="400" Margin="10">
|
|
|
|
|
- <Grid.RowDefinitions>
|
|
|
|
|
- <RowDefinition Height="Auto" />
|
|
|
|
|
- <RowDefinition Height="*" />
|
|
|
|
|
- </Grid.RowDefinitions>
|
|
|
|
|
-
|
|
|
|
|
- <Grid>
|
|
|
|
|
- <Grid.ColumnDefinitions>
|
|
|
|
|
- <ColumnDefinition Width="*" />
|
|
|
|
|
- <ColumnDefinition Width="*" />
|
|
|
|
|
- <ColumnDefinition Width="Auto" />
|
|
|
|
|
- </Grid.ColumnDefinitions>
|
|
|
|
|
|
|
+ <Panel>
|
|
|
|
|
+ <controls:DrawieTextureControl
|
|
|
|
|
+ Width="40" Height="20"
|
|
|
|
|
+ ZIndex="1"
|
|
|
|
|
+ SamplingOptions="Bilinear"
|
|
|
|
|
+ Texture="{Binding $parent[input:BrushPicker].SelectedBrush.Preview, FallbackValue={x:Null}}" />
|
|
|
|
|
+ <ToggleButton Name="PopupToggle" Width="40" Height="20">
|
|
|
|
|
+ <ToggleButton.Styles>
|
|
|
|
|
+ <Style Selector="FlyoutPresenter">
|
|
|
|
|
+ <Setter Property="Cursor" Value="Arrow" />
|
|
|
|
|
+ </Style>
|
|
|
|
|
+ </ToggleButton.Styles>
|
|
|
|
|
+ <ToggleButton.Flyout>
|
|
|
|
|
+ <Flyout
|
|
|
|
|
+ IsOpen="{Binding IsChecked, RelativeSource={RelativeSource AncestorType=ToggleButton}, Mode=TwoWay}"
|
|
|
|
|
+ Placement="BottomEdgeAlignedLeft"
|
|
|
|
|
+ ShowMode="Transient">
|
|
|
|
|
+ <Grid Width="300" Height="400" Margin="10">
|
|
|
<Grid.RowDefinitions>
|
|
<Grid.RowDefinitions>
|
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
|
- <RowDefinition Height="Auto" />
|
|
|
|
|
|
|
+ <RowDefinition Height="*" />
|
|
|
</Grid.RowDefinitions>
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
|
|
- <TextBox Watermark="{localization:Translate Key=SEARCH}" />
|
|
|
|
|
- <ComboBox Grid.Column="1" Margin="5,0,0,0" />
|
|
|
|
|
- <StackPanel Orientation="Horizontal" Grid.Column="2" Grid.Row="0" Spacing="5"
|
|
|
|
|
- Margin="5,0,0,0">
|
|
|
|
|
- <ToggleButton Classes="pixi-icon"
|
|
|
|
|
- Name="SortButton"
|
|
|
|
|
- Content="{DynamicResource icon-arrow-up}" />
|
|
|
|
|
- <ToggleButton Classes="pixi-icon"
|
|
|
|
|
- Content="{DynamicResource icon-grid}" />
|
|
|
|
|
- </StackPanel>
|
|
|
|
|
|
|
+ <Grid>
|
|
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
|
|
+ <ColumnDefinition Width="*" />
|
|
|
|
|
+ <ColumnDefinition Width="*" />
|
|
|
|
|
+ <ColumnDefinition Width="Auto" />
|
|
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
|
|
+ <Grid.RowDefinitions>
|
|
|
|
|
+ <RowDefinition Height="Auto" />
|
|
|
|
|
+ <RowDefinition Height="Auto" />
|
|
|
|
|
+ </Grid.RowDefinitions>
|
|
|
|
|
+
|
|
|
|
|
+ <TextBox Watermark="{localization:Translate Key=SEARCH}">
|
|
|
|
|
+ <TextBox.InnerLeftContent>
|
|
|
|
|
+ <TextBlock Classes="pixi-icon" Text="{DynamicResource icon-search}"
|
|
|
|
|
+ Margin="0, 0, 5, 0" />
|
|
|
|
|
+ </TextBox.InnerLeftContent>
|
|
|
|
|
+ </TextBox>
|
|
|
|
|
+ <ComboBox Grid.Column="1" Margin="5,0,0,0" />
|
|
|
|
|
+ <StackPanel Orientation="Horizontal" Grid.Column="2" Grid.Row="0" Spacing="5"
|
|
|
|
|
+ Margin="5,0,0,0">
|
|
|
|
|
+ <ToggleButton Classes="pixi-icon"
|
|
|
|
|
+ Name="SortButton"
|
|
|
|
|
+ Content="{DynamicResource icon-arrow-up}" />
|
|
|
|
|
+ <ToggleButton Classes="pixi-icon"
|
|
|
|
|
+ Content="{DynamicResource icon-grid}" />
|
|
|
|
|
+ </StackPanel>
|
|
|
|
|
+
|
|
|
|
|
+ <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
|
|
|
|
|
+ HorizontalAlignment="Right" Margin="0,5,5,0" Spacing="5"
|
|
|
|
|
+ IsVisible="{Binding IsChecked, ElementName=SortButton}">
|
|
|
|
|
+ <TextBlock Text="{localization:Translate Key=SORT_BY}" />
|
|
|
|
|
+ <ComboBox SelectedIndex="0">
|
|
|
|
|
+ <ComboBoxItem Content="{localization:Translate Key=ALPHABETICAL}" />
|
|
|
|
|
+ </ComboBox>
|
|
|
|
|
+ </StackPanel>
|
|
|
|
|
+
|
|
|
|
|
+ <StackPanel Margin="5, 5, 0, 0" Orientation="Horizontal" Grid.Column="2" Grid.Row="1"
|
|
|
|
|
+ Spacing="5">
|
|
|
|
|
+ <ToggleButton
|
|
|
|
|
+ IsVisible="{Binding IsChecked, ElementName=SortButton}"
|
|
|
|
|
+ Content="{DynamicResource icon-arrow-up}"
|
|
|
|
|
+ Classes="pixi-icon" />
|
|
|
|
|
+ <ToggleButton
|
|
|
|
|
+ IsVisible="{Binding IsChecked, ElementName=SortButton}"
|
|
|
|
|
+ Content="{DynamicResource icon-arrow-down}"
|
|
|
|
|
+ Classes="pixi-icon" />
|
|
|
|
|
+ </StackPanel>
|
|
|
|
|
+ </Grid>
|
|
|
|
|
|
|
|
- <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
|
|
|
|
|
- HorizontalAlignment="Right" Margin="0,5,5,0" Spacing="5"
|
|
|
|
|
- IsVisible="{Binding IsChecked, ElementName=SortButton}">
|
|
|
|
|
- <TextBlock Text="{localization:Translate Key=SORT_BY}" />
|
|
|
|
|
- <ComboBox SelectedIndex="0">
|
|
|
|
|
- <ComboBoxItem Content="{localization:Translate Key=ALPHABETICAL}" />
|
|
|
|
|
- </ComboBox>
|
|
|
|
|
- </StackPanel>
|
|
|
|
|
|
|
+ <ScrollViewer Grid.Row="1" Margin="0,10,0,0" HorizontalScrollBarVisibility="Disabled"
|
|
|
|
|
+ VerticalScrollBarVisibility="Auto">
|
|
|
|
|
+ <ItemsControl
|
|
|
|
|
+ ItemsSource="{Binding $parent[input:BrushPicker].Brushes}">
|
|
|
|
|
+ <ItemsControl.Styles>
|
|
|
|
|
+ <Style Selector="ContentPresenter > Border">
|
|
|
|
|
+ <Setter Property="Background" Value="Transparent" />
|
|
|
|
|
+ <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}" />
|
|
|
|
|
+ <Setter Property="BorderThickness" Value="0, 0, 0, 1" />
|
|
|
|
|
+ <Setter Property="Padding" Value="6, 6, 6, 5" />
|
|
|
|
|
+ </Style>
|
|
|
|
|
+ <Style Selector="ContentPresenter:pointerover > Border">
|
|
|
|
|
+ <Setter Property="Background" Value="{DynamicResource ThemeControlHighBrush}" />
|
|
|
|
|
+ <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}" />
|
|
|
|
|
+ <Setter Property="BorderThickness" Value="1" />
|
|
|
|
|
+ <Setter Property="Padding" Value="5" />
|
|
|
|
|
+ </Style>
|
|
|
|
|
|
|
|
- <StackPanel Margin="5, 5, 0, 0" Orientation="Horizontal" Grid.Column="2" Grid.Row="1" Spacing="5">
|
|
|
|
|
- <ToggleButton
|
|
|
|
|
- IsVisible="{Binding IsChecked, ElementName=SortButton}"
|
|
|
|
|
- Content="{DynamicResource icon-arrow-up}"
|
|
|
|
|
- Classes="pixi-icon" />
|
|
|
|
|
- <ToggleButton
|
|
|
|
|
- IsVisible="{Binding IsChecked, ElementName=SortButton}"
|
|
|
|
|
- Content="{DynamicResource icon-arrow-down}"
|
|
|
|
|
- Classes="pixi-icon" />
|
|
|
|
|
- </StackPanel>
|
|
|
|
|
|
|
+ <Style Selector="ContentPresenter > Border.selected">
|
|
|
|
|
+ <Setter Property="Background"
|
|
|
|
|
+ Value="{DynamicResource ThemeAccent2TranslucentBrush}" />
|
|
|
|
|
+ <Setter Property="BorderBrush" Value="{DynamicResource ThemeAccent2Brush}" />
|
|
|
|
|
+ <Setter Property="BorderThickness" Value="1" />
|
|
|
|
|
+ <Setter Property="Padding" Value="5" />
|
|
|
|
|
+ </Style>
|
|
|
|
|
+ </ItemsControl.Styles>
|
|
|
|
|
+ <ItemsControl.ItemTemplate>
|
|
|
|
|
+ <DataTemplate>
|
|
|
|
|
+ <Border CornerRadius="4" IsHitTestVisible="True">
|
|
|
|
|
+ <input:BrushItem Brush="{Binding .}" />
|
|
|
|
|
+ <Interaction.Behaviors>
|
|
|
|
|
+ <ExecuteCommandOnPointerPressedBehavior
|
|
|
|
|
+ Command="{Binding $parent[input:BrushPicker].SelectBrushCommand}"
|
|
|
|
|
+ CommandParameter="{Binding }" />
|
|
|
|
|
+ </Interaction.Behaviors>
|
|
|
|
|
+ <Classes.selected>
|
|
|
|
|
+ <MultiBinding Converter="{converters:AreEqualConverter}">
|
|
|
|
|
+ <Binding Path="$parent[input:BrushPicker].SelectedBrush" />
|
|
|
|
|
+ <Binding />
|
|
|
|
|
+ </MultiBinding>
|
|
|
|
|
+ </Classes.selected>
|
|
|
|
|
+ </Border>
|
|
|
|
|
+ </DataTemplate>
|
|
|
|
|
+ </ItemsControl.ItemTemplate>
|
|
|
|
|
+ </ItemsControl>
|
|
|
|
|
+ </ScrollViewer>
|
|
|
</Grid>
|
|
</Grid>
|
|
|
- </Grid>
|
|
|
|
|
- </Flyout>
|
|
|
|
|
- </ToggleButton.Flyout>
|
|
|
|
|
- </ToggleButton>
|
|
|
|
|
|
|
+ </Flyout>
|
|
|
|
|
+ </ToggleButton.Flyout>
|
|
|
|
|
+ </ToggleButton>
|
|
|
|
|
+ </Panel>
|
|
|
</UserControl>
|
|
</UserControl>
|