diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-07-04 02:23:29 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-07-04 02:23:29 +0100 |
| commit | c554c20be02b4a518be1be4266f90b88df9d5bd6 (patch) | |
| tree | 014aec0045a14dd44d811cefbd14e4dd6628fcf6 | |
| parent | 7bcf60f8ad3acd4dcae77a120216839b665c4335 (diff) | |
Replace checkboxes with tools.
| -rw-r--r-- | graphics/sequence.png | bin | 0 -> 637 bytes | |||
| -rw-r--r-- | graphics/snap.png | bin | 0 -> 956 bytes | |||
| -rw-r--r-- | graphics/src/sequence.svg | 132 | ||||
| -rw-r--r-- | graphics/src/snap.svg | 98 | ||||
| -rwxr-xr-x | graphics/update | 2 | ||||
| -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-- | graphics/wscript | 2 | ||||
| -rw-r--r-- | platform/osx/make_dmg.sh | 2 | ||||
| -rw-r--r-- | platform/windows/wscript | 2 | ||||
| -rw-r--r-- | src/wx/timeline.cc | 11 | ||||
| -rw-r--r-- | src/wx/timeline.h | 4 | ||||
| -rw-r--r-- | src/wx/timeline_dialog.cc | 66 | ||||
| -rw-r--r-- | src/wx/timeline_dialog.h | 8 |
16 files changed, 286 insertions, 41 deletions
diff --git a/graphics/sequence.png b/graphics/sequence.png Binary files differnew file mode 100644 index 000000000..a7a37cd7e --- /dev/null +++ b/graphics/sequence.png diff --git a/graphics/snap.png b/graphics/snap.png Binary files differnew file mode 100644 index 000000000..b77b348ca --- /dev/null +++ b/graphics/snap.png diff --git a/graphics/src/sequence.svg b/graphics/src/sequence.svg new file mode 100644 index 000000000..80ff46fcb --- /dev/null +++ b/graphics/src/sequence.svg @@ -0,0 +1,132 @@ +<?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="35mm" + height="35mm" + viewBox="0 0 35.000001 35" + version="1.1" + id="svg8" + inkscape:version="0.92.3 (2405546, 2018-03-11)" + sodipodi:docname="sequence.svg"> + <defs + id="defs2"> + <marker + inkscape:stockid="Arrow1Send" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Send" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path5962" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#ff0000;stroke-width:1pt;stroke-opacity:1;fill:#ff0000;fill-opacity:1" + transform="scale(0.2) rotate(180) translate(6,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Mend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Mend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path5956" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#ff0000;stroke-width:1pt;stroke-opacity:1;fill:#ff0000;fill-opacity:1" + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <marker + inkscape:stockid="Arrow1Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow1Lend" + style="overflow:visible;" + inkscape:isstock="true"> + <path + id="path5950" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" + transform="scale(0.8) rotate(180) translate(12.5,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="2.646104" + inkscape:cx="29.795572" + inkscape:cy="14.875552" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:window-width="1680" + inkscape:window-height="995" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + showguides="false" + inkscape:guide-bbox="true"> + <sodipodi:guide + position="-45.391614,73.531585" + orientation="-0.70710678,0.70710678" + id="guide5836" + inkscape:locked="false" /> + </sodipodi:namedview> + <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 /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-6.3144683,15.262769)"> + <rect + style="opacity:1;vector-effect:none;fill:#b3b3b3;fill-opacity:1;stroke:#000000;stroke-width:1.765;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-end:none" + id="rect5913" + width="14.908213" + height="27.597178" + x="0.76621103" + y="-11.259599" /> + <rect + style="opacity:1;vector-effect:none;fill:#b3b3b3;fill-opacity:1;stroke:#000000;stroke-width:1.765;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-end:none" + id="rect5913-5" + width="15.976793" + height="27.597178" + x="30.15259" + y="-11.259599" /> + <path + style="fill:#ff0000;stroke:#000000;stroke-width:1.16499996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 41.021535,-0.45918235 H 23.318465 V -5.2084699 L 5.3984455,2.5580121 23.188295,10.313263 V 5.9104505 h 17.83324 z" + id="path5822" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccc" /> + </g> +</svg> diff --git a/graphics/src/snap.svg b/graphics/src/snap.svg new file mode 100644 index 000000000..93efd695e --- /dev/null +++ b/graphics/src/snap.svg @@ -0,0 +1,98 @@ +<?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="35mm" + height="35mm" + viewBox="0 0 35.000001 35" + version="1.1" + id="svg8" + inkscape:version="0.92.3 (2405546, 2018-03-11)" + sodipodi:docname="snap.svg"> + <defs + id="defs2" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="2.646104" + inkscape:cx="78.707957" + inkscape:cy="65.653714" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:window-width="1680" + inkscape:window-height="995" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + showguides="false" + inkscape:guide-bbox="true"> + <sodipodi:guide + position="-45.391614,73.531585" + orientation="-0.70710678,0.70710678" + id="guide5836" + inkscape:locked="false" /> + </sodipodi:namedview> + <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(-6.3144683,15.262769)"> + <g + id="g5892" + transform="matrix(0.89522915,0,0,0.86858374,-35.262453,13.477405)" + style="stroke-width:1.13403654"> + <path + sodipodi:nodetypes="ccccc" + inkscape:connector-curvature="0" + id="path5834" + d="M 51.186866,5.924622 58.796301,4.6584122 C 46.035608,-33.625874 86.727695,-33.347165 73.857373,4.7734274 l 7.329493,1.1511946 c 18.111996,-49.172029 -48.026388,-50.240233 -30,0 z" + style="fill:#ff0000;stroke:none;stroke-width:2.00157428;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + sodipodi:nodetypes="ccccc" + inkscape:connector-curvature="0" + id="path5871" + d="m 49.302163,-2.6483781 1.884701,8.5729689 7.609437,-1.2661786 -1.780293,-8.6306493 z" + style="fill:#b3b3b3;stroke:none;stroke-width:0.30004713px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + sodipodi:nodetypes="ccccc" + inkscape:connector-curvature="0" + id="path5871-7" + d="m 73.857373,4.7734274 2.282549,-8.6879843 6.660056,1.2661787 -1.612755,8.5730903 z" + style="fill:#b3b3b3;stroke:none;stroke-width:0.30004713px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + sodipodi:nodetypes="ccccc" + inkscape:connector-curvature="0" + id="path5834-6" + d="M 51.187222,5.9246091 58.796301,4.6584122 C 46.035608,-33.625874 86.727697,-33.347165 73.857373,4.7734274 l 7.32985,1.1511817 c 18.111996,-49.1720291 -48.026389,-50.2402331 -30.000001,0 z" + style="fill:none;stroke:#000000;stroke-width:2.00157428;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + </g> + </g> +</svg> diff --git a/graphics/update b/graphics/update index 50923fc69..dfc2762d5 100755 --- a/graphics/update +++ b/graphics/update @@ -66,7 +66,7 @@ else $INKSCAPE splash.png src/splash.svg -w 400 -h 300 # Timeline toolbar icons (all platforms) - for i in select zoom zoom_all; do + for i in select zoom zoom_all snap sequence; do $INKSCAPE $i.png src/$i.svg -w 24 -h 24 done diff --git a/graphics/web/favicon-128x128.png b/graphics/web/favicon-128x128.png Binary files differindex 415c7f764..277f62ad2 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 0075ed7f6..7d066efdf 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 11214f1ac..92a79ec3b 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 8d968b9f7..172edee7e 100644 --- a/graphics/web/favicon-64x64.png +++ b/graphics/web/favicon-64x64.png diff --git a/graphics/wscript b/graphics/wscript index 7f88cd069..72418cb53 100644 --- a/graphics/wscript +++ b/graphics/wscript @@ -33,3 +33,5 @@ def build(bld): bld.install_files('${PREFIX}/share/dcpomatic2', 'zoom.png') bld.install_files('${PREFIX}/share/dcpomatic2', 'zoom_all.png') bld.install_files('${PREFIX}/share/dcpomatic2', 'select.png') + bld.install_files('${PREFIX}/share/dcpomatic2', 'snap.png') + bld.install_files('${PREFIX}/share/dcpomatic2', 'sequence.png') diff --git a/platform/osx/make_dmg.sh b/platform/osx/make_dmg.sh index 6e78fbe9f..2d3f5c47e 100644 --- a/platform/osx/make_dmg.sh +++ b/platform/osx/make_dmg.sh @@ -134,6 +134,8 @@ function copy_resources { cp $ROOT/32/src/dcpomatic/graphics/zoom.png "$dest" cp $ROOT/32/src/dcpomatic/graphics/zoom_all.png "$dest" cp $ROOT/32/src/dcpomatic/graphics/select.png "$dest" + cp $ROOT/32/src/dcpomatic/graphics/snap.png "$dest" + cp $ROOT/32/src/dcpomatic/graphics/sequence.png "$dest" # i18n: DCP-o-matic .mo files for lang in de_DE es_ES fr_FR it_IT sv_SE nl_NL ru_RU pl_PL da_DK pt_PT pt_BR sk_SK cs_CZ uk_UA zh_CN ar_LB fi_FI el_GR; do diff --git a/platform/windows/wscript b/platform/windows/wscript index faa8bf14d..e02d4c09f 100644 --- a/platform/windows/wscript +++ b/platform/windows/wscript @@ -279,6 +279,8 @@ File "%graphics%/splash.png" File "%graphics%/zoom.png" File "%graphics%/zoom_all.png" File "%graphics%/select.png" +File "%graphics%/snap.png" +File "%graphics%/sequence.png" SectionEnd """, file=f) diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index c60568e3a..8524db603 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -428,6 +428,8 @@ Timeline::left_down (wxMouseEvent& ev) break; case ZOOM: case ZOOM_ALL: + case SNAP: + case SEQUENCE: /* Nothing to do */ break; } @@ -499,6 +501,8 @@ Timeline::left_up (wxMouseEvent& ev) left_up_zoom (ev); break; case ZOOM_ALL: + case SNAP: + case SEQUENCE: break; } } @@ -571,6 +575,8 @@ Timeline::mouse_moved (wxMouseEvent& ev) mouse_moved_zoom (ev); break; case ZOOM_ALL: + case SNAP: + case SEQUENCE: break; } } @@ -611,6 +617,8 @@ Timeline::right_down (wxMouseEvent& ev) Refresh (); break; case ZOOM_ALL: + case SNAP: + case SEQUENCE: break; } } @@ -810,6 +818,9 @@ Timeline::tool_clicked (Tool t) case ZOOM_ALL: zoom_all (); break; + case SNAP: + case SEQUENCE: + break; } } diff --git a/src/wx/timeline.h b/src/wx/timeline.h index 2133a537d..2214ee13f 100644 --- a/src/wx/timeline.h +++ b/src/wx/timeline.h @@ -69,7 +69,9 @@ public: enum Tool { SELECT, ZOOM, - ZOOM_ALL + ZOOM_ALL, + SNAP, + SEQUENCE }; void tool_clicked (Tool t); diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc index d20f89db9..9194ed2bc 100644 --- a/src/wx/timeline_dialog.cc +++ b/src/wx/timeline_dialog.cc @@ -24,12 +24,14 @@ #include "content_panel.h" #include "lib/playlist.h" #include "lib/cross.h" +#include "lib/compose.hpp" #include <wx/graphics.h> #include <iostream> #include <list> using std::list; using std::cout; +using std::string; using boost::shared_ptr; TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film) @@ -53,25 +55,22 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film) { wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL); - wxBoxSizer* controls = new wxBoxSizer (wxHORIZONTAL); + wxBitmap select (bitmap_path("select"), wxBITMAP_TYPE_PNG); + wxBitmap zoom (bitmap_path ("zoom"), wxBITMAP_TYPE_PNG); + wxBitmap zoom_all (bitmap_path ("zoom_all"), wxBITMAP_TYPE_PNG); + wxBitmap snap (bitmap_path ("snap"), wxBITMAP_TYPE_PNG); + wxBitmap sequence (bitmap_path ("sequence"), wxBITMAP_TYPE_PNG); - wxBitmap select (wxString::Format (wxT ("%s/select.png"), std_to_wx (shared_path().string())), wxBITMAP_TYPE_PNG); - wxBitmap zoom (wxString::Format (wxT ("%s/zoom.png"), std_to_wx (shared_path().string())), wxBITMAP_TYPE_PNG); - wxBitmap zoom_all (wxString::Format (wxT ("%s/zoom_all.png"), std_to_wx (shared_path().string())), wxBITMAP_TYPE_PNG); + _toolbar = new wxToolBar (this, wxID_ANY); + _toolbar->AddRadioTool ((int) Timeline::SELECT, _("Select"), select, wxNullBitmap, _("Select and move content")); + _toolbar->AddRadioTool ((int) Timeline::ZOOM, _("Zoom"), zoom, wxNullBitmap, _("Zoom in / out")); + _toolbar->AddTool ((int) Timeline::ZOOM_ALL, _("Zoom all"), zoom_all, _("Zoom out to whole film")); + _toolbar->AddCheckTool ((int) Timeline::SNAP, _("Snap"), snap, wxNullBitmap, _("Snap")); + _toolbar->AddCheckTool ((int) Timeline::SEQUENCE, _("Sequence"), sequence, wxNullBitmap, _("Keep video and subtitles in sequence")); - wxToolBar* toolbar = new wxToolBar (this, wxID_ANY); - toolbar->AddRadioTool ((int) Timeline::SELECT, _("Select"), select, wxNullBitmap, _("Select and move content")); - toolbar->AddRadioTool ((int) Timeline::ZOOM, _("Zoom"), zoom, wxNullBitmap, _("Zoom in / out")); - toolbar->AddTool ((int) Timeline::ZOOM_ALL, _("Zoom all"), zoom_all, _("Zoom out to whole film")); - controls->Add (toolbar); - toolbar->Bind (wxEVT_TOOL, bind (&TimelineDialog::tool_clicked, this, _1)); + _toolbar->Bind (wxEVT_TOOL, bind (&TimelineDialog::tool_clicked, this, _1)); - _snap = new wxCheckBox (this, wxID_ANY, _("Snap")); - controls->Add (_snap); - _sequence = new wxCheckBox (this, wxID_ANY, _("Keep video and subtitles in sequence")); - controls->Add (_sequence, 1, wxLEFT, 12); - - sizer->Add (controls, 0, wxALL, 12); + sizer->Add (_toolbar, 0, wxALL, 12); sizer->Add (&_timeline, 1, wxEXPAND | wxALL, 12); #ifdef DCPOMATIC_LINUX @@ -85,29 +84,17 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film) sizer->Layout (); sizer->SetSizeHints (this); - _snap->SetValue (_timeline.snap ()); - _snap->Bind (wxEVT_CHECKBOX, boost::bind (&TimelineDialog::snap_toggled, this)); + _toolbar->ToggleTool ((int) Timeline::SNAP, _timeline.snap ()); film_changed (Film::SEQUENCE); - _sequence->Bind (wxEVT_CHECKBOX, boost::bind (&TimelineDialog::sequence_toggled, this)); _film_changed_connection = film->Changed.connect (bind (&TimelineDialog::film_changed, this, _1)); } -void -TimelineDialog::snap_toggled () -{ - _timeline.set_snap (_snap->GetValue ()); -} - -void -TimelineDialog::sequence_toggled () +wxString +TimelineDialog::bitmap_path (string name) { - shared_ptr<Film> film = _film.lock (); - if (!film) { - return; - } - - film->set_sequence (_sequence->GetValue ()); + boost::filesystem::path p = shared_path() / String::compose("%1.png", name); + return std_to_wx (p.string ()); } void @@ -119,7 +106,7 @@ TimelineDialog::film_changed (Film::Property p) } if (p == Film::SEQUENCE) { - _sequence->SetValue (film->sequence ()); + _toolbar->ToggleTool ((int) Timeline::SEQUENCE, film->sequence ()); } } @@ -132,5 +119,14 @@ TimelineDialog::set_selection (ContentList selection) void TimelineDialog::tool_clicked (wxCommandEvent& ev) { - _timeline.tool_clicked ((Timeline::Tool) ev.GetId()); + Timeline::Tool t = (Timeline::Tool) ev.GetId(); + _timeline.tool_clicked (t); + if (t == Timeline::SNAP) { + _timeline.set_snap (_snap->IsToggled()); + } else if (t == Timeline::SEQUENCE) { + shared_ptr<Film> film = _film.lock (); + if (film) { + film->set_sequence (_sequence->IsToggled()); + } + } } diff --git a/src/wx/timeline_dialog.h b/src/wx/timeline_dialog.h index 0d91baf22..e9156b89e 100644 --- a/src/wx/timeline_dialog.h +++ b/src/wx/timeline_dialog.h @@ -33,14 +33,14 @@ public: void set_selection (ContentList selection); private: - void snap_toggled (); - void sequence_toggled (); void film_changed (Film::Property); void tool_clicked (wxCommandEvent& id); + wxString bitmap_path (std::string name); boost::weak_ptr<Film> _film; Timeline _timeline; - wxCheckBox* _snap; - wxCheckBox* _sequence; + wxToolBar* _toolbar; + wxToolBarToolBase* _snap; + wxToolBarToolBase* _sequence; boost::signals2::scoped_connection _film_changed_connection; }; |
