Fix bug where opening audio with audio already open would resize the audio display

Originally committed to SVN as r6384.
This commit is contained in:
Thomas Goyne 2012-01-27 20:04:22 +00:00
parent ef4c1b369d
commit 9e3f280cda

View file

@ -224,13 +224,15 @@ void AudioBox::OnVerticalLink(agi::OptionValue const& opt) {
void AudioBox::ShowKaraokeBar(bool show) { void AudioBox::ShowKaraokeBar(bool show) {
wxSizer *panel_sizer = panel->GetSizer(); wxSizer *panel_sizer = panel->GetSizer();
if (panel_sizer->IsShown(context->karaoke) == show) return;
int new_height = GetSize().GetHeight(); int new_height = GetSize().GetHeight();
int kara_height = context->karaoke->GetSize().GetHeight() + 3; int kara_height = context->karaoke->GetSize().GetHeight() + 3;
if (panel_sizer->IsShown(context->karaoke)) if (show)
new_height -= kara_height;
else
new_height += kara_height; new_height += kara_height;
else
new_height -= kara_height;
panel_sizer->Show(context->karaoke, show); panel_sizer->Show(context->karaoke, show);
SetMinSize(wxSize(-1, new_height)); SetMinSize(wxSize(-1, new_height));