From 9172e752e348feef65330b84e82e6fb3879dea2f Mon Sep 17 00:00:00 2001 From: John Colvin Date: Mon, 16 Sep 2024 12:43:59 -0400 Subject: [PATCH] ui: Highlight launcher buttons when selected Namely, the expandable menu buttons in Analytics shell module --- .../spark/core/FontsAndColors/BTSColors.cs | 2 ++ .../Converters/AnonymousValueConverter.cs | 8 ++++++ src/client/spark/view/Resources/Buttons.xaml | 25 ++++++++++++++++--- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/client/spark/core/FontsAndColors/BTSColors.cs b/src/client/spark/core/FontsAndColors/BTSColors.cs index 39932c762..c17c0c03b 100644 --- a/src/client/spark/core/FontsAndColors/BTSColors.cs +++ b/src/client/spark/core/FontsAndColors/BTSColors.cs @@ -755,6 +755,8 @@ namespace mbts.ui { public static BTSColor pressed_border => 0xff707070; public static BTSColor pressed_foreground => normal_foreground; + // Selected + public static BTSColor selected_background => input_selected_background; // Disabled public static BTSColor disabled_background => normal_background; diff --git a/src/client/spark/view/Converters/AnonymousValueConverter.cs b/src/client/spark/view/Converters/AnonymousValueConverter.cs index 91b3ce718..112d213ff 100644 --- a/src/client/spark/view/Converters/AnonymousValueConverter.cs +++ b/src/client/spark/view/Converters/AnonymousValueConverter.cs @@ -23,6 +23,14 @@ namespace mbts.ui.converters { }; } + public static IValueConverter CheckedStateNameConverter { get; } = + ValueConverter.create(isChecked => + isChecked switch { + true => "Checked", + false => "Unchecked", + _ => "Indeterminate", + }); + public static readonly IMultiValueConverter AreEqualConverter = new AreEqualConverter(); diff --git a/src/client/spark/view/Resources/Buttons.xaml b/src/client/spark/view/Resources/Buttons.xaml index 2d6554d92..40a2c4a0e 100644 --- a/src/client/spark/view/Resources/Buttons.xaml +++ b/src/client/spark/view/Resources/Buttons.xaml @@ -51,6 +51,13 @@ + + + + + + + @@ -718,15 +725,25 @@ - + - - - + + + + + + + +