mirror of
https://github.com/AtomUI/AtomUI.git
synced 2026-10-21 08:32:21 +08:00
Fix ColorPicker ColorPickerPaletteGroup bug
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
using System.Reactive.Disposables;
|
||||
using AtomUI.Controls.ColorPickerLang;
|
||||
using AtomUI.Controls.Themes;
|
||||
using AtomUI.Data;
|
||||
using AtomUI.Theme;
|
||||
using AtomUI.Theme.Data;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Converters;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Data;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.VisualTree;
|
||||
|
||||
@@ -187,6 +182,8 @@ public class ColorPicker : AbstractColorPicker
|
||||
_presenter = presenter;
|
||||
_presenter.ValueChanged += HandleColorPickerViewValueChanged;
|
||||
_presenter.ColorValueCleared += HandleColorCleared;
|
||||
var effectiveColor = Value ?? DefaultValue;
|
||||
_presenter.SetCurrentValue(ColorPickerView.ValueProperty, effectiveColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,18 +198,6 @@ public class ColorPicker : AbstractColorPicker
|
||||
_latestSyncValue = args.NewColor;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void NotifyFlyoutOpened()
|
||||
{
|
||||
if (PickerFlyout is ColorPickerFlyout colorPickerFlyout)
|
||||
{
|
||||
var effectiveColor = Value ?? DefaultValue;
|
||||
if (effectiveColor != null)
|
||||
{
|
||||
colorPickerFlyout.SetCurrentValue(ColorPickerFlyout.ValueProperty, effectiveColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void NotifyFlyoutClosed()
|
||||
{
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
PaletteGroup="{TemplateBinding PaletteGroup}"
|
||||
IsVisible="{TemplateBinding IsPaletteGroupEnabled}"
|
||||
IsMotionEnabled="{TemplateBinding IsMotionEnabled}"/>
|
||||
<Rectangle Name="Separator" VerticalAlignment="Stretch" Width="1" />
|
||||
<Rectangle Name="Separator"
|
||||
VerticalAlignment="Stretch" Width="1"
|
||||
IsVisible="{TemplateBinding IsPaletteGroupEnabled}"/>
|
||||
<StackPanel Orientation="Vertical" ClipToBounds="False"
|
||||
Spacing="{DynamicResource {x:Static atom:SharedTokenKey.SpacingXS}}">
|
||||
<atom:ColorBlock Name="{x:Static atom:ColorPickerViewThemeConstants.ClearColorPart}"
|
||||
|
||||
Reference in New Issue
Block a user