mirror of
https://github.com/cookiengineer/audacity
synced 2026-01-13 08:05:52 +01:00
Make Mixer ToolBar resizable.
This commit is contained in:
@@ -56,7 +56,7 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
//Standard contructor
|
//Standard contructor
|
||||||
MixerToolBar::MixerToolBar()
|
MixerToolBar::MixerToolBar()
|
||||||
: ToolBar(MixerBarID, _("Mixer"), wxT("Mixer"))
|
: ToolBar(MixerBarID, _("Mixer"), wxT("Mixer"), true)
|
||||||
{
|
{
|
||||||
mInputSliderVolume = 0.0;
|
mInputSliderVolume = 0.0;
|
||||||
mOutputSliderVolume = 0.0;
|
mOutputSliderVolume = 0.0;
|
||||||
@@ -81,7 +81,7 @@ void MixerToolBar::Populate()
|
|||||||
mInputSlider = safenew ASlider(this, wxID_ANY, _("Recording Volume"),
|
mInputSlider = safenew ASlider(this, wxID_ANY, _("Recording Volume"),
|
||||||
wxDefaultPosition, wxSize(130, 25),
|
wxDefaultPosition, wxSize(130, 25),
|
||||||
ASlider::Options{}.Line( 0.1f ).Page( 2.0f ));
|
ASlider::Options{}.Line( 0.1f ).Page( 2.0f ));
|
||||||
Add(mInputSlider, 0, wxALIGN_CENTER);
|
Add(mInputSlider, 1, wxALIGN_CENTER);
|
||||||
|
|
||||||
// Playback icon and slider
|
// Playback icon and slider
|
||||||
Add(safenew AStaticBitmap(this,
|
Add(safenew AStaticBitmap(this,
|
||||||
@@ -90,7 +90,10 @@ void MixerToolBar::Populate()
|
|||||||
mOutputSlider = safenew ASlider(this, wxID_ANY, _("Playback Volume"),
|
mOutputSlider = safenew ASlider(this, wxID_ANY, _("Playback Volume"),
|
||||||
wxDefaultPosition, wxSize(130, 25),
|
wxDefaultPosition, wxSize(130, 25),
|
||||||
ASlider::Options{}.Line( 0.1f ).Page( 2.0f ));
|
ASlider::Options{}.Line( 0.1f ).Page( 2.0f ));
|
||||||
Add(mOutputSlider, 0, wxALIGN_CENTER);
|
Add(mOutputSlider, 1, wxALIGN_CENTER);
|
||||||
|
|
||||||
|
mInputSlider->SetSizeHints( wxSize(75, 25), wxSize(500, 25));
|
||||||
|
mOutputSlider->SetSizeHints(wxSize(75, 25), wxSize(500, 25));
|
||||||
|
|
||||||
// this bit taken from SelectionBar::Populate()
|
// this bit taken from SelectionBar::Populate()
|
||||||
mInputSlider->Bind(wxEVT_SET_FOCUS,
|
mInputSlider->Bind(wxEVT_SET_FOCUS,
|
||||||
@@ -168,7 +171,7 @@ void MixerToolBar::UpdatePrefs()
|
|||||||
Layout();
|
Layout();
|
||||||
|
|
||||||
// Resize the toolbar to fit the contents
|
// Resize the toolbar to fit the contents
|
||||||
Fit();
|
//Fit();
|
||||||
|
|
||||||
// And make that size the minimum
|
// And make that size the minimum
|
||||||
SetMinSize( wxWindow::GetSizer()->GetMinSize() );
|
SetMinSize( wxWindow::GetSizer()->GetMinSize() );
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ class MixerToolBar final : public ToolBar {
|
|||||||
void Populate() override;
|
void Populate() override;
|
||||||
void Repaint(wxDC * WXUNUSED(dc)) override {};
|
void Repaint(wxDC * WXUNUSED(dc)) override {};
|
||||||
void EnableDisableButtons() override {};
|
void EnableDisableButtons() override {};
|
||||||
|
int GetMinToolbarWidth() override { return 250; }
|
||||||
|
|
||||||
void OnFocus(wxFocusEvent &event);
|
void OnFocus(wxFocusEvent &event);
|
||||||
void OnCaptureKey(wxCommandEvent &event);
|
void OnCaptureKey(wxCommandEvent &event);
|
||||||
|
|||||||
Reference in New Issue
Block a user