Layers - Prevent brushes from going null when provider is missing

Layers - Set broken state when brush provider is missing
UI - Tweaked broken state visuals
This commit is contained in:
Robert committed 2023-04-14 11:56:51 +02:00
1 parent 2f270c9c03
commit 3b04447ff7
8 files changed
+83 -49

No files matched your search

@@ -54,7 +54,8 @@ public class ChangeLayerBrush : IProfileEditorCommand, IDisposable
/// <inheritdoc />
public void Undo()
{
_layer.ChangeLayerBrush(_previousBrush);
if (_previousBrush != null)
_layer.ChangeLayerBrush(_previousBrush);
_executed = false;
}
@@ -21,6 +21,7 @@
<!-- Custom styles -->
<StyleInclude Source="/Styles/Border.axaml" />
<StyleInclude Source="/Styles/BrokenState.axaml" />
<StyleInclude Source="/Styles/Skeleton.axaml" />
<StyleInclude Source="/Styles/Button.axaml" />
<StyleInclude Source="/Styles/Condensed.axaml" />
@@ -0,0 +1,20 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia">
<Design.PreviewWith>
<controls:HyperlinkButton Grid.Column="0" Classes="icon-button icon-button-small broken-state-button" Margin="50">
<avalonia:MaterialIcon Kind="AlertCircle" />
</controls:HyperlinkButton>
</Design.PreviewWith>
<!-- Add Styles Here -->
<Style Selector="controls|HyperlinkButton.broken-state-button avalonia|MaterialIcon">
<Setter Property="Foreground" Value="#E74C4C" />
</Style>
<Style Selector="controls|HyperlinkButton.broken-state-button:pointerover avalonia|MaterialIcon">
<Setter Property="Foreground" Value="#B93F3F" />
</Style>
</Styles>