News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Auto-comp list selection color

Started by Alpha, January 10, 2013, 12:41:38 AM

Previous topic - Next topic

oBFusCATed

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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Alpha

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