Noise brush - Added option to map noise to a gradient

Color brush - Only show gradient/color option when applicable
Gradient picker - Design tweaks
This commit is contained in:
SpoinkyNL committed 2020-04-17 11:27:12 +02:00
1 parent d647dfbd53
commit e863652b08
10 files changed
+201 -82

No files matched your search

@@ -27,7 +27,7 @@ namespace Artemis.UI.Shared.Controls
_backingStore = new DrawingGroup();
_deviceVisualizerLeds = new List<DeviceVisualizerLed>();
SubscribeToSurfaceUpdate();
RGBSurface.Instance.Updated += RgbSurfaceOnUpdated;
Unloaded += (sender, args) => Dispose();
}
@@ -131,12 +131,7 @@ namespace Artemis.UI.Shared.Controls
bitmapBrush.Freeze();
_backingStore.OpacityMask = bitmapBrush;
}
private void SubscribeToSurfaceUpdate()
{
RGBSurface.Instance.Updated += RgbSurfaceOnUpdated;
}
private void RgbSurfaceOnUpdated(UpdatedEventArgs e)
{
Dispatcher.Invoke(() =>
@@ -35,16 +35,15 @@
</UserControl.Resources>
<Border Height="15"
CornerRadius="5"
Margin="0,0,0,2"
BorderBrush="{DynamicResource NormalBorderBrush}"
BorderThickness="1"
HorizontalAlignment="Stretch"
Background="{StaticResource Checkerboard}">
<Ellipse Stroke="{DynamicResource NormalBorderBrush}" Cursor="Hand" MouseUp="UIElement_OnMouseUp">
<Ellipse.Fill>
<LinearGradientBrush
GradientStops="{Binding ColorGradient.Stops, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Converter={StaticResource ColorGradientToGradientStopsConverter}}" />
</Ellipse.Fill>
</Ellipse>
<Rectangle Stroke="{DynamicResource NormalBorderBrush}" Cursor="Hand" MouseUp="UIElement_OnMouseUp">
<Rectangle.Fill>
<LinearGradientBrush GradientStops="{Binding ColorGradient.Stops, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Converter={StaticResource ColorGradientToGradientStopsConverter}}" />
</Rectangle.Fill>
</Rectangle>
</Border>
</UserControl>
@@ -15,7 +15,7 @@
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
Width="500"
Height="600"
Height="500"
ResizeMode="NoResize"
Icon="/Resources/Images/Logo/logo-512.png"
FadeContentIfInactive="False"
@@ -26,9 +26,13 @@
<converters:ColorGradientToGradientStopsConverter x:Key="ColorGradientToGradientStopsConverter" />
<converters:SKColorToColorConverter x:Key="SKColorToColorConverter" />
</controls:MaterialWindow.Resources>
<StackPanel>
<materialDesign:Card Margin="15 15 15 7" Padding="15">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="16">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<materialDesign:Card Grid.Row="0" Margin="15 15 15 7" Padding="15" >
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="16">
<materialDesign:PackIcon Kind="Crane" Width="80" Height="80" HorizontalAlignment="Center" />
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" TextWrapping="Wrap" HorizontalAlignment="Center">
Gradient saving not implemented yet
@@ -39,7 +43,7 @@
</StackPanel>
</materialDesign:Card>
<materialDesign:Card Margin="15 7 15 15" ClipToBounds="False">
<materialDesign:Card Grid.Row="1" Margin="15 7 15 15" ClipToBounds="False">
<StackPanel ClipToBounds="False">
<TextBlock Margin="15 15 0 0">Gradient</TextBlock>
<Separator Margin="15 5" />
@@ -106,6 +110,6 @@
</Button>
</Grid>
</StackPanel>
</materialDesign:Card>
</StackPanel>
</materialDesign:Card >
</Grid>
</controls:MaterialWindow>