Extract gui_is_dark() to wx_util.
authorCarl Hetherington <cth@carlh.net>
Sat, 22 May 2021 21:33:40 +0000 (23:33 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 25 Jun 2021 19:58:38 +0000 (21:58 +0200)
src/wx/simple_video_view.cc
src/wx/wx_util.cc
src/wx/wx_util.h

index 0df4d6d22e6143257d198a6761715c087649881b..1740e0ffd2b9e98f61523eeb1b3e118a19e7423e 100644 (file)
@@ -75,14 +75,7 @@ SimpleVideoView::paint ()
                dc.DrawBitmap (frame_bitmap, 0, max(0, (panel_size.GetHeight() - out_size.height) / 2));
        }
 
-#if defined(DCPOMATIC_OSX) && wxCHECK_VERSION(3, 1, 0)
-       auto appearance = wxSystemSettings::GetAppearance();
-       auto dark = appearance.IsDark();
-#else
-       auto dark = false;
-#endif
-
-       auto const pad_colour = (_viewer->pad_black() || dark) ? wxColour(0, 0, 0) : wxColour(240, 240, 240);
+       auto const pad_colour = (_viewer->pad_black() || gui_is_dark()) ? wxColour(0, 0, 0) : wxColour(240, 240, 240);
 
        if (out_size.width < panel_size.GetWidth()) {
                wxPen   p (pad_colour);
index 1a34e5fa808bc992d1bd14bb55368848f0080862..a0beb8f72d0f4e7ac92b7be74e2b06ae52b756af 100644 (file)
@@ -661,3 +661,15 @@ small_button_size (wxWindow* parent, wxString text)
        return size;
 }
 
+
+bool
+gui_is_dark ()
+{
+#if defined(DCPOMATIC_OSX) && wxCHECK_VERSION(3, 1, 0)
+       auto appearance = wxSystemSettings::GetAppearance();
+       return appearance.IsDark();
+#else
+       return false;
+#endif
+}
+
index aa3dc60dba7bf5aafe12d8b460d5c7b911464316..585a30611ec82f462ac0f129ce8c32f668a06956 100644 (file)
@@ -119,6 +119,7 @@ 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 wxSize small_button_size (wxWindow* parent, wxString text);
+extern bool gui_is_dark ();
 
 
 struct Offset