forked from mia/Aegisub
Save and restore the height of the audio display across sessions
Originally committed to SVN as r5674.
This commit is contained in:
parent
6beb266c15
commit
a00a3047cb
1 changed files with 6 additions and 8 deletions
|
@ -256,14 +256,15 @@ void FrameMain::InitContents() {
|
||||||
|
|
||||||
StartupLog("Create tool area splitter window");
|
StartupLog("Create tool area splitter window");
|
||||||
audioSash = new wxSashWindow(Panel, ID_SASH_MAIN_AUDIO, wxDefaultPosition, wxDefaultSize, wxSW_3D|wxCLIP_CHILDREN);
|
audioSash = new wxSashWindow(Panel, ID_SASH_MAIN_AUDIO, wxDefaultPosition, wxDefaultSize, wxSW_3D|wxCLIP_CHILDREN);
|
||||||
wxBoxSizer *audioSashSizer = new wxBoxSizer(wxHORIZONTAL);
|
|
||||||
audioSash->SetSashVisible(wxSASH_BOTTOM, true);
|
audioSash->SetSashVisible(wxSASH_BOTTOM, true);
|
||||||
|
|
||||||
StartupLog("Create audio box");
|
StartupLog("Create audio box");
|
||||||
context->audioBox = audioBox = new AudioBox(audioSash, context.get());
|
context->audioBox = audioBox = new AudioBox(audioSash, context.get());
|
||||||
|
|
||||||
|
wxSizer *audioSashSizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
audioSashSizer->Add(audioBox, 1, wxEXPAND);
|
audioSashSizer->Add(audioBox, 1, wxEXPAND);
|
||||||
audioSash->SetSizer(audioSashSizer);
|
audioSash->SetSizerAndFit(audioSashSizer);
|
||||||
audioBox->Fit();
|
audioSash->SetMinSize(wxSize(-1, OPT_GET("Audio/Display Height")->GetInt()));
|
||||||
audioSash->SetMinimumSizeY(audioBox->GetSize().GetHeight());
|
audioSash->SetMinimumSizeY(audioBox->GetSize().GetHeight());
|
||||||
|
|
||||||
StartupLog("Create subtitle editing box");
|
StartupLog("Create subtitle editing box");
|
||||||
|
@ -641,12 +642,9 @@ void FrameMain::OnAudioBoxResize(wxSashEvent &event) {
|
||||||
|
|
||||||
wxRect rect = event.GetDragRect();
|
wxRect rect = event.GetDragRect();
|
||||||
|
|
||||||
if (rect.GetHeight() < audioSash->GetMinimumSizeY())
|
OPT_SET("Audio/Display Height")->SetInt(rect.GetHeight());
|
||||||
rect.SetHeight(audioSash->GetMinimumSizeY());
|
audioSash->SetMinSize(wxSize(-1, rect.GetHeight()));
|
||||||
|
|
||||||
audioBox->SetMinSize(wxSize(-1, rect.GetHeight()));
|
|
||||||
Panel->Layout();
|
Panel->Layout();
|
||||||
Refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FrameMain::OnAudioOpen(AudioProvider *provider) {
|
void FrameMain::OnAudioOpen(AudioProvider *provider) {
|
||||||
|
|
Loading…
Reference in a new issue