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.
master
Glenn Maynard 6 years ago
parent bceca77016
commit baa66fc551
  1. 14
      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],

Loading…
Cancel
Save