1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-03 14:13:11 +02:00
audacity/src/toolbars/MeterToolBar.h
James Crook 132986de1a Make Transcription ToolBar resizable.
I moved 'Fit()' from ToolBars into MeterToolBar, because it is a workaround for an incorrect size calculation by MeterToolBar.  MeterToolBar is sized as if there is no resizer, so when there is one, the toolbar needs to be expanded (using Fit) to accommodate the resizer.

I also set the min size of MeterToolBar to 150, so that some meter will appear, even if Toolbar shrunk to the minimum.
2018-07-21 16:41:32 +01:00

74 lines
1.6 KiB
C++

/**********************************************************************
Audacity: A Digital Audio Editor
MeterToolbar.h
Dominic Mazzoni
Leland Lucius
ToolBar to hold the VU Meter
**********************************************************************/
#ifndef __AUDACITY_METER_TOOLBAR__
#define __AUDACITY_METER_TOOLBAR__
#include "ToolBar.h"
#include "../Project.h"
class wxDC;
class wxGridBagSizer;
class wxSizeEvent;
class wxWindow;
class MeterPanel;
// Constants used as bit pattern
const int kWithRecordMeter = 1;
const int kWithPlayMeter = 2;
class MeterToolBar final : public ToolBar {
public:
MeterToolBar(AudacityProject *project, int type);
virtual ~MeterToolBar();
void Create(wxWindow *parent) override;
void Populate() override;
void ReCreateButtons() override;
void Repaint(wxDC * WXUNUSED(dc)) override {};
void EnableDisableButtons() override {};
void UpdatePrefs() override;
void OnSize(wxSizeEvent & event);
bool Expose(bool show) override;
int GetInitialWidth() override {return (mWhichMeters ==
(kWithRecordMeter + kWithPlayMeter)) ? 338 : 460;} // Separate bars used to be smaller.
int GetMinToolbarWidth() override { return 150; }
wxSize GetDockedSize() override;
virtual void SetDocked(ToolDock *dock, bool pushed)override;
private:
void RegenerateTooltips() override;
AudacityProject *mProject;
int mWhichMeters;
wxGridBagSizer *mSizer;
MeterPanel *mPlayMeter;
MeterPanel *mRecordMeter;
public:
DECLARE_CLASS(MeterToolBar)
DECLARE_EVENT_TABLE()
};
#endif