summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-05-24 21:12:00 +0100
committerCarl Hetherington <cth@carlh.net>2013-05-24 21:12:00 +0100
commit5b44e42b4a90331c88b15ed02a7f3d333690b9eb (patch)
tree1d60644f8b278b3e988654851829ef29671af7d6 /src
parenta0f1a3d40f1c93d4432d1d4857c1620907259b2f (diff)
Tweak main window layout. Fix crash on play with no content.
Diffstat (limited to 'src')
-rw-r--r--src/tools/dcpomatic.cc39
-rw-r--r--src/wx/film_viewer.cc2
2 files changed, 11 insertions, 30 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 50dd08245..196045a9b 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -218,23 +218,17 @@ public:
Connect (wxID_ANY, wxEVT_MENU_OPEN, wxMenuEventHandler (Frame::menu_opened));
- wxPanel* panel = new wxPanel (this);
- wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
- s->Add (panel, 1, wxEXPAND);
- SetSizer (s);
+ film_editor = new FilmEditor (film, this);
+ film_viewer = new FilmViewer (film, this);
+ JobManagerView* job_manager_view = new JobManagerView (this, static_cast<JobManagerView::Buttons> (0));
- film_editor = new FilmEditor (film, panel);
- film_viewer = new FilmViewer (film, panel);
- JobManagerView* job_manager_view = new JobManagerView (panel, static_cast<JobManagerView::Buttons> (0));
+ wxBoxSizer* right_sizer = new wxBoxSizer (wxVERTICAL);
+ right_sizer->Add (film_viewer, 2, wxEXPAND | wxALL, 6);
+ right_sizer->Add (job_manager_view, 1, wxEXPAND | wxALL, 6);
- _top_sizer = new wxBoxSizer (wxHORIZONTAL);
- _top_sizer->Add (film_editor, 0, wxALL, 6);
- _top_sizer->Add (film_viewer, 1, wxEXPAND | wxALL, 6);
-
- wxBoxSizer* main_sizer = new wxBoxSizer (wxVERTICAL);
- main_sizer->Add (_top_sizer, 2, wxEXPAND | wxALL, 6);
- main_sizer->Add (job_manager_view, 1, wxEXPAND | wxALL, 6);
- panel->SetSizer (main_sizer);
+ wxBoxSizer* main_sizer = new wxBoxSizer (wxHORIZONTAL);
+ main_sizer->Add (film_editor, 1, wxEXPAND | wxALL, 6);
+ main_sizer->Add (right_sizer, 2, wxEXPAND | wxALL, 6);
set_menu_sensitivity ();
@@ -246,22 +240,11 @@ public:
}
set_film ();
-
- film_editor->Connect (wxID_ANY, wxEVT_SIZE, wxSizeEventHandler (Frame::film_editor_sized), 0, this);
+ SetSizer (main_sizer);
}
private:
- void film_editor_sized (wxSizeEvent &)
- {
- static bool in_layout = false;
- if (!in_layout) {
- in_layout = true;
- _top_sizer->Layout ();
- in_layout = false;
- }
- }
-
void menu_opened (wxMenuEvent& ev)
{
if (ev.GetMenu() != jobs_menu) {
@@ -443,8 +426,6 @@ private:
info.SetWebSite (wxT ("http://carlh.net/software/dcpomatic"));
wxAboutBox (info);
}
-
- wxSizer* _top_sizer;
};
#if wxMINOR_VERSION == 9
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 6478b8541..d08afe7a4 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -382,7 +382,7 @@ FilmViewer::play_clicked (wxCommandEvent &)
void
FilmViewer::check_play_state ()
{
- if (!_film) {
+ if (!_film || _film->dcp_video_frame_rate() == 0) {
return;
}