summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-03-01 22:40:57 +0100
committerCarl Hetherington <cth@carlh.net>2022-03-09 17:04:02 +0100
commit11199da66bafc54cfab92106563696d9a5e72b69 (patch)
tree211a977b3891f0d459ff34aca4a87d336677949c /src
parente839d43989c0d2a9438612ec289a4834df06f712 (diff)
Add search_ctrl_height()
Diffstat (limited to 'src')
-rw-r--r--src/wx/screens_panel.cc8
-rw-r--r--src/wx/wx_util.cc12
-rw-r--r--src/wx/wx_util.h1
3 files changed, 14 insertions, 7 deletions
diff --git a/src/wx/screens_panel.cc b/src/wx/screens_panel.cc
index 0038a30fb..c5aea4223 100644
--- a/src/wx/screens_panel.cc
+++ b/src/wx/screens_panel.cc
@@ -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);
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index 62f00b6b2..988adeecc 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -688,3 +688,15 @@ dpi_scale_factor (wxWindow*)
}
#endif
+
+
+int
+search_ctrl_height ()
+{
+#ifdef __WXGTK3__
+ return 30;
+#else
+ return -1;
+#endif
+}
+
diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h
index 30e2b739a..e9be16b4f 100644
--- a/src/wx/wx_util.h
+++ b/src/wx/wx_util.h
@@ -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