summaryrefslogtreecommitdiff
path: root/src/wx/job_manager_view.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-09-02 22:09:33 +0100
committerCarl Hetherington <cth@carlh.net>2014-09-02 22:09:33 +0100
commit8407612363705f757d3ab26d6e119171c217b00a (patch)
tree96c5e07733656a8df6f0e660a828b1765110297f /src/wx/job_manager_view.cc
parente50e596448d17f32652a8215a01ae62a32c9afea (diff)
Seemingly rather long-winded way of making the JobManagerView in
dcpomatic_batch shrink nicely (i.e. shrinking the gauge) when the window is shrunk. It seems surprising that we have to call back to children to tell them to layout / fit-inside, but it does all *seem* to be necessary.
Diffstat (limited to 'src/wx/job_manager_view.cc')
-rw-r--r--src/wx/job_manager_view.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/wx/job_manager_view.cc b/src/wx/job_manager_view.cc
index df9c6f5f1..5146243b4 100644
--- a/src/wx/job_manager_view.cc
+++ b/src/wx/job_manager_view.cc
@@ -202,15 +202,25 @@ JobManagerView::JobManagerView (wxWindow* parent, Buttons buttons)
_panel->SetSizer (_table);
SetScrollRate (0, 32);
+ EnableScrolling (false, true);
Bind (wxEVT_TIMER, boost::bind (&JobManagerView::periodic, this));
_timer.reset (new wxTimer (this));
_timer->Start (1000);
-
+
+ Bind (wxEVT_SIZE, boost::bind (&JobManagerView::sized, this, _1));
JobManager::instance()->JobAdded.connect (bind (&JobManagerView::job_added, this, _1));
}
void
+JobManagerView::sized (wxSizeEvent& ev)
+{
+ _table->FitInside (_panel);
+ _table->Layout ();
+ ev.Skip ();
+}
+
+void
JobManagerView::job_added (weak_ptr<Job> j)
{
shared_ptr<Job> job = j.lock ();