1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 21:38:38 +00:00

Fixed color picker button

This commit is contained in:
Robert 2023-04-04 22:36:39 +02:00
parent 0116bac346
commit 73933ee324
3 changed files with 20 additions and 20 deletions

View File

@ -2,14 +2,17 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"> xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia">
<Design.PreviewWith> <Design.PreviewWith>
<Border Padding="20"> <Border Padding="20" Width="600" Height="600">
<Grid Height="24" ColumnDefinitions="*"> <Grid Height="24" ColumnDefinitions="*" Width="200">
<TextBox Classes="condensed" <TextBox Classes="condensed"
Text="#FFFF0000" Text="#FFFF0000"
Padding="2 2 30 2"> Padding="2 2 30 2"
>
</TextBox> </TextBox>
<controls:ColorPickerButton Classes="contained-color-picker-button" <controls:ColorPickerButton Classes="contained-color-picker-button"
ShowAcceptDismissButtons="False" /> Color="Red"
ShowAcceptDismissButtons="False"
/>
</Grid> </Grid>
</Border> </Border>
</Design.PreviewWith> </Design.PreviewWith>
@ -25,23 +28,21 @@
<Setter Property="HorizontalAlignment" Value="Right" /> <Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="Cursor" Value="Hand" /> <Setter Property="Cursor" Value="Hand" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <ControlTemplate>
<ControlTemplate> <Button Name="ShowFlyoutButton"
<Button Name="MainButton" CornerRadius="{TemplateBinding CornerRadius}"
Padding="0" HorizontalContentAlignment="Stretch"
BorderThickness="0" Padding="0">
CornerRadius="{TemplateBinding CornerRadius}"> <Grid ColumnDefinitions="*,Auto">
<Border BorderBrush="{DynamicResource ColorPickerButtonOutline}" <Border BorderBrush="{DynamicResource ColorPickerButtonOutline}"
BorderThickness="1" BorderThickness="1"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
MinWidth="18" MinHeight="18" MinWidth="18" MinHeight="18"
Background="{TemplateBinding Color, Converter={StaticResource ColorBrushConv}}" Background="{TemplateBinding Color, Converter={StaticResource ColorBrushConv}}"
CornerRadius="{TemplateBinding CornerRadius}"> CornerRadius="{TemplateBinding CornerRadius}"/>
<controls:FAColorPicker Name="ColorPicker" IsVisible="False" /> </Grid>
</Border> </Button>
</Button> </ControlTemplate>
</ControlTemplate>
</Setter.Value>
</Setter> </Setter>
</Style> </Style>

View File

@ -14,7 +14,7 @@
<shared:SKColorToColorConverter x:Key="SKColorToColorConverter" /> <shared:SKColorToColorConverter x:Key="SKColorToColorConverter" />
</UserControl.Resources> </UserControl.Resources>
<Grid Height="24" ColumnDefinitions="*"> <Grid Height="24" ColumnDefinitions="*">
<TextBox Classes="condensed" Padding="2 2 30 2" FontFamily="Consolas"> <TextBox Classes="condensed" Padding="2 2 30 2">
<Interaction.Behaviors> <Interaction.Behaviors>
<behaviors:LostFocusTextBoxBindingBehavior Text="{CompiledBinding InputValue, Converter={StaticResource SKColorToStringConverter}}" /> <behaviors:LostFocusTextBoxBindingBehavior Text="{CompiledBinding InputValue, Converter={StaticResource SKColorToStringConverter}}" />
</Interaction.Behaviors> </Interaction.Behaviors>
@ -22,6 +22,7 @@
<controls:ColorPickerButton Classes="contained-color-picker-button" <controls:ColorPickerButton Classes="contained-color-picker-button"
Color="{CompiledBinding InputValue, Converter={StaticResource SKColorToColorConverter}}" Color="{CompiledBinding InputValue, Converter={StaticResource SKColorToColorConverter}}"
ShowAcceptDismissButtons="False" ShowAcceptDismissButtons="False"
FlyoutPlacement="Right"
FlyoutOpened="ColorPickerButton_OnFlyoutOpened" FlyoutOpened="ColorPickerButton_OnFlyoutOpened"
FlyoutClosed="ColorPickerButton_OnFlyoutClosed" /> FlyoutClosed="ColorPickerButton_OnFlyoutClosed" />
</Grid> </Grid>

View File

@ -156,9 +156,7 @@
<TextBlock Grid.Row="0" Classes="h5 no-margin">Release notes</TextBlock> <TextBlock Grid.Row="0" Classes="h5 no-margin">Release notes</TextBlock>
<Separator Grid.Row="1" Classes="card-separator" /> <Separator Grid.Row="1" Classes="card-separator" />
<avalonia:MarkdownScrollViewer Grid.Row="2" Markdown="{CompiledBinding Changelog}"> <avalonia:MarkdownScrollViewer Grid.Row="2" Markdown="{CompiledBinding Changelog}" MarkdownStyleName="FluentAvalonia"/>
</avalonia:MarkdownScrollViewer>
</Grid> </Grid>
</Border> </Border>
</Grid> </Grid>