]> git.sesse.net Git - kdenlive/commitdiff
cleanup
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 31 Jan 2009 22:26:17 +0000 (22:26 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 31 Jan 2009 22:26:17 +0000 (22:26 +0000)
svn path=/branches/KDE4/; revision=3018

src/renderwidget.h

index 31a7a23359a8a9d151b84ea376b310e1db0f63b4..61a8b74fdab2e5204f0003e8304d56f2ed44b69d 100644 (file)
@@ -41,14 +41,11 @@ public:
             QItemDelegate::paint(painter, option, index);
             return;
         } else if (index.column() == 1) {
-            const bool hover = option.state & (QStyle::State_Selected);
             QRect r1 = option.rect;
             painter->save();
-            if (hover) {
+            if (option.state & (QStyle::State_Selected)) {
                 painter->setPen(option.palette.color(QPalette::HighlightedText));
-                QColor backgroundColor = option.palette.color(QPalette::Highlight);
-                painter->setBrush(QBrush(backgroundColor));
-                painter->fillRect(r1, QBrush(backgroundColor));
+                painter->fillRect(r1, option.palette.highlight());
             } else painter->setPen(option.palette.color(QPalette::Text));
             QFont font = painter->font();
             font.setBold(true);
@@ -71,12 +68,9 @@ public:
         progressBarOption.state = option.state;
         progressBarOption.direction = QApplication::layoutDirection();
         QRect rect = option.rect;
-        const bool hover = option.state & (QStyle::State_Selected);
-        if (hover) {
+        if (option.state & (QStyle::State_Selected)) {
             painter->setPen(option.palette.color(QPalette::HighlightedText));
-            QColor backgroundColor = option.palette.color(QPalette::Highlight);
-            painter->setBrush(QBrush(backgroundColor));
-            painter->fillRect(rect, QBrush(backgroundColor));
+            painter->fillRect(rect, option.palette.highlight());
         }
 
         int mid = rect.height() / 2;