mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
261 lines
13 KiB
XML
261 lines
13 KiB
XML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:controls="clr-namespace:Artemis.VisualScripting.Editor.Controls"
|
|
xmlns:wrapper="clr-namespace:Artemis.VisualScripting.Editor.Controls.Wrapper"
|
|
xmlns:core="clr-namespace:Artemis.Core;assembly=Artemis.Core"
|
|
xmlns:s="https://github.com/canton7/Stylet">
|
|
|
|
<Style x:Key="StyleButtonPinsModify"
|
|
TargetType="Button">
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
|
<Setter Property="Width" Value="16" />
|
|
<Setter Property="Height" Value="16" />
|
|
<Setter Property="Margin" Value="0" />
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
<Setter Property="Padding" Value="2" />
|
|
<Setter Property="BorderThickness" Value="0" />
|
|
<Setter Property="BorderBrush" Value="Transparent" />
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="Foreground" Value="#FFA0A0A0" />
|
|
<Setter Property="FontFamily" Value="Webdings" />
|
|
<Setter Property="Content" Value="r" />
|
|
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border Padding="{TemplateBinding Padding}"
|
|
Background="{TemplateBinding Background}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
BorderBrush="{TemplateBinding BorderBrush}">
|
|
<TextBlock Text="{TemplateBinding Content}" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
|
|
<Style.Triggers>
|
|
<Trigger Property="HorizontalAlignment" Value="Left">
|
|
<Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
|
|
<Setter Property="RenderTransform">
|
|
<Setter.Value>
|
|
<RotateTransform Angle="45" />
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
|
|
<Trigger Property="HorizontalAlignment" Value="Right">
|
|
<Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
|
|
<Setter Property="RenderTransform">
|
|
<Setter.Value>
|
|
<RotateTransform Angle="45" />
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Foreground" Value="#FFFFFFFF" />
|
|
</Trigger>
|
|
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Setter Property="Foreground" Value="#FFFFA0A0" />
|
|
</Trigger>
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Visibility" Value="Hidden" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<Style x:Key="StylePinListInput"
|
|
TargetType="ItemsControl">
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
|
|
|
<Setter Property="ItemTemplate">
|
|
<Setter.Value>
|
|
<DataTemplate DataType="{x:Type core:Pin}">
|
|
<controls:VisualScriptPinPresenter Margin="0,5,0,3"
|
|
Pin="{Binding .}" />
|
|
</DataTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="StylePinListOutput"
|
|
TargetType="ItemsControl">
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Right" />
|
|
|
|
<Setter Property="ItemTemplate">
|
|
<Setter.Value>
|
|
<DataTemplate DataType="{x:Type core:Pin}">
|
|
<controls:VisualScriptPinPresenter Margin="0,5,0,3"
|
|
Pin="{Binding .}" />
|
|
</DataTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="StylePinCollectionListInput"
|
|
TargetType="ItemsControl">
|
|
|
|
<Setter Property="ItemTemplate">
|
|
<Setter.Value>
|
|
<DataTemplate DataType="{x:Type wrapper:VisualScriptPinCollection}">
|
|
<StackPanel Margin="0,2" Orientation="Vertical">
|
|
<TextBlock Text="{Binding PinCollection.Name}" Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type controls:VisualScriptNodePresenter}}}" />
|
|
<ItemsControl Margin="0,5"
|
|
Style="{StaticResource StylePinListInput}"
|
|
ItemsSource="{Binding Pins}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate DataType="{x:Type core:Pin}">
|
|
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Margin="0 8 0 0">
|
|
<controls:VisualScriptPinPresenter Pin="{Binding .}" Margin="0 0 2 0" />
|
|
<Button Style="{StaticResource StyleButtonPinsModify}"
|
|
Command="{Binding DataContext.RemovePinCommand, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"
|
|
CommandParameter="{Binding .}" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
<Button HorizontalAlignment="Left"
|
|
Margin="0,0,0,0"
|
|
Style="{StaticResource StyleButtonPinsModify}"
|
|
Command="{Binding AddPinCommand}" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="StylePinCollectionListOutput"
|
|
TargetType="ItemsControl">
|
|
|
|
<Setter Property="ItemTemplate">
|
|
<Setter.Value>
|
|
<DataTemplate DataType="{x:Type wrapper:VisualScriptPinCollection}">
|
|
<StackPanel Margin="0,4" Orientation="Vertical">
|
|
<TextBlock Text="{Binding PinCollection.Name}" Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type controls:VisualScriptNodePresenter}}}" />
|
|
<ItemsControl Margin="0,4"
|
|
Style="{StaticResource StylePinListOutput}"
|
|
ItemsSource="{Binding Pins}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate DataType="{x:Type core:Pin}">
|
|
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
|
<Button Style="{StaticResource StyleButtonPinsModify}"
|
|
Command="{Binding DataContext.RemovePinCommand, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"
|
|
CommandParameter="{Binding .}" />
|
|
<controls:VisualScriptPinPresenter Margin="-3,5,0,3"
|
|
Pin="{Binding .}" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
<Button HorizontalAlignment="Right"
|
|
Margin="0,0,0,0"
|
|
Style="{StaticResource StyleButtonPinsModify}"
|
|
Command="{Binding AddPinCommand}" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<ControlTemplate x:Key="TemplateVisualScriptNodePresenter"
|
|
TargetType="{x:Type controls:VisualScriptNodePresenter}">
|
|
<Border BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
Background="{TemplateBinding Background}">
|
|
<StackPanel>
|
|
<Border x:Name="BrdHeader"
|
|
VerticalAlignment="Stretch"
|
|
Height="24"
|
|
Background="{TemplateBinding TitleBrush}">
|
|
<DockPanel>
|
|
<Border DockPanel.Dock="Right" Width="24">
|
|
<Button Style="{StaticResource StyleButtonPinsModify}"
|
|
Command="{Binding Node.RemoveCommand, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
</Border>
|
|
<Border DockPanel.Dock="Left" Width="24">
|
|
<!-- Placeholder -->
|
|
</Border>
|
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"
|
|
FontFamily="{TemplateBinding FontFamily}"
|
|
FontSize="14" FontWeight="Bold"
|
|
Text="{Binding Node.Node.Name, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
</DockPanel>
|
|
</Border>
|
|
|
|
<Border x:Name="BrdContent"
|
|
Padding="{TemplateBinding Padding}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" MinWidth="8" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Border x:Name="BrdInputPins" Grid.Column="0">
|
|
<StackPanel Orientation="Vertical">
|
|
<ItemsControl Style="{StaticResource StylePinListInput}"
|
|
ItemsSource="{Binding Node.InputPins, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
|
|
<ItemsControl Style="{StaticResource StylePinCollectionListInput}"
|
|
ItemsSource="{Binding Node.InputPinCollections, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<Border x:Name="BrdCustomView" Grid.Column="1">
|
|
<ContentControl s:View.Model="{TemplateBinding CustomViewModel}" />
|
|
</Border>
|
|
|
|
<Border x:Name="BrdOutputPins" Grid.Column="2">
|
|
<StackPanel Orientation="Vertical">
|
|
<ItemsControl Style="{StaticResource StylePinListOutput}"
|
|
ItemsSource="{Binding Node.OutputPins, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
|
|
<ItemsControl Style="{StaticResource StylePinCollectionListOutput}"
|
|
ItemsSource="{Binding Node.OutputPinCollections, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
</StackPanel>
|
|
</Border>
|
|
</Grid>
|
|
</Border>
|
|
</StackPanel>
|
|
</Border>
|
|
</ControlTemplate>
|
|
|
|
<Style x:Key="StyleVisualScriptNodePresenter"
|
|
TargetType="{x:Type controls:VisualScriptNodePresenter}">
|
|
|
|
<Setter Property="Padding" Value="8,10" />
|
|
|
|
<Setter Property="Foreground" Value="#FFFFFFFF" />
|
|
|
|
<Setter Property="Background" Value="#80101010" />
|
|
<Setter Property="TitleBrush" Value="#FF444444" />
|
|
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
<Setter Property="BorderBrush" Value="#FF000000" />
|
|
|
|
<Setter Property="Template" Value="{StaticResource TemplateVisualScriptNodePresenter}" />
|
|
|
|
<Setter Property="RenderTransform">
|
|
<Setter.Value>
|
|
<TranslateTransform X="{Binding Node.X, RelativeSource={RelativeSource AncestorType={x:Type controls:VisualScriptNodePresenter}}}"
|
|
Y="{Binding Node.Y, RelativeSource={RelativeSource AncestorType={x:Type controls:VisualScriptNodePresenter}}}" />
|
|
</Setter.Value>
|
|
</Setter>
|
|
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Node.IsSelected, RelativeSource={RelativeSource Self}}" Value="True">
|
|
<Setter Property="BorderBrush" Value="#FFFFFFFF" />
|
|
<Setter Property="Background" Value="#A0101010" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<Style BasedOn="{StaticResource StyleVisualScriptNodePresenter}"
|
|
TargetType="{x:Type controls:VisualScriptNodePresenter}" />
|
|
|
|
</ResourceDictionary> |