mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
Bug 2465 - Treble height Selection Toolbar
This commit is contained in:
@@ -167,6 +167,20 @@ void DeviceToolBar::Populate()
|
||||
#endif
|
||||
Add(mOutput, 30, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 1);
|
||||
|
||||
#if defined(__WXGTK3__)
|
||||
// Nothing special
|
||||
#elif defined(__WXGTK__)
|
||||
// Scale the font to fit inside (hopefully)
|
||||
wxFont font = mHost->GetFont();
|
||||
font.Scale((double) toolbarSingle / mHost->GetSize().GetHeight());
|
||||
|
||||
// Set it
|
||||
mHost->SetFont(font);
|
||||
mInput->SetFont(font);
|
||||
mInputChannels->SetFont(font);
|
||||
mOutput->SetFont(font);
|
||||
#endif
|
||||
|
||||
mHost->Bind(wxEVT_SET_FOCUS,
|
||||
&DeviceToolBar::OnFocus,
|
||||
this);
|
||||
@@ -410,10 +424,7 @@ void DeviceToolBar::FillHosts()
|
||||
mHost->Enable(false);
|
||||
}
|
||||
|
||||
// mHost->InvalidateBestSize();
|
||||
mHost->SetMinSize(wxSize(50, wxDefaultCoord));
|
||||
// mHost->SetMaxSize(wxDefaultSize);
|
||||
// mHost->SetMaxSize(wxSize(mHost->GetBestSize().x, wxDefaultCoord));
|
||||
}
|
||||
|
||||
void DeviceToolBar::FillHostDevices()
|
||||
@@ -479,10 +490,7 @@ void DeviceToolBar::FillHostDevices()
|
||||
}
|
||||
mInput->Enable(mInput->GetCount() ? true : false);
|
||||
|
||||
// mInput->InvalidateBestSize();
|
||||
mInput->SetMinSize(wxSize(50, wxDefaultCoord));
|
||||
// mInput->SetMaxSize(wxDefaultSize);
|
||||
// mInput->SetMaxSize(wxSize(mInput->GetBestSize().x, wxDefaultCoord));
|
||||
|
||||
for (auto & device : outMaps) {
|
||||
if (foundHostIndex == device.hostIndex) {
|
||||
@@ -497,10 +505,7 @@ void DeviceToolBar::FillHostDevices()
|
||||
}
|
||||
mOutput->Enable(mOutput->GetCount() ? true : false);
|
||||
|
||||
// mOutput->InvalidateBestSize();
|
||||
mOutput->SetMinSize(wxSize(50, wxDefaultCoord));
|
||||
// mOutput->SetMaxSize(wxDefaultSize);
|
||||
// mOutput->SetMaxSize(wxSize(mOutput->GetBestSize().x, wxDefaultCoord));
|
||||
|
||||
// The setting of the Device is left up to OnChoice
|
||||
}
|
||||
@@ -548,10 +553,7 @@ void DeviceToolBar::FillInputChannels()
|
||||
}
|
||||
mInputChannels->Enable(mInputChannels->GetCount() ? true : false);
|
||||
|
||||
// mInputChannels->InvalidateBestSize();
|
||||
mInputChannels->SetMinSize(wxSize(50, wxDefaultCoord));
|
||||
// mInputChannels->SetMaxSize(wxDefaultSize);
|
||||
// mInputChannels->SetMaxSize(wxSize(mInputChannels->GetBestSize().x, wxDefaultCoord));
|
||||
}
|
||||
|
||||
void DeviceToolBar::OnRescannedDevices( wxCommandEvent &event )
|
||||
|
||||
@@ -198,9 +198,9 @@ void SelectionBar::Populate()
|
||||
// Top row (mostly labels)
|
||||
wxColour clrText = theTheme.Colour( clrTrackPanelText );
|
||||
wxColour clrText2 = *wxBLUE;
|
||||
AddTitle( XO("Project Rate (Hz)"), mainSizer );
|
||||
auStaticText *rateLabel = AddTitle( XO("Project Rate (Hz)"), mainSizer );
|
||||
AddVLine( mainSizer );
|
||||
AddTitle( XO("Snap-To"), mainSizer );
|
||||
auStaticText *snapLabel = AddTitle( XO("Snap-To"), mainSizer );
|
||||
AddVLine( mainSizer );
|
||||
#ifdef TIME_IN_SELECT_TOOLBAR
|
||||
AddTitle( XO("Audio Position"), mainSizer );
|
||||
@@ -319,6 +319,21 @@ void SelectionBar::Populate()
|
||||
mainSizer->Add(hSizer.release(), 0, wxALIGN_TOP | wxRIGHT, 0);
|
||||
}
|
||||
|
||||
#if defined(__WXGTK3__)
|
||||
// Nothing special
|
||||
#elif defined(__WXGTK__)
|
||||
// Ensure the font fits inside (hopefully)
|
||||
wxFont font = mChoice->GetFont();
|
||||
font.Scale((double) toolbarSingle / mChoice->GetSize().GetHeight());
|
||||
|
||||
rateLabel->SetFont(font);
|
||||
snapLabel->SetFont(font);
|
||||
mChoice->SetFont(font);
|
||||
mRateBox->SetFont(font);
|
||||
mRateText->SetFont(font);
|
||||
mSnapTo->SetFont(font);
|
||||
#endif
|
||||
|
||||
// Make sure they are fully expanded to the longest item
|
||||
mChoice->SetMinSize(wxSize(mChoice->GetBestSize().x, toolbarSingle));
|
||||
mRateBox->SetMinSize(wxSize(mRateBox->GetBestSize().x, toolbarSingle));
|
||||
|
||||
Reference in New Issue
Block a user