1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

[BookmarksToolbarButton] Final fix for rendering issues with various styles

It now works correctly with Windows, Gtk+, Oxygen and Fusion theme with
both Qt4 and Qt5.
The only theme that doesn't work correctly is Bespin, because it draws
icon size animation upon hover, but we are drawing the icon and text
manually. I think there is not much to do with it actually...
This commit is contained in:
nowrep 2014-03-26 10:11:30 +01:00
parent 525c4ff5cf
commit 9c7d6e9795

View File

@ -191,7 +191,6 @@ void BookmarksToolbarButton::init()
{
Q_ASSERT(m_bookmark);
setFlat(true);
setFocusPolicy(Qt::NoFocus);
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
setToolTip(createTooltip());
@ -276,17 +275,19 @@ void BookmarksToolbarButton::paintEvent(QPaintEvent* event)
Q_UNUSED(event)
QPainter p(this);
QStyleOptionButton option;
initStyleOption(&option);
// Just draw separator
if (m_bookmark->isSeparator()) {
QStyleOption opt = option;
QStyleOption opt;
opt.initFrom(this);
opt.state |= QStyle::State_Horizontal;
style()->drawPrimitive(QStyle::PE_IndicatorToolBarSeparator, &opt, &p);
return;
}
QStyleOptionButton option;
initStyleOption(&option);
// We are manually drawing the arrow
option.features &= ~QStyleOptionButton::HasMenu;