QTabBar/Windows: Fix close button icons being too small on high-res screens
Add 32x32 versions. Move the icon creation to a helper function. Fixes: QTBUG-88230 Pick-to: 6.0 Pick-to: 5.15 Change-Id: I6dda2084e0122234eacea17ac191a19f6855f466 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
dafd26acbe
commit
f3251bcb87
@ -172,8 +172,11 @@ set(qstyle_resource_files
|
||||
"images/standardbutton-close-128.png"
|
||||
"images/standardbutton-close-16.png"
|
||||
"images/standardbutton-close-32.png"
|
||||
"images/standardbutton-closetab-32.png"
|
||||
"images/standardbutton-closetab-16.png"
|
||||
"images/standardbutton-closetab-down-32.png"
|
||||
"images/standardbutton-closetab-down-16.png"
|
||||
"images/standardbutton-closetab-hover-32.png"
|
||||
"images/standardbutton-closetab-hover-16.png"
|
||||
"images/standardbutton-delete-128.png"
|
||||
"images/standardbutton-delete-16.png"
|
||||
|
BIN
src/widgets/styles/images/standardbutton-closetab-32.png
Normal file
BIN
src/widgets/styles/images/standardbutton-closetab-32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 305 B |
BIN
src/widgets/styles/images/standardbutton-closetab-down-32.png
Normal file
BIN
src/widgets/styles/images/standardbutton-closetab-down-32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 278 B |
BIN
src/widgets/styles/images/standardbutton-closetab-hover-32.png
Normal file
BIN
src/widgets/styles/images/standardbutton-closetab-hover-32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 305 B |
@ -126,6 +126,30 @@ static qreal qt_getDevicePixelRatio(const QWidget *widget)
|
||||
return widget ? widget->devicePixelRatio() : qApp->devicePixelRatio();
|
||||
}
|
||||
|
||||
static QIcon tabBarCloseButtonIcon()
|
||||
{
|
||||
QIcon result;
|
||||
result.addPixmap(QPixmap(
|
||||
QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-16.png")),
|
||||
QIcon::Normal, QIcon::Off);
|
||||
result.addPixmap(QPixmap(
|
||||
QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-32.png")),
|
||||
QIcon::Normal, QIcon::Off);
|
||||
result.addPixmap(QPixmap(
|
||||
QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-down-16.png")),
|
||||
QIcon::Normal, QIcon::On);
|
||||
result.addPixmap(QPixmap(
|
||||
QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-down-32.png")),
|
||||
QIcon::Normal, QIcon::On);
|
||||
result.addPixmap(QPixmap(
|
||||
QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-hover-16.png")),
|
||||
QIcon::Active, QIcon::Off);
|
||||
result.addPixmap(QPixmap(
|
||||
QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-hover-32.png")),
|
||||
QIcon::Active, QIcon::Off);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*!
|
||||
\class QCommonStyle
|
||||
\brief The QCommonStyle class encapsulates the common Look and Feel of a GUI.
|
||||
@ -416,17 +440,8 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
|
||||
}
|
||||
break;
|
||||
case PE_IndicatorTabClose: {
|
||||
if (d->tabBarcloseButtonIcon.isNull()) {
|
||||
d->tabBarcloseButtonIcon.addPixmap(QPixmap(
|
||||
QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-16.png")),
|
||||
QIcon::Normal, QIcon::Off);
|
||||
d->tabBarcloseButtonIcon.addPixmap(QPixmap(
|
||||
QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-down-16.png")),
|
||||
QIcon::Normal, QIcon::On);
|
||||
d->tabBarcloseButtonIcon.addPixmap(QPixmap(
|
||||
QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-hover-16.png")),
|
||||
QIcon::Active, QIcon::Off);
|
||||
}
|
||||
if (d->tabBarcloseButtonIcon.isNull())
|
||||
d->tabBarcloseButtonIcon = tabBarCloseButtonIcon();
|
||||
|
||||
const int size = proxy()->pixelMetric(QStyle::PM_SmallIconSize, opt);
|
||||
QIcon::Mode mode = opt->state & State_Enabled ?
|
||||
|
@ -104,8 +104,11 @@
|
||||
<file>images/standardbutton-yes-128.png</file>
|
||||
<file>images/standardbutton-yes-16.png</file>
|
||||
<file>images/standardbutton-yes-32.png</file>
|
||||
<file>images/standardbutton-closetab-32.png</file>
|
||||
<file>images/standardbutton-closetab-16.png</file>
|
||||
<file>images/standardbutton-closetab-down-32.png</file>
|
||||
<file>images/standardbutton-closetab-down-16.png</file>
|
||||
<file>images/standardbutton-closetab-hover-32.png</file>
|
||||
<file>images/standardbutton-closetab-hover-16.png</file>
|
||||
<file>images/refresh-24.png</file>
|
||||
<file>images/refresh-32.png</file>
|
||||
|
Loading…
Reference in New Issue
Block a user