Improve ratings dialog to allow only valid values (#2199).
[dcpomatic.git] / src / wx / wx_util.cc
index a0beb8f72d0f4e7ac92b7be74e2b06ae52b756af..fad3779bd07ed5339ff96b7915a897ba3ae12307 100644 (file)
@@ -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.
@@ -657,7 +657,7 @@ 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;
 }
 
@@ -673,3 +673,30 @@ gui_is_dark ()
 #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
+}
+