From d1c2ff82f022b4d8e98d448fb8ec89a1cdf6cfb4 Mon Sep 17 00:00:00 2001 From: James Crook Date: Tue, 10 Apr 2018 22:56:09 +0100 Subject: [PATCH] Bug 1864 - Spectrogram settings dialog hides the checkbox for "Enable Spectral Selection" Fixed by a more compact layout. Also we now size the dialogs for unique pages to fit their contents. --- src/prefs/PrefsDialog.cpp | 22 ++++++---- src/prefs/SpectrumPrefs.cpp | 84 ++++++++++++++++++++----------------- 2 files changed, 58 insertions(+), 48 deletions(-) diff --git a/src/prefs/PrefsDialog.cpp b/src/prefs/PrefsDialog.cpp index b68bd444a..5eb5d23ee 100644 --- a/src/prefs/PrefsDialog.cpp +++ b/src/prefs/PrefsDialog.cpp @@ -352,13 +352,15 @@ PrefsDialog::PrefsDialog sz.DecTo(screenRect.GetSize()); - int prefWidth, prefHeight; - gPrefs->Read(wxT("/Prefs/Width"), &prefWidth, sz.x); - gPrefs->Read(wxT("/Prefs/Height"), &prefHeight, sz.y); + if( !mUniquePage ){ + int prefWidth, prefHeight; + gPrefs->Read(wxT("/Prefs/Width"), &prefWidth, sz.x); + gPrefs->Read(wxT("/Prefs/Height"), &prefHeight, sz.y); - wxSize prefSize = wxSize(prefWidth, prefHeight); - prefSize.DecTo(screenRect.GetSize()); - SetSize(prefSize); + wxSize prefSize = wxSize(prefWidth, prefHeight); + prefSize.DecTo(screenRect.GetSize()); + SetSize(prefSize); + } SetMinSize(sz); // Center after all that resizing, but make sure it doesn't end up @@ -500,9 +502,11 @@ void PrefsDialog::OnOK(wxCommandEvent & WXUNUSED(event)) mUniquePage->Commit(); } - wxSize sz = GetSize(); - gPrefs->Write(wxT("/Prefs/Width"), sz.x); - gPrefs->Write(wxT("/Prefs/Height"), sz.y); + if( !mUniquePage ){ + wxSize sz = GetSize(); + gPrefs->Write(wxT("/Prefs/Width"), sz.x); + gPrefs->Write(wxT("/Prefs/Height"), sz.y); + } gPrefs->Flush(); // Reads preference /GUI/Theme diff --git a/src/prefs/SpectrumPrefs.cpp b/src/prefs/SpectrumPrefs.cpp index e5b5eb3f4..acf787155 100644 --- a/src/prefs/SpectrumPrefs.cpp +++ b/src/prefs/SpectrumPrefs.cpp @@ -171,54 +171,60 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S) mDefaultsCheckbox = S.Id(ID_DEFAULTS).TieCheckBox(_("&Use Preferences"), mDefaulted); } - S.StartStatic(_("Scale")); + S.StartMultiColumn(2,wxEXPAND); { - S.StartTwoColumn(); + S.SetStretchyCol( 0 ); + S.SetStretchyCol( 1 ); + S.StartStatic(_("Scale"),1); { - S.Id(ID_SCALE).TieChoice(_("S&cale") + wxString(wxT(":")), - mTempSettings.scaleType, - &mScaleChoices); - - mMinFreq = - S.Id(ID_MINIMUM).TieNumericTextBox(_("Mi&nimum Frequency (Hz):"), - mTempSettings.minFreq, - 12); - - mMaxFreq = - S.Id(ID_MAXIMUM).TieNumericTextBox(_("Ma&ximum Frequency (Hz):"), - mTempSettings.maxFreq, - 12); + S.StartMultiColumn(2,wxEXPAND); + { + S.SetStretchyCol( 0 ); + S.SetStretchyCol( 1 ); + S.Id(ID_SCALE).TieChoice(_("S&cale") + wxString(wxT(":")), + mTempSettings.scaleType, + &mScaleChoices); + mMinFreq = + S.Id(ID_MINIMUM).TieNumericTextBox(_("Mi&n Frequency (Hz):"), + mTempSettings.minFreq, + 12); + mMaxFreq = + S.Id(ID_MAXIMUM).TieNumericTextBox(_("Ma&x Frequency (Hz):"), + mTempSettings.maxFreq, + 12); + } + S.EndMultiColumn(); } - S.EndTwoColumn(); - } - S.EndStatic(); + S.EndStatic(); - S.StartStatic(_("Colors")); - { - S.StartTwoColumn(); + S.StartStatic(_("Colors"),1); { - mGain = - S.Id(ID_GAIN).TieNumericTextBox(_("&Gain (dB):"), - mTempSettings.gain, - 8); + S.StartMultiColumn(2,wxEXPAND); + { + S.SetStretchyCol( 0 ); + S.SetStretchyCol( 1 ); + mGain = + S.Id(ID_GAIN).TieNumericTextBox(_("&Gain (dB):"), + mTempSettings.gain, + 8); + mRange = + S.Id(ID_RANGE).TieNumericTextBox(_("&Range (dB):"), + mTempSettings.range, + 8); - mRange = - S.Id(ID_RANGE).TieNumericTextBox(_("&Range (dB):"), - mTempSettings.range, - 8); + mFrequencyGain = + S.Id(ID_FREQUENCY_GAIN).TieNumericTextBox(_("High &boost (dB/dec):"), + mTempSettings.frequencyGain, + 8); + } + S.EndMultiColumn(); - mFrequencyGain = - S.Id(ID_FREQUENCY_GAIN).TieNumericTextBox(_("Frequency g&ain (dB/dec):"), - mTempSettings.frequencyGain, - 4); + S.Id(ID_GRAYSCALE).TieCheckBox(_("Gra&yscale"), + mTempSettings.isGrayscale); } - - S.Id(ID_GRAYSCALE).TieCheckBox(_("Gra&yscale"), - mTempSettings.isGrayscale); - - S.EndTwoColumn(); + S.EndStatic(); } - S.EndStatic(); + S.EndMultiColumn(); S.StartStatic(_("Algorithm")); {