1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-11 09:31:13 +02:00

Bug 1486 - Show/Hide scrub-bar does not persist.

This commit is contained in:
James Crook 2016-08-20 14:59:36 +01:00
parent 1184cd54fe
commit 28f078dcf7
2 changed files with 12 additions and 3 deletions

View File

@ -2008,7 +2008,7 @@ AdornedRulerPanel::~AdornedRulerPanel()
this); this);
} }
#if 0 #if 1
namespace { namespace {
static const wxChar *scrubEnabledPrefName = wxT("/QuickPlay/ScrubbingEnabled"); static const wxChar *scrubEnabledPrefName = wxT("/QuickPlay/ScrubbingEnabled");
@ -2042,9 +2042,10 @@ void AdornedRulerPanel::UpdatePrefs()
#endif #endif
#endif #endif
// mShowScrubbing = ReadScrubEnabledPref(); mShowScrubbing = ReadScrubEnabledPref();
// Affected by the last // Affected by the last
UpdateRects(); UpdateRects();
SetPanelSize();
RegenerateTooltips(mPrevZone); RegenerateTooltips(mPrevZone);
} }
@ -2213,6 +2214,7 @@ void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
// Do this first time setting of button status texts // Do this first time setting of button status texts
// when we are sure the CommandManager is initialized. // when we are sure the CommandManager is initialized.
ReCreateButtons(); ReCreateButtons();
// Sends a resize event, which will cause a second paint.
UpdatePrefs(); UpdatePrefs();
} }
@ -2796,8 +2798,13 @@ void AdornedRulerPanel::UpdateStatusBarAndTooltips(StatusChoice choice)
void AdornedRulerPanel::OnToggleScrubBar(/*wxCommandEvent&*/) void AdornedRulerPanel::OnToggleScrubBar(/*wxCommandEvent&*/)
{ {
mShowScrubbing = !mShowScrubbing; mShowScrubbing = !mShowScrubbing;
//WriteScrubEnabledPref(mShowScrubbing); WriteScrubEnabledPref(mShowScrubbing);
gPrefs->Flush(); gPrefs->Flush();
SetPanelSize();
}
void AdornedRulerPanel::SetPanelSize()
{
wxSize size { GetSize().GetWidth(), GetRulerHeight(mShowScrubbing) }; wxSize size { GetSize().GetWidth(), GetRulerHeight(mShowScrubbing) };
SetSize(size); SetSize(size);
SetMinSize(size); SetMinSize(size);

View File

@ -331,6 +331,8 @@ public:
bool ShowingScrubBar() const { return mShowScrubbing; } bool ShowingScrubBar() const { return mShowScrubbing; }
void OnToggleScrubBar(/*wxCommandEvent&*/); void OnToggleScrubBar(/*wxCommandEvent&*/);
void SetPanelSize();
private: private:
void OnCapture(wxCommandEvent & evt); void OnCapture(wxCommandEvent & evt);