1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 09:42:10 +02:00

RTL: Fixed order of bookmark toolbar icons.

- Closes #1923
This commit is contained in:
srazi 2016-05-11 16:12:56 +04:30 committed by David Rosca
parent b788df0097
commit 2fd838184c

View File

@ -331,7 +331,7 @@ void BookmarksToolbarButton::paintEvent(QPaintEvent* event)
// Draw icon
if (!m_showOnlyText) {
QRect iconRect(leftPosition, iconYPos, iconSize, iconSize);
p.drawPixmap(iconRect, m_bookmark->icon().pixmap(iconSize));
p.drawPixmap(QStyle::visualRect(option.direction, option.rect, iconRect), m_bookmark->icon().pixmap(iconSize));
leftPosition = iconRect.right() + PADDING;
}
@ -340,10 +340,11 @@ void BookmarksToolbarButton::paintEvent(QPaintEvent* event)
const int arrowSize = 8;
QStyleOption opt;
opt.initFrom(this);
opt.rect = QRect(rightPosition - 8, center - arrowSize / 2, arrowSize, arrowSize);
const QRect rect = QRect(rightPosition - 8, center - arrowSize / 2, arrowSize, arrowSize);
opt.rect = QStyle::visualRect(option.direction, option.rect, rect);
opt.state &= ~QStyle::State_MouseOver;
style()->drawPrimitive(QStyle::PE_IndicatorArrowDown, &opt, &p, this);
rightPosition = opt.rect.left() - PADDING;
rightPosition = rect.left() - PADDING;
}
// Draw text
@ -352,6 +353,7 @@ void BookmarksToolbarButton::paintEvent(QPaintEvent* event)
const int textYPos = center - fontMetrics().height() / 2;
const QString txt = fontMetrics().elidedText(m_bookmark->title(), Qt::ElideRight, textWidth);
QRect textRect(leftPosition, textYPos, textWidth, fontMetrics().height());
style()->drawItemText(&p, textRect, Qt::TextSingleLine | Qt::AlignCenter, option.palette, true, txt);
style()->drawItemText(&p, QStyle::visualRect(option.direction, option.rect, textRect),
Qt::TextSingleLine | Qt::AlignCenter, option.palette, true, txt);
}
}