X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=inline;f=src%2Frenderwidget.h;h=61a8b74fdab2e5204f0003e8304d56f2ed44b69d;hb=4b9ba168de2f289c2a3d9ffa20520dd9a3f6fbf0;hp=31a7a23359a8a9d151b84ea376b310e1db0f63b4;hpb=3644bf4707c77542bc0900ce3c4dbbe674b08a07;p=kdenlive 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;