forked from qt-creator/qt-creator
Dock widgets: Add collapse/uncollapse functionality
Add a button that can be used to collapse a dock widget's contents temporarily, as an alternative to removing and re-adding it. To achieve that, remove the inner widget of the dock widget and store it in an inner pointer. Just setting the inner widget invisible/visible does not work, because the title widget of a dock widget with invisible inner widget becomes 0 for some reason. We also need to add a dummy widget with a maximum height, to make the dock widget resize and not be resizable afterwards. Do not allow collapsing if the dock is the only one in the area, in a horizontal layout, floating, or tabbed. Change-Id: Ibc1acb59d58069f08184e65c4814642acb0028ee Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -1004,7 +1004,7 @@ void PerspectivePrivate::restoreLayout()
|
||||
if (state.mainWindowState.isEmpty()) {
|
||||
qCDebug(perspectivesLog) << "PERSPECTIVE " << m_id << "RESTORE NOT POSSIBLE, NO STORED STATE";
|
||||
} else {
|
||||
bool result = theMainWindow->restoreState(state.mainWindowState);
|
||||
bool result = theMainWindow->restoreFancyState(state.mainWindowState);
|
||||
qCDebug(perspectivesLog) << "PERSPECTIVE " << m_id << "RESTORED, SUCCESS: " << result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user