Skip to content

Commit

Permalink
All themed controls now have a nice looking tab navigation focus ador…
Browse files Browse the repository at this point in the history
…ner style + misc fixes
  • Loading branch information
flarive committed Dec 26, 2023
1 parent 4fb8d12 commit 3edbcf3
Show file tree
Hide file tree
Showing 32 changed files with 505 additions and 385 deletions.
8 changes: 6 additions & 2 deletions Avalonia.Themes.Neumorphism/Accents/BaseColorsPalette.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<Color x:Key="MaterialDesignBodyLight">#89000000</Color>
<Color x:Key="MaterialDesignColumnHeader">#BC000000</Color>
<Color x:Key="MaterialDesignCheckBoxOff">#89000000</Color>
<Color x:Key="MaterialDesignCheckBoxDisabled">#FFCFD4DA</Color>

<Color x:Key="MaterialDesignTextBoxBorder">#89000000</Color>
<Color x:Key="MaterialDesignDivider">#1F000000</Color>
<Color x:Key="MaterialDesignSelection">#44888b8f</Color>
Expand All @@ -68,6 +68,8 @@
<Color x:Key="MaterialDesignShadowLight">#CCFFFFFF</Color>
<Color x:Key="MaterialDesignShadowDark">#33000000</Color>
<Color x:Key="MaterialDesignBorderShadow">#66C4C7CB</Color>
<Color x:Key="MaterialDesignDisabled">#FFCFD4DA</Color>

<Color x:Key="MaterialDesignDisabledNoTransparency">#FFD3D8DE</Color>
<Color x:Key="MaterialDesignTransparent">#00FFFFFF</Color>
<Color x:Key="MaterialDesignSilverGray">#CCCCCCCC</Color>
Expand Down Expand Up @@ -121,7 +123,7 @@
<Color x:Key="MaterialDesignBodyLight">#89FFFFFF</Color>
<Color x:Key="MaterialDesignColumnHeader">#BCFFFFFF</Color>
<Color x:Key="MaterialDesignCheckBoxOff">#89FFFFFF</Color>
<Color x:Key="MaterialDesignCheckBoxDisabled">#FF647076</Color>

<Color x:Key="MaterialDesignTextBoxBorder">#89FFFFFF</Color>
<Color x:Key="MaterialDesignDivider">#1FFFFFFF</Color>
<Color x:Key="MaterialDesignSelection">#44888b8f</Color>
Expand All @@ -143,6 +145,8 @@
<Color x:Key="MaterialDesignShadowLight">#22FFFFFF</Color>
<Color x:Key="MaterialDesignShadowDark">#88000000</Color>
<Color x:Key="MaterialDesignBorderShadow">#FF404548</Color>
<Color x:Key="MaterialDesignDisabled">#FF647076</Color>

<Color x:Key="MaterialDesignDisabledNoTransparency">#FF42464A</Color>
<Color x:Key="MaterialDesignTransparent">#00FFFFFF</Color>
<Color x:Key="MaterialDesignSilverGray">#44333333</Color>
Expand Down
2 changes: 1 addition & 1 deletion Avalonia.Themes.Neumorphism/Accents/SystemAccentColors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal class SystemAccentColors : IResourceProvider
public const string MaterialDesignBodyLightKey = "MaterialDesignBodyLight";
public const string MaterialDesignColumnHeaderKey = "MaterialDesignColumnHeader";
public const string MaterialDesignCheckBoxOffKey = "MaterialDesignCheckBoxOff";
public const string MaterialDesignCheckBoxDisabledKey = "MaterialDesignCheckBoxDisabled";
public const string MaterialDesignDisabledKey = "MaterialDesignDisabled";
public const string MaterialDesignTextBoxBorderKey = "MaterialDesignTextBoxBorder";
public const string MaterialDesignDividerKey = "MaterialDesignDivider";
public const string MaterialDesignSelectionKey = "MaterialDesignSelection";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>0.9.0</Version>
<Version>0.10.0</Version>
<Title>Neumorphism.Avalonia</Title>
<Authors>Eviral</Authors>
<Company>Eviral</Company>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ public Color Accent
public Color MaterialDesignCheckBoxOff { get => GetColor("MaterialDesignCheckBoxOff"); set => SetColor("MaterialDesignCheckBoxOff", value); }

/// <summary>
/// Gets or sets the MaterialDesignCheckBoxDisabled color value.
/// Gets or sets the MaterialDesignDisabled color value.
/// </summary>
public Color MaterialDesignCheckBoxDisabled { get => GetColor("MaterialDesignCheckBoxDisabled"); set => SetColor("MaterialDesignCheckBoxDisabled", value); }
public Color MaterialDesignDisabled { get => GetColor("MaterialDesignDisabled"); set => SetColor("MaterialDesignDisabled", value); }

