Add search_ctrl_height()
authorCarl Hetherington <cth@carlh.net>
Tue, 1 Mar 2022 21:40:57 +0000 (22:40 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 13 Mar 2022 23:14:08 +0000 (00:14 +0100)
src/wx/screens_panel.cc
src/wx/wx_util.cc
src/wx/wx_util.h

index 0038a30fbf01945d306ec8c89c1b214463adcda6..c5aea4223e5c62f4c381d16f1f7a1df28785c468 100644 (file)
@@ -47,13 +47,7 @@ ScreensPanel::ScreensPanel (wxWindow* parent)
 {
        auto sizer = new wxBoxSizer (wxVERTICAL);
 
-#ifdef __WXGTK3__
-       int const height = 30;
-#else
-       int const height = -1;
-#endif
-
-       _search = new wxSearchCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200, height));
+       _search = new wxSearchCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200, search_ctrl_height()));
 #ifndef __WXGTK3__
        /* The cancel button seems to be strangely broken in GTK3; clicking on it twice sometimes works */
        _search->ShowCancelButton (true);
index 62e3de9cc78cb8f875b0b156370b176ba654d851..beab1151cc8f090680317a7dc666af567e51b732 100644 (file)
@@ -688,3 +688,15 @@ dpi_scale_factor (wxWindow*)
 }
 #endif
 
+
+
+int
+search_ctrl_height ()
+{
+#ifdef __WXGTK3__
+       return 30;
+#else
+       return -1;
+#endif
+}
+
index cd9a06a4fc5b2851443e0ec55f24a9ed7d49c69f..5057ad4238f83e6fdeb5eb5d8b43d6faa2161b0c 100644 (file)
@@ -121,6 +121,7 @@ extern wxString bitmap_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);
+extern int search_ctrl_height ();
 
 
 struct Offset