From 987e6e9ab4aebd37c71a54b60bf5ed651707479c Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 8 Jun 2020 20:24:16 +0200 Subject: [PATCH] Add a border round EditableLists on GTK3, otherwise they are hard to see. --- src/wx/editable_list.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/wx/editable_list.h b/src/wx/editable_list.h index 3ee4359bf..ca58009a4 100644 --- a/src/wx/editable_list.h +++ b/src/wx/editable_list.h @@ -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); -- 2.30.2