1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

ComboTabBar: Fix tabPixmap with high-dpi

This commit is contained in:
David Rosca 2018-01-09 15:18:31 +01:00
parent 675bc0514f
commit b2de2a00f4

View File

@ -1075,7 +1075,7 @@ QPixmap TabBarHelper::tabPixmap(int index) const
if (iconButton) {
const QPixmap pix = iconButton->grab();
tab.icon = pix;
tab.iconSize = pix.size();
tab.iconSize = pix.size() / pix.devicePixelRatioF();
}
if (closeButton) {
@ -1083,9 +1083,10 @@ QPixmap TabBarHelper::tabPixmap(int index) const
tab.text = tab.fontMetrics.elidedText(tabText(index), Qt::ElideRight, width);
}
QPixmap out(tab.rect.size());
QPixmap out(tab.rect.size() * devicePixelRatioF());
out.setDevicePixelRatio(devicePixelRatioF());
out.fill(Qt::transparent);
tab.rect = QRect(QPoint(0, 0), out.size());
tab.rect = QRect(QPoint(0, 0), tab.rect.size());
QPainter p(&out);
style()->drawControl(QStyle::CE_TabBarTab, &tab, &p, this);