From baa66fc55162c5fd61ef3a3c8fdee1c6c5363fe1 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 5 Nov 2018 16:28:25 -0600 Subject: [PATCH] Select an enabled panel in the panel color UI by default. This fixes the default always being up-left (which is usually disabled), causing the color slider to not do anything until you select a different panel. --- smx-config/Widgets.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/smx-config/Widgets.cs b/smx-config/Widgets.cs index 08e1b39..58b9f85 100644 --- a/smx-config/Widgets.cs +++ b/smx-config/Widgets.cs @@ -455,6 +455,20 @@ namespace smx_config bool[] enabledPanels = config.GetEnabledPanels(); Visibility = enabledPanels[PanelIndex]? Visibility.Visible:Visibility.Hidden; + // If this panel is selected but its panel isn't enabled, try to select a + // different panel. + if(!enabledPanels[PanelIndex] && IsSelected) + { + for(int panel = 0; panel < 9; ++panel) + { + if(enabledPanels[panel]) + { + SelectedPanel = panel; + break; + } + } + } + Color rgb = Helpers.UnscaleColor(Color.FromRgb( config.stepColor[PanelIndex*3+0], config.stepColor[PanelIndex*3+1],