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?
Also, screenshot from bug 18779 (http://developer.berlios.de/bugs/?func=detailbug&bug_id=18779&group_id=5358) to demonstrate problem.
(http://hdastwb.heliohost.org/CCColors.png)
We have the same issue for the listcontrols in the logger, which are also derived from wxListCtrl (like wxListview the base class of wxSCIListBox).
On my system (fedora 17) it works fine with all themes except the two ubuntu themes (radiance and ambiance).
It seems to be either a wxGTK-isssue or a theme-error.
Quote from: jens on January 11, 2013, 07:20:32 AM
It seems to be either a wxGTK-isssue or a theme-error.
Can you try with wx29? This would maybe show that its a wxGTX 28 error... there has much work been done by the "wxTeam" to support GTK better in wx29 to my knowledge...
Quote from: MortenMacFly on January 11, 2013, 03:59:49 PM
Quote from: jens on January 11, 2013, 07:20:32 AM
It seems to be either a wxGTK-isssue or a theme-error.
Can you try with wx29? This would maybe show that its a wxGTX 28 error... there has much work been done by the "wxTeam" to support GTK better in wx29 to my knowledge...
I will test this evening (no real OS available at the moment ;) ), I have to work on moving all our XP stuff to win8.
Quote from: jens on January 11, 2013, 04:15:40 PM
I have to work on moving all our XP stuff to win8.
Oh dear - sounds like no fun. On my private PC I upgraded to Win8 but after a while I re-installed the Win7 backup. What annoys me most on Win8 is that you can't have Windows next or each other anymore. It should be named "Window" and not "Window
s" any longer... I read that somewhere in an article when searching for a solution and think this is funny, but true.
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.
Quote from: Alpha on January 11, 2013, 10:00:58 PM
If we make no attempt to give the box the "focused" color set, it becomes readable:
Well but is it working then, does it auto-complete if I press the shortcut? Otherwise thats not an option I'm afraid.
Quote from: MortenMacFly on January 11, 2013, 03:59:49 PM
Quote from: jens on January 11, 2013, 07:20:32 AM
It seems to be either a wxGTK-isssue or a theme-error.
Can you try with wx29? This would maybe show that its a wxGTX 28 error... there has much work been done by the "wxTeam" to support GTK better in wx29 to my knowledge...
It's the same with wx2.9.
Quote from: MortenMacFly on January 12, 2013, 12:45:58 PM
Quote from: Alpha on January 11, 2013, 10:00:58 PM
If we make no attempt to give the box the "focused" color set, it becomes readable:
Well but is it working then, does it auto-complete if I press the shortcut? Otherwise thats not an option I'm afraid.
Yes (at least on my testing on Linux). From what I understand of the auto-comp box is that it never actually has focus; commands are intercepted by the parent stc, and act from there.
Quote from: Alpha on January 12, 2013, 03:05:26 PM
Yes (at least on my testing on Linux). From what I understand of the auto-comp box is that it never actually has focus; commands are intercepted by the parent stc, and act from there.
OK - so lets have some testing with other Linux people and maybe other Linux distros. (I'm not using Linux if I can avoid it.)
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();
Alpha:
Have you tried to contact wx's developers?
I guess they might help in solving this or you can help them fix a bug in wxstc.
Quote from: oBFusCATed on January 14, 2013, 10:55:50 PM
Have you tried to contact wx's developers?
I guess they might help in solving this or you can help them fix a bug in wxstc.
Reported now (http://trac.wxwidgets.org/ticket/14977).
I have not received much response from the wxWidgets developers. Is there any reason this patch should not be committed in the interim?
They've told you that your patch is not correct, but don't know how to make it better.
Jens: Have you tried it? I have not, but also I'm not using Ubuntu.
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