mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Gradient editor - WIP commit
This commit is contained in:
1 parent
38b6ca32a3
commit
98294956b1
10 files changed
+217
-68
No files matched your search
@@ -13,7 +13,6 @@
|
||||
Title="Gradient Editor"
|
||||
Background="{DynamicResource MaterialDesignPaper}"
|
||||
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
|
||||
UseLayoutRounding="True"
|
||||
Width="500"
|
||||
Height="600"
|
||||
ResizeMode="NoResize"
|
||||
@@ -42,20 +41,24 @@
|
||||
<TextBlock Margin="15 15 0 0">Gradient</TextBlock>
|
||||
<Separator Margin="15 5" />
|
||||
|
||||
<ItemsControl ItemsSource="{Binding ColorGradient.Colors, Mode=OneWay}" ClipToBounds="False" Margin="15 0">
|
||||
<ItemsControl ItemsSource="{Binding ColorGradient.Colors}" ClipToBounds="False" Margin="15 0">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<Canvas Height="60" Width="435" x:Name="PreviewCanvas" >
|
||||
<Canvas Height="60" Width="437" x:Name="PreviewCanvas">
|
||||
<Canvas.Background>
|
||||
<VisualBrush Stretch="None" AlignmentY="Top">
|
||||
<VisualBrush.Visual>
|
||||
<Border Width="{Binding ActualWidth, ElementName=PreviewCanvas}" Height="50">
|
||||
<Rectangle x:Name="Preview" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
||||
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Margin="15">
|
||||
<Rectangle x:Name="Preview"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
Width="{Binding ActualWidth, ElementName=PreviewCanvas}"
|
||||
Height="35">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush GradientStops="{Binding ColorGradient, Mode=OneWay, Converter={StaticResource ColorGradientToGradientStopsConverter}}" />
|
||||
<LinearGradientBrush GradientStops="{Binding ColorGradient.Colors, Converter={StaticResource ColorGradientToGradientStopsConverter}}" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
</Border>
|
||||
</materialDesign:Card>
|
||||
</VisualBrush.Visual>
|
||||
</VisualBrush>
|
||||
</Canvas.Background>
|
||||
@@ -64,16 +67,18 @@
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemContainerStyle>
|
||||
<Style TargetType="ContentPresenter">
|
||||
<Setter Property="Canvas.Top" Value="50" />
|
||||
<Setter Property="Canvas.Top" Value="40" />
|
||||
</Style>
|
||||
</ItemsControl.ItemContainerStyle>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<local:GradientEditorColor GradientColor="{Binding}"></local:GradientEditorColor>
|
||||
<local:GradientEditorColor
|
||||
ColorGradient="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=controls:MaterialWindow}, Path=ColorGradient}"
|
||||
GradientColor="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
|
||||
<TextBlock Margin="15 15 0 0">Stops</TextBlock>
|
||||
<Separator Margin="15 5" />
|
||||
|
||||
|
||||
Reference in new issue
Block a user