1
0
mirror of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git synced 2025-04-01 02:42:39 +08:00

CloseButton: Retain size when hidden.

This commit is contained in:
Nick D'Ademo 2019-09-07 20:17:31 +08:00
parent a2b07fd97f
commit cd412898fb

View File

@ -152,7 +152,10 @@ void DockWidgetTabPrivate::createLayout()
CloseIcon.addPixmap(internal::createTransparentPixmap(normalPixmap, 0.25), QIcon::Disabled);
CloseButton->setIcon(CloseIcon);
CloseButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
CloseButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QSizePolicy spRetain = CloseButton->sizePolicy();
spRetain.setRetainSizeWhenHidden(true);
CloseButton->setSizePolicy(spRetain);
CloseButton->setVisible(false);
#ifndef QT_NO_TOOLTIP
CloseButton->setToolTip(QObject::tr("Close Tab"));