fix (ui): Use 'opacity' to indicate enabled/disabled in spark menu

Bugs (fixed):
   * SparkMenuItems sometimes look disabled when they aren't (esp in
   AnalyticsExpirationParameters win)

In wpf, VisualStates in different VisualStateGroups shouldn't adjust
common properties.  A visual element can only be in 1 visual state at a
time.  When a visual element transitions to a new visual state, all
depepdency property changes associated with the transition to the
previous state are cleared.
This commit is contained in:
John Colvin committed 2022-05-02 17:29:29 -04:00
1 parent 18793f8cd9
commit cd23c1a5a1
1 file changed
+4 -15
@@ -25,6 +25,7 @@
MinWidth="150"
BorderBrush="{u:BTSColor UI.Button.normal_border}"
Background="{u:BTSColor UI.spark_menu_background}"
Opacity="1"
ToolTipService.InitialShowDelay="30000">
<u:StateManager.Groups>
@@ -144,24 +145,12 @@
</VisualState>
</VisualStateGroup>
<VisualStateGroup Name="DisabledStates">
<VisualState Name="Enabled" />
<VisualStateGroup Name="CommonStates">
<VisualState Name="Normal" />
<VisualState Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="launcher_button_border"
Storyboard.TargetProperty="(Control.Background)">
<DiscreteObjectKeyFrame
Value="{x:Static spark_menu_background_brush, MemberType={u:Nested u:BTSColors.UI}}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="launcher_button_border"
Storyboard.TargetProperty="(Control.Foreground)">
<DiscreteObjectKeyFrame
Value="{x:Static disabled_foreground_brush, MemberType={u:Nested u:BTSColors.UI.Button}}" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames
Storyboard.TargetName="launcher_menu_item_icon"
Storyboard.TargetName="launcher_button_border"
Storyboard.TargetProperty="(UIElement.Opacity)">
<DiscreteDoubleKeyFrame Value="0.4" />
</DoubleAnimationUsingKeyFrames>