fix: fix toggle style.
This commit is contained in:
parent
f3bb040dc9
commit
03e9056c82
@ -15,6 +15,7 @@
|
|||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceInclude Source="../Themes/ToggleButton.axaml" />
|
||||||
<ResourceInclude Source="../Controls/ColorItemControl.axaml" />
|
<ResourceInclude Source="../Controls/ColorItemControl.axaml" />
|
||||||
<ResourceInclude Source="../Controls/ColorDetailControl.axaml" />
|
<ResourceInclude Source="../Controls/ColorDetailControl.axaml" />
|
||||||
<ResourceInclude Source="../Controls/FunctionalColorGroupControl.axaml" />
|
<ResourceInclude Source="../Controls/FunctionalColorGroupControl.axaml" />
|
||||||
@ -34,18 +35,19 @@
|
|||||||
Name="toggle"
|
Name="toggle"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
IsChecked="True"
|
IsChecked="True"
|
||||||
Theme="{DynamicResource BorderlessToggleButton}">
|
Theme="{DynamicResource SplitViewToggleButton}" />
|
||||||
<PathIcon
|
|
||||||
Width="16"
|
|
||||||
Height="16"
|
|
||||||
Data="M5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5C2 3.34315 3.34315 2 5 2ZM6 4C5.44772 4 5 4.44772 5 5V19C5 19.5523 5.44772 20 6 20H9C9.55229 20 10 19.5523 10 19V5C10 4.44772 9.55229 4 9 4H6Z" />
|
|
||||||
</ToggleButton>
|
|
||||||
<Border IsVisible="{Binding #splitView.IsPaneOpen}" Theme="{DynamicResource CardBorder}">
|
<Border IsVisible="{Binding #splitView.IsPaneOpen}" Theme="{DynamicResource CardBorder}">
|
||||||
<controls:ColorDetailControl
|
<Panel>
|
||||||
Background="{Binding SelectedColor.Brush}"
|
<TextBlock
|
||||||
IsVisible="{Binding SelectedColor, Converter={x:Static ObjectConverters.IsNotNull}}"
|
IsVisible="{Binding SelectedColor, Converter={x:Static ObjectConverters.IsNull}}"
|
||||||
ResourceKey="{Binding SelectedColor.ResourceKey}"
|
Text="Click on Color to Check Details"
|
||||||
ResourceName="{Binding SelectedColor.ColorDisplayName}" />
|
TextWrapping="Wrap" />
|
||||||
|
<controls:ColorDetailControl
|
||||||
|
Background="{Binding SelectedColor.Brush}"
|
||||||
|
IsVisible="{Binding SelectedColor, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||||
|
ResourceKey="{Binding SelectedColor.ResourceKey}"
|
||||||
|
ResourceName="{Binding SelectedColor.ColorDisplayName}" />
|
||||||
|
</Panel>
|
||||||
</Border>
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</SplitView.Pane>
|
</SplitView.Pane>
|
||||||
|
@ -3,6 +3,7 @@ using Avalonia;
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Primitives;
|
using Avalonia.Controls.Primitives;
|
||||||
using Avalonia.Markup.Xaml;
|
using Avalonia.Markup.Xaml;
|
||||||
|
using Avalonia.Threading;
|
||||||
using Semi.Avalonia.Demo.ViewModels;
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
@ -19,7 +20,10 @@ public partial class PaletteDemo : UserControl
|
|||||||
{
|
{
|
||||||
base.OnApplyTemplate(e);
|
base.OnApplyTemplate(e);
|
||||||
PaletteDemoViewModel? vm = new PaletteDemoViewModel();
|
PaletteDemoViewModel? vm = new PaletteDemoViewModel();
|
||||||
vm.InitializeResources();
|
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
|
{
|
||||||
|
vm.InitializeResources();
|
||||||
|
});
|
||||||
DataContext = vm;
|
DataContext = vm;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -29,4 +29,29 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme x:Key="SplitViewToggleButton" TargetType="ToggleButton">
|
||||||
|
<Setter Property="ToggleButton.Template">
|
||||||
|
<ControlTemplate TargetType="ToggleButton">
|
||||||
|
<Border
|
||||||
|
Name="Background"
|
||||||
|
Padding="8"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
CornerRadius="3">
|
||||||
|
<PathIcon
|
||||||
|
Name="Icon"
|
||||||
|
Width="16"
|
||||||
|
Height="16"
|
||||||
|
Data="M5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5C2 3.34315 3.34315 2 5 2ZM6 4C5.44772 4 5 4.44772 5 5V19C5 19.5523 5.44772 20 6 20H9C9.55229 20 10 19.5523 10 19V5C10 4.44772 9.55229 4 9 4H6Z"
|
||||||
|
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
<Style Selector="^:pointerover">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:pressed">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user