From 4b9ba168de2f289c2a3d9ffa20520dd9a3f6fbf0 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Sat, 31 Jan 2009 22:26:17 +0000 Subject: [PATCH] cleanup svn path=/branches/KDE4/; revision=3018 --- src/renderwidget.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/renderwidget.h b/src/renderwidget.h index 31a7a233..61a8b74f 100644 --- a/src/renderwidget.h +++ b/src/renderwidget.h @@ -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; -- 2.39.2