diff options
author | megabigbug <megabigbug@arrakis.(none)> | 2010-06-09 22:03:07 +0200 |
---|---|---|
committer | megabigbug <megabigbug@arrakis.(none)> | 2010-06-09 22:03:07 +0200 |
commit | abab90ceac2b5ac98c46ea088a5af1a49221579c (patch) | |
tree | f40086e66bbf5cdb22cc85fc0078bad78b1787fb | |
parent | rekonq 0.4.95 (diff) | |
download | rekonq-abab90ceac2b5ac98c46ea088a5af1a49221579c.tar.xz |
remove setAutoFillBackground(true) => propagate ListItem content to engineBar
fill background of the ListItem with the backgroundRole color
-rw-r--r-- | src/urlbar/listitem.cpp | 16 |
1 files 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); } |