/// <summary>
/// Gets or sets the MaterialDesignTextBoxBorder color value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@

<DockPanel Name="{x:Static naming:PartNames.PartHeaderPanel}">

<Button Theme="{StaticResource ButtonIcon}" Width="90" Height="90" IsHitTestVisible="False" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
<Button Theme="{StaticResource ButtonIcon}" Width="90" Height="90" IsHitTestVisible="False"
Focusable="False"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center">

<ContentPresenter Name="{x:Static naming:PartNames.PartHeaderIcon}"
Content="{CompiledBinding DialogIcon}"
Expand Down
4 changes: 3 additions & 1 deletion Avalonia.Themes.Neumorphism/Themes/AdornerLayer.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

<!-- Neumorphism theme ok -->


<!--Default focus adorner that should fit most common cases-->
<ControlTheme x:Key="{x:Type AdornerLayer}" TargetType="AdornerLayer">
<Setter Property="DefaultFocusAdorner">
<FocusAdornerTemplate>
<Border BorderThickness="1" CornerRadius="{Binding $self.(AdornerLayer.AdornedElement).(Border.CornerRadius)}"
BorderBrush="{DynamicResource MaterialDesignFocus}" Margin="0">
</Border>
</Border>
</FocusAdornerTemplate>
</Setter>
</ControlTheme>
Expand Down
14 changes: 7 additions & 7 deletions Avalonia.Themes.Neumorphism/Themes/ButtonSpinner.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Foreground" Value="{DynamicResource PrimaryHueMidForegroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaBorder}" />

<Style Selector="^ /template/ RepeatButton#PART_IncreaseButton">
<Setter Property="Content">
<Template>
Expand Down Expand Up @@ -84,6 +83,7 @@

<Style Selector="^:right">
<Setter Property="Margin" Value="10,0,0,0"/>
<Setter Property="Focusable" Value="False" />
<Setter Property="Template">
<ControlTemplate>
<Border Name="border"
Expand All @@ -103,12 +103,12 @@
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Padding="{TemplateBinding Padding}" />
<Grid Grid.Column="1" RowDefinitions="*,*" IsVisible="{TemplateBinding ShowButtonSpinner}" Width="30">
<RepeatButton assist:ButtonAssist.CornerRadius="0" Theme="{StaticResource RepeatButtonMaterial}"
<RepeatButton assist:ButtonAssist.CornerRadius="0" Theme="{StaticResource RepeatButtonMaterial}" Focusable="{TemplateBinding Focusable}"
Background="Transparent"
assist:ShadowAssist.ShadowDepth="Depth0"
Grid.Row="0"
Name="PART_IncreaseButton" />
<RepeatButton assist:ButtonAssist.CornerRadius="0" Theme="{StaticResource RepeatButtonMaterial}"
<RepeatButton assist:ButtonAssist.CornerRadius="0" Theme="{StaticResource RepeatButtonMaterial}" Focusable="{TemplateBinding Focusable}"
assist:ShadowAssist.ShadowDepth="Depth0"
Background="Transparent"
Grid.Row="1"
Expand All @@ -122,6 +122,7 @@

<Style Selector="^:left">
<Setter Property="Margin" Value="0,0,10,0"/>
<Setter Property="Focusable" Value="False" />
<Setter Property="Template">
<ControlTemplate>
<Border Name="border"
Expand All @@ -133,12 +134,12 @@
VerticalAlignment="{TemplateBinding VerticalAlignment}">
<Grid ColumnDefinitions="Auto,*">
<Grid Grid.Column="0" RowDefinitions="*,*" IsVisible="{TemplateBinding ShowButtonSpinner}" Width="30">
<RepeatButton assist:ButtonAssist.CornerRadius="0" Theme="{StaticResource RepeatButtonMaterial}"
<RepeatButton assist:ButtonAssist.CornerRadius="0" Theme="{StaticResource RepeatButtonMaterial}" Focusable="{TemplateBinding Focusable}"
assist:ShadowAssist.ShadowDepth="Depth0"
Background="Transparent"
Grid.Row="0"
Name="PART_IncreaseButton" />
<RepeatButton assist:ButtonAssist.CornerRadius="0" Theme="{StaticResource RepeatButtonMaterial}"
<RepeatButton assist:ButtonAssist.CornerRadius="0" Theme="{StaticResource RepeatButtonMaterial}" Focusable="{TemplateBinding Focusable}"
assist:ShadowAssist.ShadowDepth="Depth0"
Background="Transparent"
Grid.Row="1"
Expand All @@ -156,6 +157,5 @@
</ControlTemplate>
</Setter>
</Style>

</ControlTheme>
</ResourceDictionary>
</ResourceDictionary>
Loading

0 comments on commit 3edbcf3

Please sign in to comment.