X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fwx_util.cc;h=9974f61c983900e997e673da953afbe2bc1f60fe;hb=3c29aa6531a4046a8db72dcac81189eb8893233c;hp=1a34e5fa808bc992d1bd14bb55368848f0080862;hpb=39fb8198febde1937019db1c300ec363aab5aa56;p=dcpomatic.git diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 1a34e5fa8..9974f61c9 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -34,15 +34,15 @@ #include "lib/job_manager.h" #include "lib/util.h" #include "lib/version.h" -#include "lib/warnings.h" #include -DCPOMATIC_DISABLE_WARNINGS +#include +LIBDCP_DISABLE_WARNINGS #include #include #include #include #include -DCPOMATIC_ENABLE_WARNINGS +LIBDCP_ENABLE_WARNINGS #include @@ -86,7 +86,7 @@ setup_osx_flags (wxSizer* s, bool left, int& flags) #endif -/** Add a wxStaticText to a wxSizer, aligning it at vertical centre. +/** Add a wxStaticText to a wxSizer. * @param s Sizer to add to. * @param p Parent window for the wxStaticText. * @param t Text for the wxStaticText. @@ -297,7 +297,7 @@ checked_set (wxChoice* widget, string value) void -checked_set (wxChoice* widget, vector > items) +checked_set (wxChoice* widget, vector> items) { vector> current; for (unsigned int i = 0; i < widget->GetCount(); ++i) { @@ -657,7 +657,46 @@ small_button_size (wxWindow* parent, wxString text) wxClientDC dc (parent); auto size = dc.GetTextExtent (text); size.SetHeight (-1); - size.IncBy (24, 0); + size.IncBy (32, 0); 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 +} + + +#if wxCHECK_VERSION(3,1,0) +double +dpi_scale_factor (wxWindow* window) +{ + return window->GetDPIScaleFactor(); +} +#else +double +dpi_scale_factor (wxWindow*) +{ + return 1; +} +#endif + + + +int +search_ctrl_height () +{ +#ifdef __WXGTK3__ + return 30; +#else + return -1; +#endif +} +