From fecfda4c913da3f60ab4329d1f4f412bc27d19a7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 16 Oct 2022 22:21:34 +0200 Subject: Use slightly better icons for macOS prefs in dark mode. --- src/wx/config_dialog.cc | 2 +- src/wx/config_dialog.h | 6 +++--- src/wx/full_config_dialog.cc | 28 +++++++++++++++++++--------- 3 files changed, 23 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 7148fd173..07ab2d8aa 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -1054,7 +1054,7 @@ LocationsPage::GetName () const wxBitmap LocationsPage::GetLargeIcon () const { - return wxBitmap(bitmap_path("locations.png"), wxBITMAP_TYPE_PNG); + return wxBitmap(icon_path("locations"), wxBITMAP_TYPE_PNG); } #endif diff --git a/src/wx/config_dialog.h b/src/wx/config_dialog.h index c767929f7..a258e1fe2 100644 --- a/src/wx/config_dialog.h +++ b/src/wx/config_dialog.h @@ -88,7 +88,7 @@ public: #ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const override { - return wxBitmap(bitmap_path("general.png"), wxBITMAP_TYPE_PNG); + return wxBitmap(icon_path("general"), wxBITMAP_TYPE_PNG); } #endif @@ -166,7 +166,7 @@ public: #ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const override { - return wxBitmap(bitmap_path("keys.png"), wxBITMAP_TYPE_PNG); + return wxBitmap(icon_path("keys"), wxBITMAP_TYPE_PNG); } #endif @@ -197,7 +197,7 @@ public: #ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const override { - return wxBitmap(bitmap_path("sound.png"), wxBITMAP_TYPE_PNG); + return wxBitmap(icon_path("sound"), wxBITMAP_TYPE_PNG); } #endif diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index 40cb0c285..6b0be4603 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -84,6 +84,16 @@ using namespace boost::placeholders; using dcp::locale_convert; +#ifdef DCPOMATIC_OSX +static +wxString +icon_path(string name) +{ + return gui_is_dark() ? bitmap_path(String::compose("%1_white.png", name)) : bitmap_path(String::compose("%1_black.png", name)); +} +#endif + + class FullGeneralPage : public GeneralPage { public: @@ -257,7 +267,7 @@ public: #ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const override { - return wxBitmap(bitmap_path("defaults.png"), wxBITMAP_TYPE_PNG); + return wxBitmap(icon_path("defaults"), wxBITMAP_TYPE_PNG); } #endif @@ -615,7 +625,7 @@ public: #ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const override { - return wxBitmap(bitmap_path("servers.png"), wxBITMAP_TYPE_PNG); + return wxBitmap(icon_path("servers"), wxBITMAP_TYPE_PNG); } #endif @@ -678,7 +688,7 @@ public: #ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const override { - return wxBitmap(bitmap_path("tms.png"), wxBITMAP_TYPE_PNG); + return wxBitmap(icon_path("tms"), wxBITMAP_TYPE_PNG); } #endif @@ -789,7 +799,7 @@ public: #ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const override { - return wxBitmap(bitmap_path("email.png"), wxBITMAP_TYPE_PNG); + return wxBitmap(icon_path("email"), wxBITMAP_TYPE_PNG); } #endif @@ -961,7 +971,7 @@ public: #ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const override { - return wxBitmap(bitmap_path("kdm_email.png"), wxBITMAP_TYPE_PNG); + return wxBitmap(icon_path("kdm_email"), wxBITMAP_TYPE_PNG); } #endif @@ -1086,7 +1096,7 @@ public: #ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const override { - return wxBitmap(bitmap_path("notifications.png"), wxBITMAP_TYPE_PNG); + return wxBitmap(icon_path("notifications"), wxBITMAP_TYPE_PNG); } #endif @@ -1262,7 +1272,7 @@ public: #ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const override { - return wxBitmap(bitmap_path("cover_sheet.png"), wxBITMAP_TYPE_PNG); + return wxBitmap(icon_path("cover_sheet"), wxBITMAP_TYPE_PNG); } #endif @@ -1321,7 +1331,7 @@ public: #ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const override { - return wxBitmap(bitmap_path("identifiers.png"), wxBITMAP_TYPE_PNG); + return wxBitmap(icon_path("identifiers"), wxBITMAP_TYPE_PNG); } #endif @@ -1439,7 +1449,7 @@ public: #ifdef DCPOMATIC_OSX wxBitmap GetLargeIcon () const override { - return wxBitmap(bitmap_path("advanced.png"), wxBITMAP_TYPE_PNG); + return wxBitmap(icon_path("advanced"), wxBITMAP_TYPE_PNG); } #endif -- cgit v1.2.3 From 93a781c8b9d34effd376537268970193b9b01479 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 16 Oct 2022 22:21:49 +0200 Subject: Fix dark mode for release notes. --- src/lib/release_notes.cc | 12 ++++++++---- src/lib/release_notes.h | 2 +- src/tools/dcpomatic.cc | 2 +- src/wx/html_dialog.cc | 4 ++++ test/release_notes_test.cc | 4 ++-- 5 files changed, 16 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/lib/release_notes.cc b/src/lib/release_notes.cc index 236713184..d69738427 100644 --- a/src/lib/release_notes.cc +++ b/src/lib/release_notes.cc @@ -31,7 +31,7 @@ using boost::optional; optional -find_release_notes(optional current) +find_release_notes(bool dark, optional current) { auto last = Config::instance()->last_release_notes_version(); if (!current) { @@ -43,14 +43,18 @@ find_release_notes(optional current) Config::instance()->set_last_release_notes_version(*current); - const string header = String::compose("

