From: Carl Hetherington Date: Sun, 25 Dec 2022 20:33:48 +0000 (+0100) Subject: Use icons at the top of the batch converter rather than text buttons at the bottom... X-Git-Tag: v2.16.38~7 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=66e0ee10200ba850087ac7d7dcaf1ef9a30c64b2 Use icons at the top of the batch converter rather than text buttons at the bottom (#2396). --- diff --git a/graphics/add_black.png b/graphics/add_black.png new file mode 100644 index 000000000..60f5dae10 Binary files /dev/null and b/graphics/add_black.png differ diff --git a/graphics/add_white.png b/graphics/add_white.png new file mode 100644 index 000000000..64d8ca6d9 Binary files /dev/null and b/graphics/add_white.png differ diff --git a/graphics/pause_black.png b/graphics/pause_black.png new file mode 100644 index 000000000..e2584b796 Binary files /dev/null and b/graphics/pause_black.png differ diff --git a/graphics/pause_white.png b/graphics/pause_white.png new file mode 100644 index 000000000..6e2b18126 Binary files /dev/null and b/graphics/pause_white.png differ diff --git a/graphics/src/batch_black.svg b/graphics/src/batch_black.svg new file mode 100644 index 000000000..3affcc9e1 --- /dev/null +++ b/graphics/src/batch_black.svg @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + diff --git a/graphics/src/batch_white.svg b/graphics/src/batch_white.svg new file mode 100644 index 000000000..bf7bb0901 --- /dev/null +++ b/graphics/src/batch_white.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/graphics/update b/graphics/update index f42c3182b..ff3baca04 100755 --- a/graphics/update +++ b/graphics/update @@ -101,6 +101,13 @@ else done done + # Batch converter toolbar icons (all platforms) + for c in black white; do + for i in add pause; do + inkbatch --inkscape $INKSCAPE -i batch-$i -o ${i}_${c}.png --width 32 --height 32 src/batch_$c.svg + done + done + # Playlist editor tick/no-tick $INKSCAPE_EXPORT --export-filename=tick.png src/tick.svg -w 16 -h 16 $INKSCAPE_EXPORT --export-filename=no_tick.png src/no_tick.svg -w 16 -h 16 diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc index 6e054edf8..8bb36476d 100644 --- a/src/tools/dcpomatic_batch.cc +++ b/src/tools/dcpomatic_batch.cc @@ -110,6 +110,11 @@ setup_menu (wxMenuBar* m) class DOMFrame : public wxFrame { public: + enum class Tool { + ADD, + PAUSE + }; + explicit DOMFrame (wxString const & title) : wxFrame (nullptr, -1, title) , _sizer (new wxBoxSizer(wxVERTICAL)) @@ -131,23 +136,21 @@ public: s->Add (panel, 1, wxEXPAND); SetSizer (s); - auto job_manager_view = new JobManagerView (panel, true); - _sizer->Add (job_manager_view, 1, wxALL | wxEXPAND, 6); + wxBitmap add(icon_path("add"), wxBITMAP_TYPE_PNG); + wxBitmap pause(icon_path("pause"), wxBITMAP_TYPE_PNG); - auto buttons = new wxBoxSizer (wxHORIZONTAL); - auto add = new Button (panel, _("Add Film...")); - add->Bind (wxEVT_BUTTON, boost::bind(&DOMFrame::add_film, this)); - buttons->Add (add, 1, wxALL, 6); - _pause = new Button (panel, _("Pause")); - _pause->Bind (wxEVT_BUTTON, boost::bind(&DOMFrame::pause, this)); - buttons->Add (_pause, 1, wxALL, 6); - _resume = new Button (panel, _("Resume")); - _resume->Bind (wxEVT_BUTTON, boost::bind(&DOMFrame::resume, this)); - buttons->Add (_resume, 1, wxALL, 6); + auto toolbar = new wxToolBar(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL); + toolbar->SetMargins(4, 4); + toolbar->SetToolBitmapSize(wxSize(32, 32)); + toolbar->AddTool(static_cast(Tool::ADD), _("Add film"), add, _("Add film for conversion")); + toolbar->AddCheckTool(static_cast(Tool::PAUSE), _("Pause/resume"), pause, wxNullBitmap, _("Pause or resume conversion")); + toolbar->Realize(); + _sizer->Add(toolbar, 0, wxALL, 6); - setup_sensitivity (); + toolbar->Bind(wxEVT_TOOL, bind(&DOMFrame::tool_clicked, this, _1)); - _sizer->Add (buttons, 0, wxALL, 6); + auto job_manager_view = new JobManagerView (panel, true); + _sizer->Add (job_manager_view, 1, wxALL | wxEXPAND, 6); panel->SetSizer (_sizer); @@ -155,22 +158,23 @@ public: Bind (wxEVT_SIZE, boost::bind(&DOMFrame::sized, this, _1)); } - void setup_sensitivity () - { - _pause->Enable (!JobManager::instance()->paused()); - _resume->Enable (JobManager::instance()->paused()); - } - - void pause () + void tool_clicked(wxCommandEvent& ev) { - JobManager::instance()->pause(); - setup_sensitivity (); - } - - void resume () - { - JobManager::instance()->resume(); - setup_sensitivity (); + switch (static_cast(ev.GetId())) { + case Tool::ADD: + add_film(); + break; + case Tool::PAUSE: + { + auto jm = JobManager::instance(); + if (jm->paused()) { + jm->resume(); + } else { + jm->pause(); + } + break; + } + } } void start_job (boost::filesystem::path path) @@ -354,8 +358,6 @@ private: wxSizer* _sizer; wxPreferencesEditor* _config_dialog = nullptr; ServersListDialog* _servers_list_dialog = nullptr; - wxButton* _pause; - wxButton* _resume; };