@@ -116,7 +116,13 @@ void DockAreaTitleBarPrivate::createButtons()
116
116
TabsMenuButton->setObjectName (" tabsMenuButton" );
117
117
TabsMenuButton->setAutoRaise (true );
118
118
TabsMenuButton->setPopupMode (QToolButton::InstantPopup);
119
- TabsMenuButton->setIcon (_this->style ()->standardIcon (QStyle::SP_TitleBarUnshadeButton));
119
+
120
+ QIcon MenuIcon;
121
+ QPixmap normalPixmap = _this->style ()->standardPixmap (
122
+ QStyle::SP_TitleBarUnshadeButton, 0 , TabsMenuButton);
123
+ MenuIcon.addPixmap (internal::createTransparentPixmap (normalPixmap, 0.25 ), QIcon::Disabled);
124
+ MenuIcon.addPixmap (normalPixmap, QIcon::Normal);
125
+ TabsMenuButton->setIcon (MenuIcon);
120
126
121
127
QMenu* TabsMenu = new QMenu (TabsMenuButton);
122
128
#ifndef QT_NO_TOOLTIP
@@ -139,7 +145,11 @@ void DockAreaTitleBarPrivate::createButtons()
139
145
#ifndef QT_NO_TOOLTIP
140
146
UndockButton->setToolTip (QObject::tr (" Detach Group" ));
141
147
#endif
142
- UndockButton->setIcon (_this->style ()->standardIcon (QStyle::SP_TitleBarNormalButton));
148
+ QIcon UndockIcon;
149
+ normalPixmap = _this->style ()->standardPixmap (QStyle::SP_TitleBarNormalButton, 0 , UndockButton);
150
+ UndockIcon.addPixmap (internal::createTransparentPixmap (normalPixmap, 0.25 ), QIcon::Disabled);
151
+ UndockIcon.addPixmap (normalPixmap, QIcon::Normal);
152
+ UndockButton->setIcon (UndockIcon);
143
153
UndockButton->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Expanding);
144
154
TopLayout->addWidget (UndockButton, 0 );
145
155
_this->connect (UndockButton, SIGNAL (clicked ()), SLOT (onUndockButtonClicked ()));
@@ -148,11 +158,11 @@ void DockAreaTitleBarPrivate::createButtons()
148
158
CloseButton->setObjectName (" closeButton" );
149
159
CloseButton->setAutoRaise (true );
150
160
151
- // The standard icons do not look good on high DPI screens
152
- QIcon CloseIcon = _this->style ()->standardIcon (QStyle::SP_TitleBarCloseButton);
153
- QPixmap normalPixmap = _this->style ()->standardPixmap (QStyle::SP_TitleBarCloseButton, 0 , CloseButton);
154
- QPixmap disabledPixmap = internal::createTransparentPixmap (normalPixmap, 0.25 );
155
- CloseIcon.addPixmap (disabledPixmap , QIcon::Disabled );
161
+ // The standard icons does not look good on high DPI screens
162
+ QIcon CloseIcon; // = _this->style()->standardIcon(QStyle::SP_TitleBarCloseButton);
163
+ normalPixmap = _this->style ()->standardPixmap (QStyle::SP_TitleBarCloseButton, 0 , CloseButton);
164
+ CloseIcon. addPixmap ( internal::createTransparentPixmap (normalPixmap, 0.25 ), QIcon::Disabled );
165
+ CloseIcon.addPixmap (normalPixmap , QIcon::Normal );
156
166
157
167
CloseButton->setIcon (CloseIcon);
158
168
#ifndef QT_NO_TOOLTIP
@@ -166,6 +176,7 @@ void DockAreaTitleBarPrivate::createButtons()
166
176
}
167
177
#endif
168
178
CloseButton->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Expanding);
179
+ CloseButton->setIconSize (QSize (16 , 16 ));
169
180
TopLayout->addWidget (CloseButton, 0 );
170
181
_this->connect (CloseButton, SIGNAL (clicked ()), SLOT (onCloseButtonClicked ()));
171
182
}
0 commit comments