From abab90ceac2b5ac98c46ea088a5af1a49221579c Mon Sep 17 00:00:00 2001 From: megabigbug Date: Wed, 9 Jun 2010 22:03:07 +0200 Subject: remove setAutoFillBackground(true) => propagate ListItem content to engineBar fill background of the ListItem with the backgroundRole color --- src/urlbar/listitem.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp index c0d163c9..97cd5cd8 100644 --- a/src/urlbar/listitem.cpp +++ b/src/urlbar/listitem.cpp @@ -59,11 +59,9 @@ ListItem::ListItem(const UrlSearchItem &item, QWidget *parent) : QWidget(parent) , m_option() , m_url(item.url) -{ - setAutoFillBackground(true); - +{ m_option.initFrom(this); - m_option.direction = Qt::LeftToRight; + m_option.direction = Qt::LeftToRight; // use the same application palette (hence, the same colors) // Qt docs says that using this cctor is possible & fast (qt:qpalette) @@ -97,16 +95,18 @@ void ListItem::deactivate() void ListItem::paintEvent(QPaintEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event); + + QWidget::paintEvent(event); + QPainter painter(this); + m_option.rect = QRect(QPoint(), size()); + painter.fillRect(m_option.rect, palette().brush(backgroundRole())); if (m_option.state.testFlag(QStyle::State_Selected) || m_option.state.testFlag(QStyle::State_MouseOver)) { - QPainter painter(this); - m_option.rect = QRect(QPoint(), size()); style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &m_option, &painter, this); } - QWidget::paintEvent(event); } -- cgit v1.2.1