diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-05-12 00:11:01 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-05-12 13:13:36 +0200 |
| commit | 21606f2f5781f648c5dd26020983e4fdaec4fd19 (patch) | |
| tree | 66c46e6f86824f34d39f7bb9438acc707e56c0e7 | |
| parent | 61724dd3c9656d1e26ae945ce784ca50c2059695 (diff) | |
Add crop left/right top/bottom link control.
| -rw-r--r-- | graphics/link.png | bin | 0 -> 334 bytes | |||
| -rw-r--r-- | graphics/src/link.svg | 78 | ||||
| -rwxr-xr-x | graphics/update | 3 | ||||
| -rw-r--r-- | graphics/web/favicon-128x128.png | bin | 25054 -> 25054 bytes | |||
| -rw-r--r-- | graphics/web/favicon-16x16.png | bin | 1977 -> 1977 bytes | |||
| -rw-r--r-- | graphics/web/favicon-32x32.png | bin | 3755 -> 3755 bytes | |||
| -rw-r--r-- | graphics/web/favicon-64x64.png | bin | 9595 -> 9595 bytes | |||
| -rw-r--r-- | src/wx/video_panel.cc | 102 | ||||
| -rw-r--r-- | src/wx/video_panel.h | 9 |
9 files changed, 180 insertions, 12 deletions
diff --git a/graphics/link.png b/graphics/link.png Binary files differnew file mode 100644 index 000000000..69af402f6 --- /dev/null +++ b/graphics/link.png diff --git a/graphics/src/link.svg b/graphics/src/link.svg new file mode 100644 index 000000000..bf58ad7de --- /dev/null +++ b/graphics/src/link.svg @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="40.736046mm" + height="72.459007mm" + viewBox="0 0 40.736045 72.459008" + version="1.1" + id="svg8" + inkscape:version="0.92.3 (2405546, 2018-03-11)" + sodipodi:docname="link.svg"> + <defs + id="defs2" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="1.979899" + inkscape:cx="30.0516" + inkscape:cy="107.36255" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1680" + inkscape:window-height="995" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + fit-margin-top="1" + fit-margin-left="1" + fit-margin-right="1" + fit-margin-bottom="1" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-43.172802,-2.2134689)"> + <g + id="g11" + transform="matrix(-3.0676153e-5,-1.0020549,1.0020464,-0.00413633,25.020746,102.13853)" + style="stroke-width:0.99795336"> + <path + sodipodi:nodetypes="ccsccccccscscccccsssccc" + inkscape:connector-curvature="0" + id="rect819" + d="m 65.199219,27.601562 0.3125,0.01172 c 0,0 -1.921609,-0.08686 -3.953125,0.625 -2.031517,0.711861 -4.556382,2.227912 -6.824219,5.013672 l 6.205078,5.050781 c 1.370276,-1.683216 2.525799,-2.25443 3.265625,-2.513672 0.739826,-0.259241 0.679688,-0.199218 0.679688,-0.199218 l 0.15625,0.01172 h 19.550781 c 2.172037,0.06924 3.36417,0.821834 4.335937,2.03125 0.973224,1.211229 1.583731,3.040311 1.589844,4.931641 0.0061,1.89133 -0.59167,3.751118 -1.582031,5.015625 -0.986061,1.259016 -2.231578,2.067616 -4.441406,2.205078 h -15.51516 l -3.779762,8 h 19.626953 l 0.11914,-0.0078 c 4.347056,-0.25782 8.013718,-2.360449 10.289063,-5.26564 2.275345,-2.905192 3.294538,-6.465865 3.283203,-9.972657 C 98.506244,39.032271 97.46527,35.48507 95.164062,32.621094 92.862855,29.757118 89.15903,27.737178 84.832031,27.603516 l -0.0625,-0.002 z" + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:7.98362684;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> + <path + sodipodi:nodetypes="ccscscccccccccccscscccc" + inkscape:connector-curvature="0" + id="rect819-7" + d="m 41.986328,19.101562 -0.117187,0.0059 c -4.347056,0.257804 -8.013718,2.360434 -10.289063,5.265625 -2.275345,2.905191 -3.296491,6.467818 -3.285156,9.974609 0.01133,3.506791 1.054262,7.05204 3.355469,9.916016 2.301207,2.863976 6.005032,4.885869 10.332031,5.019531 l 0.0625,0.002 h 19.570312 l -0.3125,-0.01172 c 0,0 1.921609,0.08491 3.953125,-0.626954 2.031517,-0.711861 4.556382,-2.227911 6.824219,-5.013672 L 65.875,38.582031 c -1.370276,1.683217 -2.525798,2.256384 -3.265625,2.515625 -0.739827,0.259242 -0.681641,0.199219 -0.681641,0.199219 l -0.15625,-0.01172 H 42.220703 c -2.172033,-0.06924 -3.362218,-0.821835 -4.333984,-2.03125 -0.973223,-1.211229 -1.585684,-3.04031 -1.591797,-4.93164 -0.0061,-1.891331 0.59167,-3.751118 1.582031,-5.015625 0.984624,-1.257182 2.229804,-2.06585 4.433594,-2.205079 h 14.957961 l 4.346726,-8 z" + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:7.98362684;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> + </g> + </g> +</svg> diff --git a/graphics/update b/graphics/update index 9b75493db..f0a7fd597 100755 --- a/graphics/update +++ b/graphics/update @@ -84,6 +84,9 @@ else $INKSCAPE tick.png src/tick.svg -w 16 -h 16 $INKSCAPE no_tick.png src/no_tick.svg -w 16 -h 16 + # Link icon + $INKSCAPE link.png src/link.svg -w 9 -h 16 + # favicon mkdir -p web convert src/web.png -resize 256x256 -transparent white web/favicon-256x256.png diff --git a/graphics/web/favicon-128x128.png b/graphics/web/favicon-128x128.png Binary files differindex 621455641..9330c0cdc 100644 --- a/graphics/web/favicon-128x128.png +++ b/graphics/web/favicon-128x128.png diff --git a/graphics/web/favicon-16x16.png b/graphics/web/favicon-16x16.png Binary files differindex 4c31c0258..82639fddf 100644 --- a/graphics/web/favicon-16x16.png +++ b/graphics/web/favicon-16x16.png diff --git a/graphics/web/favicon-32x32.png b/graphics/web/favicon-32x32.png Binary files differindex 847bc813a..e9772da24 100644 --- a/graphics/web/favicon-32x32.png +++ b/graphics/web/favicon-32x32.png diff --git a/graphics/web/favicon-64x64.png b/graphics/web/favicon-64x64.png Binary files differindex e836814d1..0ff824f40 100644 --- a/graphics/web/favicon-64x64.png +++ b/graphics/web/favicon-64x64.png diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index 8a9136008..24099e1cc 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -38,6 +38,7 @@ #include "lib/dcp_content.h" #include "lib/video_content.h" #include <wx/spinctrl.h> +#include <wx/tglbtn.h> #include <boost/foreach.hpp> #include <boost/unordered_set.hpp> #include <boost/functional/hash.hpp> @@ -84,44 +85,57 @@ VideoPanel::VideoPanel (ContentPanel* p) _crop_label = create_label (this, _("Crop"), true); + int const crop_width = 56; + int const link_height = 28; + _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) + boost::mem_fn (&VideoContent::set_left_crop), + boost::bind (&VideoPanel::left_crop_changed, this) ); + _left_right_link = new wxToggleButton (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(22, link_height)); + _left_right_link->SetBitmap (wxBitmap(bitmap_path("link"), wxBITMAP_TYPE_PNG)); + _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) + boost::mem_fn (&VideoContent::set_right_crop), + boost::bind (&VideoPanel::right_crop_changed, this) ); _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) + boost::mem_fn (&VideoContent::set_top_crop), + boost::bind (&VideoPanel::top_crop_changed, this) ); + _top_bottom_link = new wxToggleButton (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(22, link_height)); + _top_bottom_link->SetBitmap (wxBitmap(bitmap_path("link"), wxBITMAP_TYPE_PNG)); + _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), - boost::mem_fn (&VideoContent::set_bottom_crop) + boost::mem_fn (&VideoContent::set_bottom_crop), + boost::bind (&VideoPanel::bottom_crop_changed, this) ); _fade_in_label = create_label (this, _("Fade in"), true); @@ -189,6 +203,8 @@ VideoPanel::VideoPanel (ContentPanel* p) _colour_conversion->Bind (wxEVT_CHOICE, boost::bind (&VideoPanel::colour_conversion_changed, this)); _range->Bind (wxEVT_CHOICE, boost::bind (&VideoPanel::range_changed, this)); _edit_colour_conversion_button->Bind (wxEVT_BUTTON, boost::bind (&VideoPanel::edit_colour_conversion_clicked, this)); + _left_right_link->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&VideoPanel::left_right_link_clicked, this)); + _top_bottom_link->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&VideoPanel::top_bottom_link_clicked, this)); add_to_grid (); } @@ -223,13 +239,15 @@ 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)); - add_label_to_sizer (crop, _right_crop_label, true, wxGBPosition (cr, 2)); - _right_crop->add (crop, wxGBPosition (cr, 3)); + crop->Add (_left_right_link, wxGBPosition(cr, 2)); + add_label_to_sizer (crop, _right_crop_label, true, wxGBPosition (cr, 3)); + _right_crop->add (crop, wxGBPosition (cr, 4)); ++cr; add_label_to_sizer (crop, _top_crop_label, true, wxGBPosition (cr, 0)); _top_crop->add (crop, wxGBPosition (cr, 1)); - add_label_to_sizer (crop, _bottom_crop_label, true, wxGBPosition (cr, 2)); - _bottom_crop->add (crop, wxGBPosition (cr, 3)); + crop->Add (_top_bottom_link, wxGBPosition(cr, 2)); + add_label_to_sizer (crop, _bottom_crop_label, true, wxGBPosition (cr, 3)); + _bottom_crop->add (crop, wxGBPosition (cr, 4)); add_label_to_sizer (_grid, _crop_label, true, wxGBPosition(r, 0)); _grid->Add (crop, wxGBPosition(r, 1)); ++r; @@ -739,3 +757,63 @@ VideoPanel::scale_custom_edit_clicked () return r == wxID_OK; } + +void +VideoPanel::left_right_link_clicked () +{ + right_crop_changed (); +} + + +void +VideoPanel::top_bottom_link_clicked () +{ + bottom_crop_changed (); +} + + +void +VideoPanel::left_crop_changed () +{ + if (_left_right_link->GetValue()) { + BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) { + i->video->set_right_crop (i->video->left_crop()); + } + } +} + + +void +VideoPanel::right_crop_changed () +{ + if (_left_right_link->GetValue()) { + BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) { + i->video->set_left_crop (i->video->right_crop()); + } + } +} + + +void +VideoPanel::top_crop_changed () +{ + if (_top_bottom_link->GetValue()) { + BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) { + i->video->set_bottom_crop (i->video->top_crop()); + } + } +} + + +void +VideoPanel::bottom_crop_changed () +{ + if (_top_bottom_link->GetValue()) { + BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_video()) { + i->video->set_top_crop (i->video->bottom_crop()); + } + } +} + + + diff --git a/src/wx/video_panel.h b/src/wx/video_panel.h index 22c564482..31aeed2e1 100644 --- a/src/wx/video_panel.h +++ b/src/wx/video_panel.h @@ -31,6 +31,7 @@ class wxChoice; class wxStaticText; class wxSpinCtrl; class wxButton; +class wxToggleButton; /** @class VideoPanel * @brief The video tab of the film editor. @@ -57,6 +58,12 @@ private: void scale_fit_clicked (); void scale_custom_clicked (); bool scale_custom_edit_clicked (); + void left_right_link_clicked (); + void top_bottom_link_clicked (); + void left_crop_changed (); + void right_crop_changed (); + void top_crop_changed (); + void bottom_crop_changed (); void setup_description (); void setup_sensitivity (); @@ -69,10 +76,12 @@ private: wxStaticText* _crop_label; wxStaticText* _left_crop_label; ContentSpinCtrl<VideoContent>* _left_crop; + wxToggleButton* _left_right_link; wxStaticText* _right_crop_label; ContentSpinCtrl<VideoContent>* _right_crop; wxStaticText* _top_crop_label; ContentSpinCtrl<VideoContent>* _top_crop; + wxToggleButton* _top_bottom_link; wxStaticText* _bottom_crop_label; ContentSpinCtrl<VideoContent>* _bottom_crop; wxStaticText* _fade_in_label; |
