mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-13 10:32:11 +01:00
ComboTabBar: Fix tabPixmap with high-dpi
This commit is contained in:
parent
675bc0514f
commit
b2de2a00f4
|
@ -1075,7 +1075,7 @@ QPixmap TabBarHelper::tabPixmap(int index) const
|
||||||
if (iconButton) {
|
if (iconButton) {
|
||||||
const QPixmap pix = iconButton->grab();
|
const QPixmap pix = iconButton->grab();
|
||||||
tab.icon = pix;
|
tab.icon = pix;
|
||||||
tab.iconSize = pix.size();
|
tab.iconSize = pix.size() / pix.devicePixelRatioF();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (closeButton) {
|
if (closeButton) {
|
||||||
|
@ -1083,9 +1083,10 @@ QPixmap TabBarHelper::tabPixmap(int index) const
|
||||||
tab.text = tab.fontMetrics.elidedText(tabText(index), Qt::ElideRight, width);
|
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);
|
out.fill(Qt::transparent);
|
||||||
tab.rect = QRect(QPoint(0, 0), out.size());
|
tab.rect = QRect(QPoint(0, 0), tab.rect.size());
|
||||||
|
|
||||||
QPainter p(&out);
|
QPainter p(&out);
|
||||||
style()->drawControl(QStyle::CE_TabBarTab, &tab, &p, this);
|
style()->drawControl(QStyle::CE_TabBarTab, &tab, &p, this);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user