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");
|
||||
audioSash = new wxSashWindow(Panel, ID_SASH_MAIN_AUDIO, wxDefaultPosition, wxDefaultSize, wxSW_3D|wxCLIP_CHILDREN);
|
||||
wxBoxSizer *audioSashSizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
audioSash->SetSashVisible(wxSASH_BOTTOM, true);
|
||||
|
||||
StartupLog("Create audio box");
|
||||
context->audioBox = audioBox = new AudioBox(audioSash, context.get());
|
||||
|
||||
wxSizer *audioSashSizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
audioSashSizer->Add(audioBox, 1, wxEXPAND);
|
||||
audioSash->SetSizer(audioSashSizer);
|
||||
audioBox->Fit();
|
||||
audioSash->SetSizerAndFit(audioSashSizer);
|
||||
audioSash->SetMinSize(wxSize(-1, OPT_GET("Audio/Display Height")->GetInt()));
|
||||
audioSash->SetMinimumSizeY(audioBox->GetSize().GetHeight());
|
||||
|
||||
StartupLog("Create subtitle editing box");
|
||||
|
@ -641,12 +642,9 @@ void FrameMain::OnAudioBoxResize(wxSashEvent &event) {
|
|||
|
||||
wxRect rect = event.GetDragRect();
|
||||
|
||||
if (rect.GetHeight() < audioSash->GetMinimumSizeY())
|
||||
rect.SetHeight(audioSash->GetMinimumSizeY());
|
||||
|
||||
audioBox->SetMinSize(wxSize(-1, rect.GetHeight()));
|
||||
OPT_SET("Audio/Display Height")->SetInt(rect.GetHeight());
|
||||
audioSash->SetMinSize(wxSize(-1, rect.GetHeight()));
|
||||
Panel->Layout();
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void FrameMain::OnAudioOpen(AudioProvider *provider) {
|
||||
|
|
Loading…
Reference in a new issue