mirror of https://github.com/odrling/Aegisub
Move the zoom box from the main toolbar to the video box
Originally committed to SVN as r5467.
This commit is contained in:
parent
b93bb888e3
commit
f4d44f7c18
|
@ -75,7 +75,7 @@ DialogDetachedVideo::DialogDetachedVideo(FrameMain *parent, agi::Context *contex
|
|||
wxPanel *panel = new wxPanel(this,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL | wxCLIP_CHILDREN);
|
||||
|
||||
// Video area;
|
||||
videoBox = new VideoBox(panel, true, NULL, context);
|
||||
videoBox = new VideoBox(panel, true, context);
|
||||
videoBox->videoDisplay->SetClientSize(initialDisplaySize);
|
||||
|
||||
// Set sizer
|
||||
|
|
|
@ -254,17 +254,6 @@ void FrameMain::InitToolbar () {
|
|||
|
||||
toolbar::toolbar->GetToolbar("main", Toolbar);
|
||||
|
||||
wxArrayString choices;
|
||||
for (int i=1;i<=24;i++) {
|
||||
wxString toAdd = wxString::Format("%i",int(i*12.5));
|
||||
if (i%2) toAdd += ".5";
|
||||
toAdd += "%";
|
||||
choices.Add(toAdd);
|
||||
}
|
||||
ZoomBox = new wxComboBox(Toolbar,ID_TOOLBAR_ZOOM_DROPDOWN,"75%",wxDefaultPosition,wxDefaultSize,choices,wxCB_DROPDOWN);
|
||||
Toolbar->AddControl(ZoomBox);
|
||||
Toolbar->AddSeparator();
|
||||
|
||||
Toolbar->Realize();
|
||||
}
|
||||
|
||||
|
@ -286,7 +275,7 @@ void FrameMain::InitContents() {
|
|||
Panel = new wxPanel(this,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL | wxCLIP_CHILDREN);
|
||||
|
||||
StartupLog("Create video box");
|
||||
context->videoBox = videoBox = new VideoBox(Panel, false, ZoomBox, context.get());
|
||||
context->videoBox = videoBox = new VideoBox(Panel, false, context.get());
|
||||
wxBoxSizer *videoSizer = new wxBoxSizer(wxVERTICAL);
|
||||
videoSizer->Add(videoBox , 0, wxEXPAND);
|
||||
videoSizer->AddStretchSpacer(1);
|
||||
|
@ -338,7 +327,6 @@ static void validate_toolbar(wxToolBar *toolbar, const char *command, const agi:
|
|||
void FrameMain::UpdateToolbar() {
|
||||
wxToolBar* toolbar = GetToolBar();
|
||||
const agi::Context *c = context.get();
|
||||
ZoomBox->Enable(context->videoController->IsLoaded() && !context->detachedVideo);
|
||||
|
||||
validate_toolbar(toolbar, "video/jump", c);
|
||||
validate_toolbar(toolbar, "video/zoom/in", c);
|
||||
|
|
|
@ -108,7 +108,6 @@ private:
|
|||
|
||||
wxPanel *Panel;
|
||||
wxToolBar *Toolbar; ///< The main toolbar
|
||||
wxComboBox *ZoomBox; ///< The video zoom dropdown in the main toolbar
|
||||
std::vector<Automation4::FeatureMacro*> activeMacroItems;
|
||||
|
||||
int AddMacroMenuItems(wxMenu *menu, const std::vector<Automation4::FeatureMacro*> ¯os);
|
||||
|
|
|
@ -78,7 +78,7 @@ static void add_option(wxWindow *parent, wxSizer *sizer, const char *command, co
|
|||
sizer->Add(btn, 0, wxTOP | wxLEFT | wxBOTTOM | wxALIGN_CENTER, 2);
|
||||
}
|
||||
|
||||
VideoBox::VideoBox(wxWindow *parent, bool isDetached, wxComboBox *zoomBox, agi::Context *context)
|
||||
VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context)
|
||||
: wxPanel (parent,-1)
|
||||
, context(context)
|
||||
{
|
||||
|
@ -104,6 +104,13 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, wxComboBox *zoomBox, agi::
|
|||
VideoSubsPos = new wxTextCtrl(this,-1,"",wxDefaultPosition,wxSize(110,20),wxTE_READONLY);
|
||||
VideoSubsPos->SetToolTip(_("Time of this frame relative to start and end of current subs."));
|
||||
|
||||
// Zoom box
|
||||
wxArrayString choices;
|
||||
for (int i = 1 ; i <= 24; ++i) {
|
||||
choices.Add(wxString::Format("%g%%", i * 12.5));
|
||||
}
|
||||
zoomBox = new wxComboBox(this, -1, "75%", wxDefaultPosition, wxDefaultSize, choices, wxCB_DROPDOWN);
|
||||
|
||||
// Typesetting buttons
|
||||
visualToolBar = new wxToolBar(this,-1,wxDefaultPosition,wxDefaultSize,wxTB_VERTICAL|wxTB_FLAT|wxTB_NODIVIDER);
|
||||
visualToolBar->AddTool(Video_Mode_Standard,_("Standard"),GETIMAGE(visual_standard_24),_("Standard mode, double click sets position."),wxITEM_RADIO);
|
||||
|
@ -140,6 +147,7 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, wxComboBox *zoomBox, agi::
|
|||
videoSliderSizer->Add(videoSlider,1,wxEXPAND|wxLEFT,0);
|
||||
videoBottomSizer->Add(VideoPosition,1,wxLEFT|wxALIGN_CENTER,5);
|
||||
videoBottomSizer->Add(VideoSubsPos,1,wxALIGN_CENTER,0);
|
||||
videoBottomSizer->Add(zoomBox, 0, wxALIGN_CENTER, 5);
|
||||
|
||||
// If we're detached we do want to fill out as much space we can.
|
||||
// But if we're in the main window, the subs grid needs space more than us.
|
||||
|
|
|
@ -62,6 +62,7 @@ class VideoBox : public wxPanel {
|
|||
agi::Context *context; ///< Project context
|
||||
wxTextCtrl *VideoPosition; ///< Current frame/time
|
||||
wxTextCtrl *VideoSubsPos; ///< Time relative to the active subtitle line
|
||||
wxComboBox *zoomBox;
|
||||
|
||||
/// Handle a click on the play/pause buttons
|
||||
void OnButton(wxCommandEvent &evt);
|
||||
|
@ -82,7 +83,7 @@ public:
|
|||
/// DOCME
|
||||
VideoSlider *videoSlider;
|
||||
|
||||
VideoBox(wxWindow *parent, bool isDetached, wxComboBox *zoomBox, agi::Context *context);
|
||||
VideoBox(wxWindow *parent, bool isDetached, agi::Context *context);
|
||||
};
|
||||
|
||||
// IDs
|
||||
|
|
Loading…
Reference in New Issue