|
@@ -11,10 +11,10 @@
|
|
|
xmlns:cmd="http://www.galasoft.ch/mvvmlight"
|
|
|
xmlns:avalondock="https://github.com/Dirkster99/AvalonDock"
|
|
|
xmlns:colorpicker="clr-namespace:ColorPicker;assembly=ColorPicker" xmlns:usercontrols="clr-namespace:PixiEditor.Views.UserControls" xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours"
|
|
|
- xmlns:avalonDockTheme="clr-namespace:PixiEditor.Styles.AvalonDock" d:DataContext="{d:DesignInstance Type=vm:ViewModelMain}"
|
|
|
+ xmlns:avalonDockTheme="clr-namespace:PixiEditor.Styles.AvalonDock"
|
|
|
mc:Ignorable="d" WindowStyle="None" Initialized="MainWindow_Initialized"
|
|
|
Title="PixiEditor" Name="mainWindow" Height="1000" Width="1600" Background="{StaticResource MainColor}"
|
|
|
- WindowStartupLocation="CenterScreen" WindowState="Maximized">
|
|
|
+ WindowStartupLocation="CenterScreen" WindowState="Maximized" DataContext="{DynamicResource ViewModelMain}">
|
|
|
<WindowChrome.WindowChrome>
|
|
|
<WindowChrome CaptionHeight="32"
|
|
|
ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
|
|
@@ -22,11 +22,9 @@
|
|
|
|
|
|
<Window.Resources>
|
|
|
<ResourceDictionary>
|
|
|
- <!--<vm:ViewModelMain x:Key="ViewModelMain" />-->
|
|
|
+ <vm:ViewModelMain x:Key="ViewModelMain" />
|
|
|
<BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
|
|
<converters:BoolToIntConverter x:Key="BoolToIntConverter" />
|
|
|
- <converters:NotNullToBoolConverter x:Key="NotNullToBoolConverter" />
|
|
|
- <converters:FloatNormalizeConverter x:Key="FloatNormalizeConverter" />
|
|
|
<converters:DoubleToIntConverter x:Key="DoubleToIntConverter"/>
|
|
|
<ResourceDictionary.MergedDictionaries>
|
|
|
<ResourceDictionary Source="pack://application:,,,/ColorPicker;component/Styles/DefaultColorPickerStyle.xaml" />
|
|
@@ -229,159 +227,75 @@
|
|
|
<LayoutDocumentPane/>
|
|
|
<LayoutAnchorablePaneGroup Orientation="Vertical" DockWidth="290">
|
|
|
<LayoutAnchorablePane>
|
|
|
- <LayoutAnchorable ContentId="colorPicker" Title="Color Picker" CanHide="False"
|
|
|
+ <LayoutAnchorable ContentId="colorPicker" Title="Color Picker" CanHide="False"
|
|
|
CanClose="False" CanAutoHide="False"
|
|
|
CanDockAsTabbedDocument="False" CanFloat="True">
|
|
|
- <colorpicker:StandardColorPicker Grid.Row="0" SelectedColor="{Binding ColorsSubViewModel.PrimaryColor, Mode=TwoWay}"
|
|
|
+ <colorpicker:StandardColorPicker Grid.Row="0" SelectedColor="{Binding ColorsSubViewModel.PrimaryColor, Mode=TwoWay}"
|
|
|
SecondaryColor="{Binding ColorsSubViewModel.SecondaryColor, Mode=TwoWay}" Style="{StaticResource DefaultColorPickerStyle}" >
|
|
|
- <i:Interaction.Behaviors>
|
|
|
- <behaviours:GlobalShortcutFocusBehavior/>
|
|
|
- </i:Interaction.Behaviors>
|
|
|
- </colorpicker:StandardColorPicker>
|
|
|
- </LayoutAnchorable>
|
|
|
- <avalondock:LayoutAnchorable ContentId="swatches" Title="Swatches" CanHide="False"
|
|
|
+ <i:Interaction.Behaviors>
|
|
|
+ <behaviours:GlobalShortcutFocusBehavior/>
|
|
|
+ </i:Interaction.Behaviors>
|
|
|
+ </colorpicker:StandardColorPicker>
|
|
|
+ </LayoutAnchorable>
|
|
|
+ <avalondock:LayoutAnchorable ContentId="swatches" Title="Swatches" CanHide="False"
|
|
|
CanClose="False" CanAutoHide="False"
|
|
|
CanDockAsTabbedDocument="False" CanFloat="True">
|
|
|
- <ScrollViewer HorizontalScrollBarVisibility="Disabled"
|
|
|
+ <ScrollViewer HorizontalScrollBarVisibility="Disabled"
|
|
|
VerticalScrollBarVisibility="Auto">
|
|
|
- <ItemsControl ItemsSource="{Binding BitmapManager.ActiveDocument.Swatches}">
|
|
|
- <ItemsControl.ItemsPanel>
|
|
|
- <ItemsPanelTemplate>
|
|
|
- <WrapPanel Margin="10,10,0,10" Orientation="Horizontal"
|
|
|
+ <ItemsControl ItemsSource="{Binding BitmapManager.ActiveDocument.Swatches}">
|
|
|
+ <ItemsControl.ItemsPanel>
|
|
|
+ <ItemsPanelTemplate>
|
|
|
+ <WrapPanel Margin="10,10,0,10" Orientation="Horizontal"
|
|
|
VerticalAlignment="Top" HorizontalAlignment="Left" />
|
|
|
- </ItemsPanelTemplate>
|
|
|
- </ItemsControl.ItemsPanel>
|
|
|
- <ItemsControl.ItemTemplate>
|
|
|
- <DataTemplate>
|
|
|
- <Grid Width="45" Height="45" Margin="0 5 5 5">
|
|
|
- <Border CornerRadius="5.5" Width="44" Height="44">
|
|
|
- <Border.Background>
|
|
|
- <ImageBrush ImageSource="../Images/transparentbg.png"
|
|
|
+ </ItemsPanelTemplate>
|
|
|
+ </ItemsControl.ItemsPanel>
|
|
|
+ <ItemsControl.ItemTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <Grid Width="45" Height="45" Margin="0 5 5 5">
|
|
|
+ <Border CornerRadius="5.5" Width="44" Height="44">
|
|
|
+ <Border.Background>
|
|
|
+ <ImageBrush ImageSource="../Images/transparentbg.png"
|
|
|
Stretch="UniformToFill">
|
|
|
- <ImageBrush.RelativeTransform>
|
|
|
- <ScaleTransform ScaleX="6" ScaleY="6" CenterX="0.5"
|
|
|
+ <ImageBrush.RelativeTransform>
|
|
|
+ <ScaleTransform ScaleX="6" ScaleY="6" CenterX="0.5"
|
|
|
CenterY="0.5" />
|
|
|
- </ImageBrush.RelativeTransform>
|
|
|
- </ImageBrush>
|
|
|
- </Border.Background>
|
|
|
- </Border>
|
|
|
- <Border CornerRadius="5.5" BorderThickness="0 0 0 0.1" BorderBrush="White" Cursor="Hand">
|
|
|
- <Border.Background>
|
|
|
- <SolidColorBrush Color="{Binding}" />
|
|
|
- </Border.Background>
|
|
|
- </Border>
|
|
|
- <i:Interaction.Triggers>
|
|
|
- <i:EventTrigger EventName="MouseDown">
|
|
|
- <i:InvokeCommandAction
|
|
|
+ </ImageBrush.RelativeTransform>
|
|
|
+ </ImageBrush>
|
|
|
+ </Border.Background>
|
|
|
+ </Border>
|
|
|
+ <Border CornerRadius="5.5" BorderThickness="0 0 0 0.1" BorderBrush="White" Cursor="Hand">
|
|
|
+ <Border.Background>
|
|
|
+ <SolidColorBrush Color="{Binding}" />
|
|
|
+ </Border.Background>
|
|
|
+ </Border>
|
|
|
+ <i:Interaction.Triggers>
|
|
|
+ <i:EventTrigger EventName="MouseDown">
|
|
|
+ <i:InvokeCommandAction
|
|
|
Command="{Binding
|
|
|
RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ColorsSubViewModel.SelectColorCommand}"
|
|
|
CommandParameter="{Binding}" />
|
|
|
- </i:EventTrigger>
|
|
|
- </i:Interaction.Triggers>
|
|
|
- <Grid.ContextMenu>
|
|
|
- <ContextMenu>
|
|
|
- <MenuItem Header="Remove" Foreground="White"
|
|
|
- Command="{Binding ColorsSubViewModel.RemoveSwatchCommand}"
|
|
|
+ </i:EventTrigger>
|
|
|
+ </i:Interaction.Triggers>
|
|
|
+ <Grid.ContextMenu>
|
|
|
+ <ContextMenu>
|
|
|
+ <MenuItem Header="Remove" Foreground="White"
|
|
|
+ Command="{Binding ColorsSubViewModel.RemoveSwatchCommand, Source={StaticResource ViewModelMain}}"
|
|
|
CommandParameter="{Binding}" />
|
|
|
- </ContextMenu>
|
|
|
- </Grid.ContextMenu>
|
|
|
- </Grid>
|
|
|
- </DataTemplate>
|
|
|
- </ItemsControl.ItemTemplate>
|
|
|
- </ItemsControl>
|
|
|
- </ScrollViewer>
|
|
|
- </avalondock:LayoutAnchorable>
|
|
|
- </LayoutAnchorablePane>
|
|
|
+ </ContextMenu>
|
|
|
+ </Grid.ContextMenu>
|
|
|
+ </Grid>
|
|
|
+ </DataTemplate>
|
|
|
+ </ItemsControl.ItemTemplate>
|
|
|
+ </ItemsControl>
|
|
|
+ </ScrollViewer>
|
|
|
+ </avalondock:LayoutAnchorable>
|
|
|
+ </LayoutAnchorablePane>
|
|
|
<LayoutAnchorablePane>
|
|
|
<LayoutAnchorable ContentId="layers" Title="Layers" CanHide="False"
|
|
|
CanClose="False" CanAutoHide="False"
|
|
|
CanDockAsTabbedDocument="True" CanFloat="True">
|
|
|
- <Grid>
|
|
|
- <Grid.RowDefinitions>
|
|
|
- <RowDefinition Height="40"/>
|
|
|
- <RowDefinition Height="30"/>
|
|
|
- <RowDefinition Height="15"/>
|
|
|
- <RowDefinition Height="1*"/>
|
|
|
- </Grid.RowDefinitions>
|
|
|
- <Button Grid.Row="0" Command="{Binding LayersSubViewModel.NewLayerCommand}" Height="30" Content="New Layer"
|
|
|
- HorizontalAlignment="Stretch" Margin="5"
|
|
|
- Style="{StaticResource DarkRoundButton}" />
|
|
|
- <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,0">
|
|
|
- <Label Content="Opacity" Foreground="White" VerticalAlignment="Center"/>
|
|
|
- <vws:NumberInput
|
|
|
- Min="0" Max="100"
|
|
|
- IsEnabled="{Binding Path=BitmapManager.ActiveDocument,
|
|
|
- Converter={StaticResource NotNullToBoolConverter}}"
|
|
|
- Width="40" Height="20"
|
|
|
- VerticalAlignment="Center"
|
|
|
- Value="{Binding BitmapManager.ActiveDocument.ActiveLayer.OpacityUndoTriggerable, Mode=TwoWay,
|
|
|
- Converter={StaticResource FloatNormalizeConverter}}" />
|
|
|
- <Label Content="%" Foreground="White" VerticalAlignment="Center"/>
|
|
|
- </StackPanel>
|
|
|
- <Separator Grid.Row="2" Background="{StaticResource BrighterAccentColor}"/>
|
|
|
- <ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Auto">
|
|
|
- <ItemsControl ItemsSource="{Binding BitmapManager.ActiveDocument.Layers}"
|
|
|
- x:Name="layersItemsControl" AlternationCount="9999">
|
|
|
- <ItemsControl.ItemsPanel>
|
|
|
- <ItemsPanelTemplate>
|
|
|
- <ui:ReversedOrderStackPanel Orientation="Vertical" />
|
|
|
- </ItemsPanelTemplate>
|
|
|
- </ItemsControl.ItemsPanel>
|
|
|
- <ItemsControl.ItemTemplate>
|
|
|
- <DataTemplate>
|
|
|
- <vws:LayerItem Tag="{Binding DataContext, ElementName=mainWindow}" LayerIndex="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}" SetActiveLayerCommand="{Binding Path=DataContext.LayersSubViewModel.SetActiveLayerCommand, ElementName=mainWindow}"
|
|
|
- LayerName="{Binding Name, Mode=TwoWay}" IsActive="{Binding IsActive, Mode=TwoWay}"
|
|
|
- IsRenaming="{Binding IsRenaming, Mode=TwoWay}"
|
|
|
- PreviewImage="{Binding LayerBitmap}"
|
|
|
- LayerColor="{Binding LayerHighlightColor}"
|
|
|
- MoveToBackCommand="{Binding DataContext.LayersSubViewModel.MoveToBackCommand, ElementName=mainWindow}"
|
|
|
- MoveToFrontCommand="{Binding DataContext.LayersSubViewModel.MoveToFrontCommand, ElementName=mainWindow}">
|
|
|
- <vws:LayerItem.ContextMenu>
|
|
|
- <ContextMenu>
|
|
|
- <MenuItem Header="Delete"
|
|
|
- Command="{Binding PlacementTarget.Tag.LayersSubViewModel.DeleteLayersCommand,
|
|
|
- RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
-
|
|
|
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}" />
|
|
|
- <MenuItem Header="Rename"
|
|
|
- Command="{Binding PlacementTarget.Tag.LayersSubViewModel.RenameLayerCommand,
|
|
|
- RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}" />
|
|
|
- <MenuItem Header="Move to front"
|
|
|
- Command="{Binding PlacementTarget.Tag.LayersSubViewModel.MoveToFrontCommand,
|
|
|
- RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}" />
|
|
|
- <MenuItem Header="Move to back"
|
|
|
- Command="{Binding PlacementTarget.Tag.LayersSubViewModel.MoveToBackCommand,
|
|
|
- RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}" />
|
|
|
- <Separator/>
|
|
|
- <MenuItem Header="Merge selected"
|
|
|
- Command="{Binding PlacementTarget.Tag.LayersSubViewModel.MergeSelectedCommand,
|
|
|
- RelativeSource={RelativeSource AncestorType=ContextMenu}}"/>
|
|
|
- <MenuItem Header="Merge with above"
|
|
|
- Command="{Binding PlacementTarget.Tag.LayersSubViewModel.MergeWithAboveCommand,
|
|
|
- RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}" />
|
|
|
- <MenuItem Header="Merge with below"
|
|
|
- Command="{Binding PlacementTarget.Tag.LayersSubViewModel.MergeWithBelowCommand,
|
|
|
- RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
|
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
|
|
- Path=(ItemsControl.AlternationIndex)}" />
|
|
|
- </ContextMenu>
|
|
|
- </vws:LayerItem.ContextMenu>
|
|
|
- </vws:LayerItem>
|
|
|
- </DataTemplate>
|
|
|
- </ItemsControl.ItemTemplate>
|
|
|
- </ItemsControl>
|
|
|
- </ScrollViewer>
|
|
|
- </Grid>
|
|
|
+ <usercontrols:LayersManager LayersViewModel="{Binding LayersSubViewModel}"
|
|
|
+ BitmapManager="{Binding BitmapManager}"/>
|
|
|
</LayoutAnchorable>
|
|
|
</LayoutAnchorablePane>
|
|
|
</LayoutAnchorablePaneGroup>
|
|
@@ -418,22 +332,22 @@
|
|
|
<ColumnDefinition Width="290"/>
|
|
|
</Grid.ColumnDefinitions>
|
|
|
<DockPanel>
|
|
|
- <TextBlock Text="{Binding BitmapManager.SelectedTool.ActionDisplay}" Foreground="White" FontSize="15" Margin="10,0,0,0" VerticalAlignment="Center"/>
|
|
|
- <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
|
|
|
- <TextBlock Text="X:" Foreground="White" FontSize="16"/>
|
|
|
- <TextBlock Margin="4,0,10,0" Text="{Binding BitmapManager.ActiveDocument.MouseXOnCanvas, Converter={StaticResource DoubleToIntConverter}}" Foreground="White" FontSize="16"/>
|
|
|
- <TextBlock Text="Y:" Foreground="White" FontSize="16"/>
|
|
|
- <TextBlock Margin="4,0,10,0" Text="{Binding BitmapManager.ActiveDocument.MouseYOnCanvas, Converter={StaticResource DoubleToIntConverter}}" Foreground="White" FontSize="16"/>
|
|
|
- </StackPanel>
|
|
|
- </DockPanel>
|
|
|
- <StackPanel Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="3"
|
|
|
+ <TextBlock Text="{Binding BitmapManager.SelectedTool.ActionDisplay}" Foreground="White" FontSize="15" Margin="10,0,0,0" VerticalAlignment="Center"/>
|
|
|
+ <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
|
|
|
+ <TextBlock Text="X:" Foreground="White" FontSize="16"/>
|
|
|
+ <TextBlock Margin="4,0,10,0" Text="{Binding BitmapManager.ActiveDocument.MouseXOnCanvas, Converter={StaticResource DoubleToIntConverter}}" Foreground="White" FontSize="16"/>
|
|
|
+ <TextBlock Text="Y:" Foreground="White" FontSize="16"/>
|
|
|
+ <TextBlock Margin="4,0,10,0" Text="{Binding BitmapManager.ActiveDocument.MouseYOnCanvas, Converter={StaticResource DoubleToIntConverter}}" Foreground="White" FontSize="16"/>
|
|
|
+ </StackPanel>
|
|
|
+ </DockPanel>
|
|
|
+ <StackPanel Margin="10,0,0,0" VerticalAlignment="Center" Grid.Row="3"
|
|
|
Grid.Column="3" Orientation="Horizontal">
|
|
|
- <Button Style="{StaticResource BaseDarkButton}"
|
|
|
+ <Button Style="{StaticResource BaseDarkButton}"
|
|
|
Visibility="{Binding UpdateSubViewModel.UpdateReadyToInstall, Converter={StaticResource BoolToVisibilityConverter}}" FontSize="14" Height="20"
|
|
|
Command="{Binding UpdateSubViewModel.RestartApplicationCommand}">Restart</Button>
|
|
|
- <TextBlock VerticalAlignment="Center" Padding="10" HorizontalAlignment="Right"
|
|
|
+ <TextBlock VerticalAlignment="Center" Padding="10" HorizontalAlignment="Right"
|
|
|
Foreground="White" FontSize="14" Text="{Binding UpdateSubViewModel.VersionText}" />
|
|
|
- </StackPanel>
|
|
|
+ </StackPanel>
|
|
|
</Grid>
|
|
|
</Grid>
|
|
|
</Window>
|