Author Topic: Auto-comp list selection color  (Read 24269 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Auto-comp list selection color
« Reply #15 on: February 04, 2013, 11:09:39 pm »
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!]

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Auto-comp list selection color
« Reply #16 on: February 24, 2013, 05:55:49 pm »
Okay; this is the "correct" way of disabling the focus hack under wxGTK.  (Unless, should the hack be removed completely for all systems?)
Code
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