mirror of https://github.com/odrling/Aegisub
Make the Jump To dialog less silly
- Don't set arbitrary sizes for the labels and textboxes. - Get rid of the horizontal box sizers because the labels just wouldn't center vertically. Use a grid sizer instead. - Use a wxStdDialogButtonSizer instead of creating the buttons manually. Originally committed to SVN as r6802.
This commit is contained in:
parent
9254ea8ff6
commit
5d9268792f
|
@ -64,31 +64,27 @@ DialogJumpTo::DialogJumpTo(agi::Context *c)
|
||||||
wxString maxLength = wxString::Format("%i",c->videoController->GetLength() - 1);
|
wxString maxLength = wxString::Format("%i",c->videoController->GetLength() - 1);
|
||||||
|
|
||||||
// Times
|
// Times
|
||||||
wxStaticText *LabelFrame = new wxStaticText(this,-1,_("Frame: "),wxDefaultPosition,wxSize(60,20));
|
wxStaticText *LabelFrame = new wxStaticText(this,-1,_("Frame: "));
|
||||||
wxStaticText *LabelTime = new wxStaticText(this,-1,_("Time: "),wxDefaultPosition,wxSize(60,20));
|
wxStaticText *LabelTime = new wxStaticText(this,-1,_("Time: "));
|
||||||
JumpFrame = new wxTextCtrl(this,-1,"",wxDefaultPosition,wxSize(60,20),wxTE_PROCESS_ENTER, NumValidator((int)jumpframe));
|
|
||||||
|
JumpFrame = new wxTextCtrl(this,-1,"",wxDefaultPosition,wxSize(-1,-1),wxTE_PROCESS_ENTER, NumValidator((int)jumpframe));
|
||||||
JumpFrame->SetMaxLength(maxLength.size());
|
JumpFrame->SetMaxLength(maxLength.size());
|
||||||
JumpTime = new TimeEdit(this, -1, c, AssTime(c->videoController->TimeAtFrame(jumpframe)).GetASSFormated(), wxSize(60,20));
|
JumpTime = new TimeEdit(this, -1, c, AssTime(c->videoController->TimeAtFrame(jumpframe)).GetASSFormated(), wxSize(-1,-1));
|
||||||
wxSizer *FrameSizer = new wxBoxSizer(wxHORIZONTAL);
|
|
||||||
wxSizer *TimeSizer = new wxBoxSizer(wxHORIZONTAL);
|
wxGridSizer *TimesSizer = new wxGridSizer(2, 5, 5);
|
||||||
FrameSizer->Add(LabelFrame,0,wxALIGN_CENTER_VERTICAL,0);
|
|
||||||
FrameSizer->Add(JumpFrame,1,wxLEFT,5);
|
TimesSizer->Add(LabelFrame, 1, wxALIGN_CENTER_VERTICAL);
|
||||||
TimeSizer->Add(LabelTime,0,wxALIGN_CENTER_VERTICAL,0);
|
TimesSizer->Add(JumpFrame, wxEXPAND);
|
||||||
TimeSizer->Add(JumpTime,1,wxLEFT,5);
|
|
||||||
wxSizer *TimesSizer = new wxStaticBoxSizer(wxVERTICAL, this, "");
|
TimesSizer->Add(LabelTime, 1, wxALIGN_CENTER_VERTICAL);
|
||||||
TimesSizer->Add(FrameSizer,0,wxEXPAND | wxBOTTOM,5);
|
TimesSizer->Add(JumpTime, wxEXPAND);
|
||||||
TimesSizer->Add(TimeSizer,0,wxEXPAND,0);
|
|
||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
wxButton *OKButton = new wxButton(this, wxID_OK);
|
wxStdDialogButtonSizer *ButtonSizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL);
|
||||||
wxButton *CancelButton = new wxButton(this, wxID_CANCEL);
|
|
||||||
wxSizer *ButtonSizer = new wxBoxSizer(wxHORIZONTAL);
|
|
||||||
ButtonSizer->Add(OKButton,1,wxRIGHT,5);
|
|
||||||
ButtonSizer->Add(CancelButton,0,0,0);
|
|
||||||
|
|
||||||
// General layout
|
// General layout
|
||||||
wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL);
|
wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL);
|
||||||
MainSizer->Add(TimesSizer,0,wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT,5);
|
MainSizer->Add(TimesSizer,0, wxBOTTOM | wxTOP | wxALIGN_CENTER,5);
|
||||||
MainSizer->Add(ButtonSizer,0,wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT,5);
|
MainSizer->Add(ButtonSizer,0,wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT,5);
|
||||||
|
|
||||||
// Set sizer
|
// Set sizer
|
||||||
|
|
Loading…
Reference in New Issue