DCP-o-matic %1 release notes

", *current); + string const colour = dark ? "white" : "black"; + auto const span = String::compose("", colour); + + const string header = String::compose("

%1DCP-o-matic %2 release notes

", span, *current); if (!last) { - return header + + return header + span + _("In this version there are changes to the way that subtitles are positioned. " "Positioning should now be more correct, with respect to the standards, but you " "should check any subtitles in your project to make sure that they are placed " - "where you want them."); + "where you want them.") + + "
"; } return {}; diff --git a/src/lib/release_notes.h b/src/lib/release_notes.h index a5026b432..d0837248b 100644 --- a/src/lib/release_notes.h +++ b/src/lib/release_notes.h @@ -23,4 +23,4 @@ #include -extern boost::optional find_release_notes(boost::optional current = boost::optional()); +extern boost::optional find_release_notes(bool dark, boost::optional current = boost::optional()); diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index eec81d3c8..001d1859e 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -1746,7 +1746,7 @@ private: UpdateChecker::instance()->run (); } - auto release_notes = find_release_notes(); + auto release_notes = find_release_notes(gui_is_dark()); if (release_notes) { auto notes = new HTMLDialog(nullptr, _("Release notes"), std_to_wx(*release_notes), true); notes->Centre(); diff --git a/src/wx/html_dialog.cc b/src/wx/html_dialog.cc index 19c3aaf2a..c8138c8cd 100644 --- a/src/wx/html_dialog.cc +++ b/src/wx/html_dialog.cc @@ -52,6 +52,10 @@ HTMLDialog::HTMLDialog (wxWindow* parent, wxString title, wxString html, bool ok h->SetPage (html); sizer->Add (h, 1, wxEXPAND | wxALL, 6); + if (gui_is_dark()) { + h->SetHTMLBackgroundColour(*wxBLACK); + } + h->Bind (wxEVT_HTML_LINK_CLICKED, boost::bind(&HTMLDialog::link_clicked, this, _1)); SetSizer (sizer); diff --git a/test/release_notes_test.cc b/test/release_notes_test.cc index 394de5959..c05ad2618 100644 --- a/test/release_notes_test.cc +++ b/test/release_notes_test.cc @@ -32,7 +32,7 @@ BOOST_AUTO_TEST_CASE(release_notes_test1) { for (auto version: { "2.16.19", "2.16.20", "2.18.0", "2.18.1devel6" }) { Config::instance()->unset_last_release_notes_version(); - auto notes = find_release_notes(string(version)); + auto notes = find_release_notes(true, string(version)); BOOST_CHECK(notes.get_value_or("").find("In this version there are changes to the way that subtitles are positioned.") != string::npos); } } @@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE(release_notes_test2) { for (auto version: { "2.16.19", "2.16.20", "2.18.0", "2.18.1devel6" }) { Config::instance()->set_last_release_notes_version("2.16.19"); - auto notes = find_release_notes(string(version)); + auto notes = find_release_notes(false, string(version)); BOOST_CHECK(!static_cast(notes)); } } -- cgit v1.2.3 From 1350e2f5cf87a419136c10370e46fd7d82f27efc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 16 Oct 2022 22:22:22 +0200 Subject: Fix colouring of audio plot in dark mode. --- src/wx/audio_dialog.cc | 11 +++++++---- src/wx/audio_plot.cc | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc index a4f1dd514..e433f45fd 100644 --- a/src/wx/audio_dialog.cc +++ b/src/wx/audio_dialog.cc @@ -399,10 +399,13 @@ AudioDialog::setup_statistics () ) ); + wxColour const peaking = *wxRED; + wxColour const not_peaking = gui_is_dark() ? *wxWHITE : *wxBLACK; + if (peak_dB > -3) { - _sample_peak->SetForegroundColour (wxColour (255, 0, 0)); + _sample_peak->SetForegroundColour(peaking); } else { - _sample_peak->SetForegroundColour (wxColour (0, 0, 0)); + _sample_peak->SetForegroundColour(not_peaking); } if (_analysis->overall_true_peak()) { @@ -412,9 +415,9 @@ AudioDialog::setup_statistics () _true_peak->SetLabel (wxString::Format (_("True peak is %.2fdB"), peak_dB)); if (peak_dB > -3) { - _true_peak->SetForegroundColour (wxColour (255, 0, 0)); + _true_peak->SetForegroundColour(peaking); } else { - _true_peak->SetForegroundColour (wxColour (0, 0, 0)); + _true_peak->SetForegroundColour(not_peaking); } } diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index 59df0425b..cac939ac0 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -72,7 +72,11 @@ AudioPlot::AudioPlot(wxWindow* parent, FilmViewer& viewer) _type_visible[i] = false; } - _colours.push_back (wxColour ( 0, 0, 0)); + if (gui_is_dark()) { + _colours.push_back(wxColour(255, 255, 255)); + } else { + _colours.push_back(wxColour(0, 0, 0)); + } _colours.push_back (wxColour (255, 0, 0)); _colours.push_back (wxColour ( 0, 255, 0)); _colours.push_back (wxColour (139, 0, 204)); @@ -165,14 +169,14 @@ AudioPlot::paint () gc->SetAntialiasMode (wxANTIALIAS_DEFAULT); if (!_analysis || _analysis->channels() == 0) { - gc->SetFont (gc->CreateFont (*wxNORMAL_FONT)); + gc->SetFont(gc->CreateFont(*wxNORMAL_FONT, gui_is_dark() ? *wxWHITE : *wxBLACK)); gc->DrawText (_message, 32, 32); delete gc; return; } auto h_grid = gc->CreatePath (); - gc->SetFont (gc->CreateFont (*wxSMALL_FONT)); + gc->SetFont(gc->CreateFont(*wxSMALL_FONT, gui_is_dark() ? *wxWHITE : *wxBLACK)); wxDouble db_label_height; wxDouble db_label_descent; wxDouble db_label_leading; @@ -195,7 +199,9 @@ AudioPlot::paint () gc->DrawText (std_to_wx (String::compose ("%1dB", i)), 0, y - (db_label_height / 2)); } - gc->SetPen (wxPen (wxColour (200, 200, 200))); + wxColour const grid_colour = gui_is_dark() ? wxColour(80, 80, 80) : wxColour(200, 200, 200); + + gc->SetPen(wxPen(grid_colour)); gc->StrokePath (h_grid); /* Draw an x axis with marks */ @@ -205,8 +211,6 @@ AudioPlot::paint () DCPOMATIC_ASSERT (_analysis->samples_per_point() != 0.0); double const pps = _analysis->sample_rate() * metrics.x_scale / _analysis->samples_per_point(); - gc->SetPen (*wxThePenList->FindOrCreatePen (wxColour (0, 0, 0), 1, wxPENSTYLE_SOLID)); - double const mark_interval = calculate_mark_interval (rint (128 / pps)); auto t = DCPTime::from_seconds (mark_interval); @@ -234,7 +238,7 @@ AudioPlot::paint () t += DCPTime::from_seconds (mark_interval); } - gc->SetPen (wxPen (wxColour (200, 200, 200))); + gc->SetPen(wxPen(grid_colour)); gc->StrokePath (v_grid); if (_type_visible[AudioPoint::PEAK]) { @@ -265,7 +269,7 @@ AudioPlot::paint () axes.MoveToPoint (metrics.db_label_width, 0); axes.AddLineToPoint (metrics.db_label_width, metrics.height - metrics.y_origin); axes.AddLineToPoint (metrics.db_label_width + data_width, metrics.height - metrics.y_origin); - gc->SetPen (wxPen (wxColour (0, 0, 0))); + gc->SetPen(wxPen(grid_colour)); gc->StrokePath (axes); if (_cursor) { -- cgit v1.2.3 From 63ce266351683a94630d7aba58405301b8a8d993 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 17 Oct 2022 00:46:05 +0200 Subject: Use different icons for the timeline in dark/light modes. --- cscript | 15 ++- graphics/select_black.png | Bin 0 -> 1318 bytes graphics/select_white.png | Bin 0 -> 1266 bytes graphics/sequence_black.png | Bin 0 -> 486 bytes graphics/sequence_white.png | Bin 0 -> 539 bytes graphics/snap_black.png | Bin 0 -> 1235 bytes graphics/snap_white.png | Bin 0 -> 1246 bytes graphics/src/timeline.svg | 199 ---------------------------------------- graphics/src/timeline_black.svg | 199 ++++++++++++++++++++++++++++++++++++++++ graphics/src/timeline_white.svg | 189 ++++++++++++++++++++++++++++++++++++++ graphics/update | 6 +- graphics/wscript | 15 ++- graphics/zoom_all_black.png | Bin 0 -> 957 bytes graphics/zoom_all_white.png | Bin 0 -> 1118 bytes graphics/zoom_black.png | Bin 0 -> 924 bytes graphics/zoom_white.png | Bin 0 -> 1094 bytes platform/osx/make_dmg.sh | 10 +- platform/windows/wscript | 15 ++- src/wx/full_config_dialog.cc | 10 -- src/wx/timeline_dialog.cc | 10 +- src/wx/wx_util.cc | 7 ++ src/wx/wx_util.h | 1 + 22 files changed, 440 insertions(+), 236 deletions(-) create mode 100644 graphics/select_black.png create mode 100644 graphics/select_white.png create mode 100644 graphics/sequence_black.png create mode 100644 graphics/sequence_white.png create mode 100644 graphics/snap_black.png create mode 100644 graphics/snap_white.png delete mode 100644 graphics/src/timeline.svg create mode 100644 graphics/src/timeline_black.svg create mode 100644 graphics/src/timeline_white.svg create mode 100644 graphics/zoom_all_black.png create mode 100644 graphics/zoom_all_white.png create mode 100644 graphics/zoom_black.png create mode 100644 graphics/zoom_white.png (limited to 'src') diff --git a/cscript b/cscript index 54af98a7d..f0f0d3fbf 100644 --- a/cscript +++ b/cscript @@ -368,11 +368,16 @@ def make_spec(filename, version, target, options, requires=None): if can_build_disk(target): print('%{_datadir}/applications/dcpomatic2_disk.desktop', file=f) print('%{_datadir}/dcpomatic2/dcpomatic2_server_small.png', file=f) - print('%{_datadir}/dcpomatic2/select.png', file=f) - print('%{_datadir}/dcpomatic2/sequence.png', file=f) - print('%{_datadir}/dcpomatic2/snap.png', file=f) - print('%{_datadir}/dcpomatic2/zoom.png', file=f) - print('%{_datadir}/dcpomatic2/zoom_all.png', file=f) + print('%{_datadir}/dcpomatic2/select_white.png', file=f) + print('%{_datadir}/dcpomatic2/select_black.png', file=f) + print('%{_datadir}/dcpomatic2/sequence_white.png', file=f) + print('%{_datadir}/dcpomatic2/sequence_black.png', file=f) + print('%{_datadir}/dcpomatic2/snap_white.png', file=f) + print('%{_datadir}/dcpomatic2/snap_black.png', file=f) + print('%{_datadir}/dcpomatic2/zoom_white.png', file=f) + print('%{_datadir}/dcpomatic2/zoom_black.png', file=f) + print('%{_datadir}/dcpomatic2/zoom_all_white.png', file=f) + print('%{_datadir}/dcpomatic2/zoom_all_black.png', file=f) print('%{_datadir}/dcpomatic2/tick.png', file=f) print('%{_datadir}/dcpomatic2/no_tick.png', file=f) print('%{_datadir}/dcpomatic2/link.png', file=f) diff --git a/graphics/select_black.png b/graphics/select_black.png new file mode 100644 index 000000000..aa0dbdcc5 Binary files /dev/null and b/graphics/select_black.png differ diff --git a/graphics/select_white.png b/graphics/select_white.png new file mode 100644 index 000000000..aa48c770a Binary files /dev/null and b/graphics/select_white.png differ diff --git a/graphics/sequence_black.png b/graphics/sequence_black.png new file mode 100644 index 000000000..c16b7096f Binary files /dev/null and b/graphics/sequence_black.png differ diff --git a/graphics/sequence_white.png b/graphics/sequence_white.png new file mode 100644 index 000000000..67592d0d9 Binary files /dev/null and b/graphics/sequence_white.png differ diff --git a/graphics/snap_black.png b/graphics/snap_black.png new file mode 100644 index 000000000..01580dcbd Binary files /dev/null and b/graphics/snap_black.png differ diff --git a/graphics/snap_white.png b/graphics/snap_white.png new file mode 100644 index 000000000..801e9c599 Binary files /dev/null and b/graphics/snap_white.png differ diff --git a/graphics/src/timeline.svg b/graphics/src/timeline.svg deleted file mode 100644 index 58e27720a..000000000 --- a/graphics/src/timeline.svg +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/graphics/src/timeline_black.svg b/graphics/src/timeline_black.svg new file mode 100644 index 000000000..58e27720a --- /dev/null +++ b/graphics/src/timeline_black.svg @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/graphics/src/timeline_white.svg b/graphics/src/timeline_white.svg new file mode 100644 index 000000000..14dd8ccce --- /dev/null +++ b/graphics/src/timeline_white.svg @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/graphics/update b/graphics/update index 755b73fc0..f42c3182b 100755 --- a/graphics/update +++ b/graphics/update @@ -95,8 +95,10 @@ else $INKSCAPE_EXPORT --export-filename=splash.png src/splash.svg -w 400 -h 300 # Timeline toolbar icons (all platforms) - for i in select zoom zoom_all snap sequence; do - inkbatch --inkscape $INKSCAPE -i timeline-$i -o $i.png --width 32 --height 32 src/timeline.svg + for c in black white; do + for i in select zoom zoom_all snap sequence; do + inkbatch --inkscape $INKSCAPE -i timeline-$i -o ${i}_${c}.png --width 32 --height 32 src/timeline_$c.svg + done done # Playlist editor tick/no-tick diff --git a/graphics/wscript b/graphics/wscript index c87904683..c67d0695b 100644 --- a/graphics/wscript +++ b/graphics/wscript @@ -39,11 +39,16 @@ def build(bld): if not bld.env.TARGET_WINDOWS_64 and not bld.env.TARGET_WINDOWS_32 and not bld.env.DISABLE_GUI: bld.install_as('${PREFIX}/share/dcpomatic2/dcpomatic2_server_small.png', 'linux/16/dcpomatic2.png') bld.install_files('${PREFIX}/share/dcpomatic2', 'splash.png') - 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') + bld.install_files('${PREFIX}/share/dcpomatic2', 'zoom_white.png') + bld.install_files('${PREFIX}/share/dcpomatic2', 'zoom_black.png') + bld.install_files('${PREFIX}/share/dcpomatic2', 'select_white.png') + bld.install_files('${PREFIX}/share/dcpomatic2', 'select_black.png') + bld.install_files('${PREFIX}/share/dcpomatic2', 'snap_white.png') + bld.install_files('${PREFIX}/share/dcpomatic2', 'snap_black.png') + bld.install_files('${PREFIX}/share/dcpomatic2', 'sequence_white.png') + bld.install_files('${PREFIX}/share/dcpomatic2', 'sequence_black.png') + bld.install_files('${PREFIX}/share/dcpomatic2', 'zoom_all_white.png') + bld.install_files('${PREFIX}/share/dcpomatic2', 'zoom_all_black.png') bld.install_files('${PREFIX}/share/dcpomatic2', 'me.jpg') bld.install_files('${PREFIX}/share/dcpomatic2', 'tick.png') bld.install_files('${PREFIX}/share/dcpomatic2', 'no_tick.png') diff --git a/graphics/zoom_all_black.png b/graphics/zoom_all_black.png new file mode 100644 index 000000000..19ccb7148 Binary files /dev/null and b/graphics/zoom_all_black.png differ diff --git a/graphics/zoom_all_white.png b/graphics/zoom_all_white.png new file mode 100644 index 000000000..ed376ec37 Binary files /dev/null and b/graphics/zoom_all_white.png differ diff --git a/graphics/zoom_black.png b/graphics/zoom_black.png new file mode 100644 index 000000000..4633c8cb3 Binary files /dev/null and b/graphics/zoom_black.png differ diff --git a/graphics/zoom_white.png b/graphics/zoom_white.png new file mode 100644 index 000000000..50890f120 Binary files /dev/null and b/graphics/zoom_white.png differ diff --git a/platform/osx/make_dmg.sh b/platform/osx/make_dmg.sh index 3285f7d1d..40eabef1f 100644 --- a/platform/osx/make_dmg.sh +++ b/platform/osx/make_dmg.sh @@ -242,11 +242,11 @@ function copy_resources { cp $prefix/src/dcpomatic/fonts/LiberationSans-Bold.ttf "$dest" cp $prefix/src/dcpomatic/fonts/fonts.conf.osx "$dest"/fonts.conf cp $prefix/src/dcpomatic/graphics/splash.png "$dest" - cp $prefix/src/dcpomatic/graphics/zoom.png "$dest" - cp $prefix/src/dcpomatic/graphics/zoom_all.png "$dest" - cp $prefix/src/dcpomatic/graphics/select.png "$dest" - cp $prefix/src/dcpomatic/graphics/snap.png "$dest" - cp $prefix/src/dcpomatic/graphics/sequence.png "$dest" + cp $prefix/src/dcpomatic/graphics/zoom*.png "$dest" + cp $prefix/src/dcpomatic/graphics/zoom_all*.png "$dest" + cp $prefix/src/dcpomatic/graphics/select*.png "$dest" + cp $prefix/src/dcpomatic/graphics/snap*.png "$dest" + cp $prefix/src/dcpomatic/graphics/sequence*.png "$dest" cp $prefix/src/dcpomatic/graphics/me.jpg "$dest" cp $prefix/src/dcpomatic/graphics/link.png "$dest" cp $prefix/src/dcpomatic/graphics/tick.png "$dest" diff --git a/platform/windows/wscript b/platform/windows/wscript index 84291b3ca..94b7fc3d3 100644 --- a/platform/windows/wscript +++ b/platform/windows/wscript @@ -306,11 +306,16 @@ File "%resources%/../../fonts/LiberationSans-Italic.ttf" File "%resources%/../../fonts/LiberationSans-Bold.ttf" File /oname=fonts.conf "%resources%/../../fonts/fonts.conf.windows" 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" +File "%graphics%/zoom_white.png" +File "%graphics%/zoom_black.png" +File "%graphics%/zoom_all_white.png" +File "%graphics%/zoom_all_black.png" +File "%graphics%/select_white.png" +File "%graphics%/select_black.png" +File "%graphics%/snap_white.png" +File "%graphics%/snap_black.png" +File "%graphics%/sequence_white.png" +File "%graphics%/sequence_black.png" File "%graphics%/me.jpg" File "%graphics%/tick.png" File "%graphics%/no_tick.png" diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index 6b0be4603..1aeacd3ca 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -84,16 +84,6 @@ using namespace boost::placeholders; using dcp::locale_convert; -#ifdef DCPOMATIC_OSX -static -wxString -icon_path(string name) -{ - return gui_is_dark() ? bitmap_path(String::compose("%1_white.png", name)) : bitmap_path(String::compose("%1_black.png", name)); -} -#endif - - class FullGeneralPage : public GeneralPage { public: diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc index 91737f204..0d05e66d6 100644 --- a/src/wx/timeline_dialog.cc +++ b/src/wx/timeline_dialog.cc @@ -63,11 +63,11 @@ TimelineDialog::TimelineDialog(ContentPanel* cp, shared_ptr film, FilmView { auto sizer = new wxBoxSizer (wxVERTICAL); - wxBitmap select (bitmap_path("select.png"), wxBITMAP_TYPE_PNG); - wxBitmap zoom (bitmap_path("zoom.png"), wxBITMAP_TYPE_PNG); - wxBitmap zoom_all (bitmap_path("zoom_all.png"), wxBITMAP_TYPE_PNG); - wxBitmap snap (bitmap_path("snap.png"), wxBITMAP_TYPE_PNG); - wxBitmap sequence (bitmap_path("sequence.png"), wxBITMAP_TYPE_PNG); + wxBitmap select(icon_path("select"), wxBITMAP_TYPE_PNG); + wxBitmap zoom(icon_path("zoom"), wxBITMAP_TYPE_PNG); + wxBitmap zoom_all(icon_path("zoom_all"), wxBITMAP_TYPE_PNG); + wxBitmap snap(icon_path("snap"), wxBITMAP_TYPE_PNG); + wxBitmap sequence(icon_path("sequence"), wxBITMAP_TYPE_PNG); _toolbar = new wxToolBar (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL); _toolbar->SetMargins (4, 4); diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 9d9d4c599..074f47d61 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -651,6 +651,13 @@ bitmap_path (string name) } +wxString +icon_path(string name) +{ + return gui_is_dark() ? bitmap_path(String::compose("%1_white.png", name)) : bitmap_path(String::compose("%1_black.png", name)); +} + + wxSize small_button_size (wxWindow* parent, wxString text) { diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h index fb1a3a001..50fb7268f 100644 --- a/src/wx/wx_util.h +++ b/src/wx/wx_util.h @@ -119,6 +119,7 @@ extern double calculate_mark_interval (double start); extern bool display_progress (wxString title, wxString task); extern bool report_errors_from_last_job (wxWindow* parent); extern wxString bitmap_path (std::string name); +extern wxString icon_path(std::string name); extern wxSize small_button_size (wxWindow* parent, wxString text); extern bool gui_is_dark (); extern double dpi_scale_factor (wxWindow* window); -- cgit v1.2.3 From 179685ef5cfb81d362282ee2fae526533e6404a3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 17 Oct 2022 20:36:55 +0200 Subject: Improve timeline view colouring in dark mode. --- src/wx/timeline.cc | 2 +- src/wx/timeline_labels_view.cc | 4 +++- src/wx/timeline_reels_view.cc | 6 ++++-- src/wx/timeline_time_axis_view.cc | 5 +++-- 4 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index 6886daa42..a9372b6bb 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -207,7 +207,7 @@ Timeline::paint_main () if (_zoom_point) { /* Translate back as _down_point and _zoom_point do not take scroll into account */ gc->Translate (vsx * _x_scroll_rate, vsy * _y_scroll_rate); - gc->SetPen (*wxBLACK_PEN); + gc->SetPen(gui_is_dark() ? *wxWHITE_PEN : *wxBLACK_PEN); gc->SetBrush (*wxTRANSPARENT_BRUSH); gc->DrawRectangle ( min (_down_point.x, _zoom_point->x), diff --git a/src/wx/timeline_labels_view.cc b/src/wx/timeline_labels_view.cc index 7075d4b7d..181adc5ca 100644 --- a/src/wx/timeline_labels_view.cc +++ b/src/wx/timeline_labels_view.cc @@ -21,6 +21,7 @@ #include "timeline.h" #include "timeline_labels_view.h" +#include "wx_util.h" #include LIBDCP_DISABLE_WARNINGS #include @@ -64,7 +65,8 @@ void TimelineLabelsView::do_paint (wxGraphicsContext* gc, list>) { int const h = _timeline.pixels_per_track (); - gc->SetFont (gc->CreateFont(wxNORMAL_FONT->Bold(), wxColour(0, 0, 0))); + wxColour const colour = gui_is_dark() ? *wxWHITE : *wxBLACK; + gc->SetFont(gc->CreateFont(wxNORMAL_FONT->Bold(), colour)); int fy = 0; if (_video_tracks) { diff --git a/src/wx/timeline_reels_view.cc b/src/wx/timeline_reels_view.cc index 331f6580d..2ec8f9e82 100644 --- a/src/wx/timeline_reels_view.cc +++ b/src/wx/timeline_reels_view.cc @@ -21,6 +21,7 @@ #include "timeline.h" #include "timeline_reels_view.h" +#include "wx_util.h" #include LIBDCP_DISABLE_WARNINGS #include @@ -65,14 +66,15 @@ TimelineReelsView::do_paint (wxGraphicsContext* gc, list>) double const pps = _timeline.pixels_per_second().get (); - gc->SetPen (*wxThePenList->FindOrCreatePen (wxColour (0, 0, 255), 1, wxPENSTYLE_SOLID)); + wxColour const colour = gui_is_dark() ? wxColour(182, 204, 240) : wxColour(0, 0, 255); + gc->SetPen(*wxThePenList->FindOrCreatePen(colour, 1, wxPENSTYLE_SOLID)); auto path = gc->CreatePath (); path.MoveToPoint (time_x (DCPTime (0)), _y); path.AddLineToPoint (time_x (_timeline.film()->length()), _y); gc->StrokePath (path); - gc->SetFont (gc->CreateFont (*wxNORMAL_FONT, wxColour (0, 0, 255))); + gc->SetFont(gc->CreateFont(*wxNORMAL_FONT, colour)); int reel = 1; for (auto i: _timeline.film()->reels()) { diff --git a/src/wx/timeline_time_axis_view.cc b/src/wx/timeline_time_axis_view.cc index 023b42ec7..3b1b3cd99 100644 --- a/src/wx/timeline_time_axis_view.cc +++ b/src/wx/timeline_time_axis_view.cc @@ -67,7 +67,8 @@ TimelineTimeAxisView::do_paint (wxGraphicsContext* gc, list double const pps = _timeline.pixels_per_second().get (); - gc->SetPen (*wxThePenList->FindOrCreatePen (wxColour (0, 0, 0), 1, wxPENSTYLE_SOLID)); + wxColour const colour = gui_is_dark() ? *wxWHITE : *wxBLACK; + gc->SetPen(*wxThePenList->FindOrCreatePen(colour, 1, wxPENSTYLE_SOLID)); double const mark_interval = calculate_mark_interval (rint (128 / pps)); @@ -78,7 +79,7 @@ TimelineTimeAxisView::do_paint (wxGraphicsContext* gc, list path.AddLineToPoint (_timeline.width(), y); gc->StrokePath (path); - gc->SetFont (gc->CreateFont (*wxNORMAL_FONT)); + gc->SetFont(gc->CreateFont(*wxNORMAL_FONT, colour)); /* Time in seconds */ DCPTime t; -- cgit v1.2.3