From 38c3e30c31cd00be15c4346140938807f2b84cf8 Mon Sep 17 00:00:00 2001 From: Maxim Date: Thu, 2 Sep 2021 20:58:09 +0100 Subject: [PATCH] Channel settings sometimes didn't show on the first click --- SidWiz/SidWizPlusGUI.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/SidWiz/SidWizPlusGUI.cs b/SidWiz/SidWizPlusGUI.cs index 3035eca..9b2eee1 100644 --- a/SidWiz/SidWizPlusGUI.cs +++ b/SidWiz/SidWizPlusGUI.cs @@ -514,7 +514,20 @@ private void Render() // Render a bitmap var bitmap = renderer.RenderFrame(renderPosition); - +/* + if (PropertyGrid.SelectedObject != null) + { + // Figure out which one is selected + lock (_settings) + { + var index = _settings.Channels.IndexOf(PropertyGrid.SelectedObject as Channel); + var columnIndex = index % _settings.Columns; + var rowIndex = index / _settings.Columns; + var numRows = _settings.Channels.Count / _settings.Columns + + (_settings.Channels.Count % _settings.Columns == 0 ? 0 : 1); + } + } +*/ BeginInvoke(new Action(() => { // Swap it with whatever is in the preview control @@ -1241,7 +1254,7 @@ private void ResetToDefaultSettings(object sender, EventArgs e) private void PropertyGrid_SelectedObjectsChanged(object sender, EventArgs e) { PropertyGrid.Visible = PropertyGrid.SelectedObject != null; - ChannelsHelpLabel.Visible = !PropertyGrid.Visible; + ChannelsHelpLabel.Visible = PropertyGrid.SelectedObject == null;; } } } \ No newline at end of file