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

Merge pull request #5 from duerr-ndt/retain_tab_bar_close_button_size_on_hide

CloseButton: Retain size when hidden.
This commit is contained in:
Nick D'Ademo 2019-09-07 20:18:34 +08:00 committed by GitHub
commit a4d06923f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,7 +153,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"));