Write the disabled accent glow as 'none', which this Avalonia can parse

This commit is contained in:
2026-08-07 18:12:13 +02:00
parent 06f9dcfc27
commit 369109dd4e
+9 -3
View File
@@ -233,14 +233,20 @@
BoxShadow is cleared here too, and that is new alongside the gradient: the base rule now sets a glow BoxShadow is cleared here too, and that is new alongside the gradient: the base rule now sets a glow
that reads as "this is lit and wants pressing", which is the opposite of what a disabled control that reads as "this is lit and wants pressing", which is the opposite of what a disabled control
should say. Left unset it would still apply — the base rule's Setter is still in effect wherever a should say. Left unset it would still apply — the base rule's Setter is still in effect wherever a
more specific one does not override it — so the glow has to be named here, as the empty string more specific one does not override it — so the glow has to be named here, as "none", to go away.
BoxShadows parses to "no shadows", to go away.
◆ "none" RATHER THAN THE EMPTY STRING. The remark this replaced claimed an empty string parses to "no
shadows", and it does not on the Avalonia this project builds against — BoxShadowsTypeConverter throws
an InvalidCastException on it instead, which failed silently at style-sheet load time in nothing that
exercises this rule's own screen and loudly in every headless layout test that lays out any window at
all, because Application.Styles is global. "none" is the literal this converter does accept for an
empty BoxShadows.
--> -->
<Style Selector="Button.accent:disabled /template/ ContentPresenter#PART_ContentPresenter"> <Style Selector="Button.accent:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="{StaticResource BorderFaint}" /> <Setter Property="BorderBrush" Value="{StaticResource BorderFaint}" />
<Setter Property="BorderThickness" Value="1" /> <Setter Property="BorderThickness" Value="1" />
<Setter Property="BoxShadow" Value="" /> <Setter Property="BoxShadow" Value="none" />
<Setter Property="Foreground" Value="{StaticResource TextFaint}" /> <Setter Property="Foreground" Value="{StaticResource TextFaint}" />
</Style> </Style>