summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-10-26 12:01:32 +0100
committerCarl Hetherington <cth@carlh.net>2020-10-26 12:01:32 +0100
commitbe551d6104654f0dad3095bd95f1c7dd560cfbc0 (patch)
treea4afaf0bc811dcc55483e5c4ee6f557578d9e57a
parent1080f85d55b254cf40e436a0ae799e2f2889e6b6 (diff)
Make the crop controls more like those on the v2.15.x branch
for GTK3 so that they are at least vaguely usable.
-rw-r--r--src/wx/video_panel.cc41
-rw-r--r--src/wx/video_panel.h1
2 files changed, 32 insertions, 10 deletions
diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc
index 713ef9d2c..9a495702d 100644
--- a/src/wx/video_panel.cc
+++ b/src/wx/video_panel.cc
@@ -102,40 +102,48 @@ VideoPanel::VideoPanel (ContentPanel* p)
&caster<VideoFrameType, int>
);
- _left_crop_label = create_label (this, _("Left crop"), true);
+ _crop_label = create_label (this, _("Crop"), true);
+
+#ifdef __WXGTK3__
+ int const crop_width = 128;
+#else
+ int const crop_width = 56;
+#endif
+
+ _left_crop_label = create_label (this, _("Left"), true);
_left_crop = new ContentSpinCtrl<VideoContent> (
this,
- new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1)),
+ new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (crop_width, -1)),
VideoContentProperty::CROP,
&Content::video,
boost::mem_fn (&VideoContent::left_crop),
boost::mem_fn (&VideoContent::set_left_crop)
);
- _right_crop_label = create_label (this, _("Right crop"), true);
+ _right_crop_label = create_label (this, _("Right"), true);
_right_crop = new ContentSpinCtrl<VideoContent> (
this,
- new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1)),
+ new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (crop_width, -1)),
VideoContentProperty::CROP,
&Content::video,
boost::mem_fn (&VideoContent::right_crop),
boost::mem_fn (&VideoContent::set_right_crop)
);
- _top_crop_label = create_label (this, _("Top crop"), true);
+ _top_crop_label = create_label (this, _("Top"), true);
_top_crop = new ContentSpinCtrl<VideoContent> (
this,
- new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1)),
+ new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (crop_width, -1)),
VideoContentProperty::CROP,
&Content::video,
boost::mem_fn (&VideoContent::top_crop),
boost::mem_fn (&VideoContent::set_top_crop)
);
- _bottom_crop_label = create_label (this, _("Bottom crop"), true);
+ _bottom_crop_label = create_label (this, _("Bottom"), true);
_bottom_crop = new ContentSpinCtrl<VideoContent> (
this,
- new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1)),
+ new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (crop_width, -1)),
VideoContentProperty::CROP,
&Content::video,
boost::mem_fn (&VideoContent::bottom_crop),
@@ -239,15 +247,28 @@ VideoPanel::add_to_grid ()
wxGridBagSizer* crop = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
add_label_to_sizer (crop, _left_crop_label, true, wxGBPosition (cr, 0));
_left_crop->add (crop, wxGBPosition (cr, 1));
+#ifdef __WXGTK3__
+ ++cr;
+ add_label_to_sizer (crop, _right_crop_label, true, wxGBPosition (cr, 0));
+ _right_crop->add (crop, wxGBPosition (cr, 1));
+#else
add_label_to_sizer (crop, _right_crop_label, true, wxGBPosition (cr, 2));
_right_crop->add (crop, wxGBPosition (cr, 3));
+#endif
++cr;
add_label_to_sizer (crop, _top_crop_label, true, wxGBPosition (cr, 0));
_top_crop->add (crop, wxGBPosition (cr, 1));
+#ifdef __WXGTK3__
+ ++cr;
+ add_label_to_sizer (crop, _bottom_crop_label, true, wxGBPosition (cr, 0));
+ _bottom_crop->add (crop, wxGBPosition (cr, 1));
+#else
add_label_to_sizer (crop, _bottom_crop_label, true, wxGBPosition (cr, 2));
_bottom_crop->add (crop, wxGBPosition (cr, 3));
- _grid->Add (crop, wxGBPosition (r, 0), wxGBSpan (2, 4));
- r += 2;
+#endif
+ add_label_to_sizer (_grid, _crop_label, true, wxGBPosition(r, 0));
+ _grid->Add (crop, wxGBPosition(r, 1));
+ ++r;
_scale_to_label->Show (full);
_scale->show (full);
diff --git a/src/wx/video_panel.h b/src/wx/video_panel.h
index 795a52a78..7d0f1f7d2 100644
--- a/src/wx/video_panel.h
+++ b/src/wx/video_panel.h
@@ -61,6 +61,7 @@ private:
wxStaticText* _reference_note;
wxStaticText* _type_label;
ContentChoice<VideoContent, VideoFrameType>* _frame_type;
+ wxStaticText* _crop_label;
wxStaticText* _left_crop_label;
ContentSpinCtrl<VideoContent>* _left_crop;
wxStaticText* _right_crop_label;