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
1 changed files with 5 additions and 3 deletions

View File

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