Others have mentioned, and it has also bothered me, that the selection highlight for the auto completion list makes it nearly impossible to read under Ubuntu's default color scheme. After some searching, I found:
sdk/wxscintilla/src/PlatWX.cpp line 948
// NOTE: We need to fool the wxListView into thinking that it has the
// focus so it will use the normal selection colour and will look
// "right" to the user. But since the wxPopupWindow or its children
// can't receive focus then we have to pull a fast one and temporarily
// parent the listctrl on the STC window and then call SetFocus and
// then reparent it back to the popup.
lv->SetFocus();
lv->Reparent(this);
Apparently, wxGTK (I presume) has remained relatively "un-tricked" by this. Any ideas on a solution?
From the four colors:
- highlight-background-focused (orange)
- highlighted-text-focused (white)
- highlight-background-no_focus (light gray)
- highlighted-text-no_focus (black)
The auto-comp box currently uses highlight-background-no_focus (light gray) and highlighted-text-focused (white), which is why it is completely unreadable. If we make no attempt to give the box the "focused" color set, it becomes readable:
Index: src/sdk/wxscintilla/src/PlatWX.cpp
===================================================================
--- src/sdk/wxscintilla/src/PlatWX.cpp (revision 8782)
+++ src/sdk/wxscintilla/src/PlatWX.cpp (working copy)
@@ -951,7 +951,7 @@
// can't receive focus then we have to pull a fast one and temporarily
// parent the listctrl on the STC window and then call SetFocus and
// then reparent it back to the popup.
- lv->SetFocus();
+ //lv->SetFocus();
lv->Reparent(this);
#ifdef __WXMSW__
lv->Show();
This, of course, is not the desired appearance, but I guess it implies that highlight-background-* and highlighted-text-* are set differently, and (possibly) other themes work because mismatched sets of these are still readable in those themes.
I do not currently have wx29 on Linux, and have not tested it yet.
How much time do others want for testing? When testing is complete, this is the patch I recommend:
Index: src/sdk/wxscintilla/src/PlatWX.cpp
===================================================================
--- src/sdk/wxscintilla/src/PlatWX.cpp (revision 8787)
+++ src/sdk/wxscintilla/src/PlatWX.cpp (working copy)
@@ -951,7 +951,13 @@
// can't receive focus then we have to pull a fast one and temporarily
// parent the listctrl on the STC window and then call SetFocus and
// then reparent it back to the popup.
+/* C::B begin */
+ // this focus hack makes the selection unreadable for Ubuntu themes,
+ // so do not attempt under GTK
+#ifndef __WXGTK__
lv->SetFocus();
+#endif
+/* C::B end */
lv->Reparent(this);
#ifdef __WXMSW__
lv->Show();
Okay; this is the "correct" way of disabling the focus hack under wxGTK. (Unless, should the hack be removed completely for all systems?)
Index: src/sdk/wxscintilla/src/PlatWX.cpp
===================================================================
--- src/sdk/wxscintilla/src/PlatWX.cpp (revision 8854)
+++ src/sdk/wxscintilla/src/PlatWX.cpp (working copy)
@@ -938,13 +938,21 @@
/* C::B end */
/* C::B begin */
+#ifdef __WXGTK__
+ lv = new wxSCIListBox(this, id, wxDefaultPosition, wxDefaultSize,
+#else
lv = new wxSCIListBox(parent, id, wxDefaultPosition, wxDefaultSize,
+#endif
wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER | wxSIMPLE_BORDER);
/* C::B end */
lv->SetCursor(wxCursor(wxCURSOR_ARROW));
lv->InsertColumn(0, wxEmptyString);
lv->InsertColumn(1, wxEmptyString);
+/* C::B begin */
+ // this focus hack makes the selection unreadable for Ubuntu themes,
+ // so do not attempt under GTK
+#ifndef __WXGTK__
// NOTE: We need to fool the wxListView into thinking that it has the
// focus so it will use the normal selection colour and will look
// "right" to the user. But since the wxPopupWindow or its children
@@ -953,6 +961,8 @@
// then reparent it back to the popup.
lv->SetFocus();
lv->Reparent(this);
+#endif
+/* C::B end */
#ifdef __WXMSW__
lv->Show();
#endif