Add a border round EditableLists on GTK3, otherwise they are hard to see.
authorCarl Hetherington <cth@carlh.net>
Mon, 8 Jun 2020 18:24:16 +0000 (20:24 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 8 Jun 2020 18:24:16 +0000 (20:24 +0200)
src/wx/editable_list.h

index 3ee4359bf8022cfb10c55373745f92bde92836f5..ca58009a4b7059027700b9fde7181380742f26a1 100644 (file)
@@ -87,7 +87,18 @@ public:
                        total_width += i.width.get_value_or (_default_width);
                }
 
+#ifdef __WXGTK3__
+               /* With the GTK3 backend wxListCtrls are hard to pick out from the background of the
+                * window, so put a border in to help.
+                */
+               wxPanel* border = new wxPanel (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_THEME);
+               _list = new wxListCtrl (border, wxID_ANY, wxDefaultPosition, wxSize(total_width, 100), style);
+               wxBoxSizer* border_sizer = new wxBoxSizer (wxHORIZONTAL);
+               border_sizer->Add (_list, 1, wxALL | wxEXPAND, 2);
+               border->SetSizer (border_sizer);
+#else
                _list = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxSize(total_width, 100), style);
+#endif
 
                int j = 0;
                BOOST_FOREACH (EditableListColumn i, _columns) {
@@ -98,7 +109,11 @@ public:
                        ++j;
                }
 
+#ifdef __WXGTK3__
+               _sizer->Add (border, 1, wxEXPAND);
+#else
                _sizer->Add (_list, 1, wxEXPAND);
+#endif
 
                {
                        wxSizer* s = new wxBoxSizer (wxVERTICAL);