[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    qt-copy patch: fix alternate rows in Q{List,Tree}Widget
From:       Matthew Woehlke <mw_triad () users ! sourceforge ! net>
Date:       2007-09-11 0:27:46
Message-ID: fc4ne3$e3n$1 () sea ! gmane ! org
[Download RAW message or body]

I'd like to commit the following to qt-copy... any objections? (I 
already reported the bug along with a similar patch against 
qlistview.cpp only; I'll forward the updated patch including 
qtreewidget.cpp once I have somewhere to send it.)

==== patches/0189-listview-alternate-row-colors.diff ====
qt-bugs@ issue :
Trolltech task ID :
applied: no
author: Matthew Woehlke <mw_triad@users.sourceforge.net>

This patch fixes incorrect setting of the palette color group in
QListView that resulted in alternate rows being drawn with the Active
AlternateBase color even for inactive widgets (while the rest of the
widget is drawn correctly). Please let me know if QListView and
QTreeView are not the only culprits.

--- src/gui/itemviews/qtreeview.cpp
+++ src/gui/itemviews/qtreeview.cpp
@@ -1356,7 +1356,8 @@
                  opt.state &= ~QStyle::State_Enabled;
                  cg = QPalette::Disabled;
              } else {
-                cg = QPalette::Active;
+                cg = window()->isActiveWindow() ? QPalette::Active
+                                                : QPalette::Inactive;
              }
              opt.palette.setCurrentColorGroup(cg);
          }
--- src/gui/itemviews/qlistview.cpp
+++ src/gui/itemviews/qlistview.cpp
@@ -1042,7 +1042,8 @@
                  option.state &= ~QStyle::State_Enabled;
                  cg = QPalette::Disabled;
              } else {
-                cg = QPalette::Normal;
+                cg = window()->isActiveWindow() ? QPalette::Active
+                                                : QPalette::Inactive;
              }
              option.palette.setCurrentColorGroup(cg);
          }
====

-- 
Matthew
A KWin crash is like a Finite Improbability Generator... only instead of 
undergarments, all my windows move 4 pixels to the right.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic