diff options
author | Henning Gruendl <[email protected]> | 2020-06-22 16:46:25 +0200 |
---|---|---|
committer | Henning Gründl <[email protected]> | 2020-06-24 07:56:37 +0000 |
commit | a98c254c594e3e25e05b5d4392fe7bc79b05cea8 (patch) | |
tree | d0141c696a7f8a9f89667b8e2b18de4d8d0fa464 /src/libs/advanceddockingsystem/dockmanager.h | |
parent | e5d9cb377990180dc75b1ec3b209c742e1c01522 (diff) |
ADS: Integrate newest base repository commits
* Activate new ADS feature focus highlight
* Remove resources.qrc and related *.svg files
* Clean up new and existing source
Base repository was merged until commit
3de877fe5635ff51a6d1205ca98aad85d204427f
Merged changes from base repository include the following:
* Fix wrong current index when removing a widget from DockAreaLayout
* Fix invisible TabWidget for DockWidgets that are not part of a
restored state
* Enable ClickFocus for DockWidget to support focussing in case the
content does not support it
* Move focus related functionality into DockFocusController class
* Add new DockManger config flag FocusStyling
* Add support for focus styling of FloatingWidgetTitleBar
* Improve focus handling when dropping a DockWidget
* Improve highlighting focused DockWidget
* Improve setting of DockWidgetTab focus
* Add styling of focused DockWidget
* Fix docking of floating widgets for macOS
* Fix setting of DockingStateReader file version - use internal file
version instead of user file version
* Fix saveState() and restoreState() version handling to work like the
function from QMainWindow
* Fix escape key handling in native window event function if event
WM_EXITSIZEMOVE occurs
* Implement windows drag handling with native WM_ nonclient area
messages
* Fix showing DockArea when inserting a DockWidget in a hidden DockArea
* Fix setting DockAreaTabBar index to prevent showing of tab 0 when
inserting a DockWidget into an area with no current index tab
* Fix wrong insertion order of DockWidget when dropping a floating
widget to the left or top container drop area
* Fix tab changes position when redocking it to the same position
* Add nullptr check to fix potential nullptr access when closing a
FloatingDockContainer
* Fix single DockArea cannot be split
* Fix visibility issue when adding dock widget after all other dock
widgets have ben closed
* Fix FloatingDragPreview flashing of hidden overlay when dragging the
last visible DockWidget in non opaque docking mode
* Fix FloatingDragPreview preventing dock widget from floating when
dragging over another dock widget
* Fix DockWidget::setWidget function to test for QAbstractScrollArea
instead of QScrollArea. Now setWidget properly supports ItemViews like
QTreeView or QTableView
* Fix wrong display of center drop area when dragging over invisible
dock area title bar
* Fix bug that drop overlay sometimes was not visible when moving the
drag preview over a floating window
* Fix dropping of FloatingDragPreview into center of dock container with
only one single visible dock area. If this happens the dropped dock
widget needs to get tabified
* Fix crash when trying to make a DockWidget floating in non-opaque mode
if the DockWidget is not floatable
* Fix DockWidgetTab to provide the right size when starting floating
* Add DockWidget functions setAsCurrentTab, raise, isCurrentTab,
isTabbed
* Add new config flag HideSingleCentralWidgetTitleBar to enable a
central single dock widget in the main dock container (dock manager)
without titlebar
* Fix DockContainerWidget::hasTopLevelDockWidget() and
DockContainerWidget::topLevelDockArea() to work properly also for the
main non floating dock container
* Fix ElidingLabel to properly support Qt::ElideNone
* Add setElideMode function to DockWidgetTab
* Add setFullScreen(), setNormal() and isFullScreen() function to
DockWidget
* Fix takeWidget() function and fixed setWidget() function to handle
case when there is already a content widget
Task-number: QDS-2180
Change-Id: Ie30648ba329016c91fd19e9b4e12e31e47614b18
Reviewed-by: Thomas Hartmann <[email protected]>
Diffstat (limited to 'src/libs/advanceddockingsystem/dockmanager.h')
-rw-r--r-- | src/libs/advanceddockingsystem/dockmanager.h | 75 |
1 files changed, 70 insertions, 5 deletions
diff --git a/src/libs/advanceddockingsystem/dockmanager.h b/src/libs/advanceddockingsystem/dockmanager.h index 4cda0948a79..43ba751e48b 100644 --- a/src/libs/advanceddockingsystem/dockmanager.h +++ b/src/libs/advanceddockingsystem/dockmanager.h @@ -143,6 +143,32 @@ protected: DockOverlay *dockAreaOverlay() const; /** + * A container needs to call this function if a widget has been dropped + * into it + */ + void notifyWidgetOrAreaRelocation(QWidget *droppedWidget); + + /** + * This function is called, if a floating widget has been dropped into + * an new position. + * When this function is called, all dock widgets of the FloatingWidget + * are already inserted into its new position + */ + void notifyFloatingWidgetDrop(FloatingDockContainer *floatingWidget); + + /** + * This function is called, if the given DockWidget has been relocated from + * the old container ContainerOld to the new container DockWidget->dockContainer() + */ + void notifyDockWidgetRelocation(DockWidget *dockWidget, DockContainerWidget *containerOld); + + /** + * This function is called, if the given DockAreahas been relocated from + * the old container ContainerOld to the new container DockArea->dockContainer() + */ + void notifyDockAreaRelocation(DockAreaWidget *dockArea, DockContainerWidget *containerOld); + + /** * Show the floating widgets that has been created floating */ void showEvent(QShowEvent *event) override; @@ -190,11 +216,18 @@ public: DockAreaHideDisabledButtons = 0x10000, //!< If the flag is set disabled dock area buttons will not appear on the tollbar at all (enabling them will bring them back) DockAreaDynamicTabsMenuButtonVisibility - = 0x20000, //!< If the flag is set dock area will disable a tabs menu button when there is only one tab in the area + = 0x20000, //!< If the flag is set, the tabs menu button will be shown only when it is required - that means, if the tabs are elided. If the tabs are not elided, it is hidden FloatingContainerHasWidgetTitle - = 0x40000, + = 0x40000, //!< If set, the Floating Widget window title reflects the title of the current dock widget otherwise it displays application name as window title FloatingContainerHasWidgetIcon - = 0x80000, + = 0x80000, //!< If set, the Floating Widget icon reflects the icon of the current dock widget otherwise it displays application icon + HideSingleCentralWidgetTitleBar + = 0x100000, //!< If there is only one single visible dock widget in the main dock container (the dock manager) and if this flag is set, then the titlebar of this dock widget will be hidden + //!< this only makes sense for non draggable and non floatable widgets and enables the creation of some kind of "central" widget + FocusHighlighting + = 0x200000, //!< enables styling of focused dock widget tabs or floating widget titlebar + EqualSplitOnInsertion + = 0x400000, ///!< if enabled, the space is equally distributed to all widgets in a splitter DefaultDockAreaButtons = DockAreaHasCloseButton | DockAreaHasUndockButton @@ -268,6 +301,19 @@ public: static int startDragDistance(); /** + * Helper function to set focus depending on the configuration of the + * FocusStyling flag + */ + template <class QWidgetPtr> + static void setWidgetFocus(QWidgetPtr widget) + { + if (!DockManager::testConfigFlag(DockManager::FocusHighlighting)) + return; + + widget->setFocus(Qt::OtherFocusReason); + } + + /** * Set the QtCreator settings. */ void setSettings(QSettings *settings); @@ -358,8 +404,12 @@ public: * If auto formatting is enabled, the output is intended and line wrapped. * The XmlMode XmlAutoFormattingDisabled is better if you would like to have * a more compact XML output - i.e. for storage in ini files. + * The version number is stored as part of the data. + * To restore the saved state, pass the return value and version number + * to restoreState(). + * \see restoreState() */ - QByteArray saveState(int version = Version1) const; + QByteArray saveState(int version = 0) const; /** * Restores the state of this dockmanagers dockwidgets. @@ -367,8 +417,9 @@ public: * not match, the dockmanager's state is left unchanged, and this function * returns false; otherwise, the state is restored, and this function * returns true. + * \see saveState() */ - bool restoreState(const QByteArray &state, int version = Version1); + bool restoreState(const QByteArray &state, int version = 0); /** * This function returns true between the restoringState() and @@ -376,6 +427,13 @@ public: */ bool isRestoringState() const; + /** + * Request a focus change to the given dock widget. + * This function only has an effect, if the flag CDockManager::FocusStyling + * is enabled + */ + void setDockWidgetFocused(DockWidget *dockWidget); + signals: /** * This signal is emitted if the list of workspaces changed. @@ -444,6 +502,13 @@ signals: */ void dockWidgetRemoved(DockWidget *dockWidget); + /** + * This signal is emitted if the focused dock widget changed. + * Both old and now can be nullptr. + * The focused dock widget is the one that is highlighted in the GUI + */ + void focusedDockWidgetChanged(DockWidget *old, DockWidget *now); + public: void showWorkspaceMananger(); |