From 6c879c12f1a20f4bec7af226607918f678b3a8b9 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 22 Jan 2012 05:59:36 +0000 Subject: [PATCH] Move the visual tool submode buttons to the main visual tool toolbar Creating an entire toolbar for one button in the drag mode is a pointless waste of space and source of ugliness. The secondary toolbar was more reasonable for the vector clip tool, but it's still a bit pointless as there's enough space for it on the main toolbar at any reasonable zoom level. Closes #1401. Originally committed to SVN as r6333. --- aegisub/src/video_box.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/aegisub/src/video_box.cpp b/aegisub/src/video_box.cpp index fe322aaad..277c8152b 100644 --- a/aegisub/src/video_box.cpp +++ b/aegisub/src/video_box.cpp @@ -79,9 +79,6 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context) : wxPanel (parent,-1) , context(context) { - // Visual controls sub-toolbar - wxToolBar *visualSubToolBar = new wxToolBar(this,-1,wxDefaultPosition,wxDefaultSize,wxTB_HORIZONTAL | wxTB_BOTTOM | wxTB_FLAT); - // Buttons wxSizer *videoBottomSizer = new wxBoxSizer(wxHORIZONTAL); add_button(this, videoBottomSizer, "video/play", context); @@ -114,18 +111,26 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context) visualToolBar->SetBackgroundStyle(wxBG_STYLE_COLOUR); visualToolBar->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); + // Visual controls sub-toolbar + wxToolBar *visualSubToolBar = new wxToolBar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_VERTICAL | wxTB_BOTTOM | wxTB_FLAT); + visualSubToolBar->SetBackgroundStyle(wxBG_STYLE_COLOUR); + visualSubToolBar->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); + VideoDisplay *videoDisplay = new VideoDisplay(visualSubToolBar, isDetached, zoomBox, this, context); + wxSizer *toolbarSizer = new wxBoxSizer(wxVERTICAL); + toolbarSizer->Add(visualToolBar, wxSizerFlags()); + toolbarSizer->AddStretchSpacer(); + toolbarSizer->Add(visualSubToolBar, wxSizerFlags()); + // Top sizer // Detached and attached video needs different flags, see bugs #742 and #853 int highSizerFlags = isDetached ? wxEXPAND : 0; wxSizer *topTopSizer = new wxBoxSizer(wxHORIZONTAL); wxSizer *topSizer = new wxBoxSizer(wxVERTICAL); - visualSubToolBar->Show(false); - topTopSizer->Add(visualToolBar,0,highSizerFlags,0); + topTopSizer->Add(toolbarSizer,0,wxEXPAND,0); topTopSizer->Add(videoDisplay,1,highSizerFlags,0); topSizer->Add(topTopSizer,1,wxEXPAND,0); - topSizer->Add(visualSubToolBar,0,wxEXPAND | wxBOTTOM,4); topSizer->Add(new wxStaticLine(this),0,wxEXPAND,0); // Sizers