diff --git a/doc/user-guide.md b/doc/user-guide.md index e000a55..bc23be1 100644 --- a/doc/user-guide.md +++ b/doc/user-guide.md @@ -23,6 +23,8 @@ - [`FloatingContainerHasWidgetTitle`](#floatingcontainerhaswidgettitle) - [`FloatingContainerHasWidgetIcon`](#floatingcontainerhaswidgeticon) - [`HideSingleCentralWidgetTitleBar`](#hidesinglecentralwidgettitlebar) +- [Styling](#styling) + - [Disabling the Internal Style Sheet](#disabling-the-internal-style-sheet) ## Configuration Flags @@ -297,3 +299,19 @@ still has a titlebar to drag it out of the main window. ![HideSingleCentralWidgetTitleBar false](cfg_flag_HideSingleCentralWidgetTitleBar_false.png) +## Styling + +The Advanced Docking System supports styling via [Qt Style Sheets](https://doc.qt.io/qt-5/stylesheet.html). All components like splitters, tabs, buttons, titlebar and +icons are styleable this way. + +### Disabling the Internal Style Sheet + +The dock manager uses an internal stylesheet to style its components. That +means, the style that you see in the demo application comes from the +internal stylesheets that you will find in `src/stylesheets` folder. If you want +to disable this internal stylesheet because your application uses its own, +just call the function for settings the stylesheet with an empty string. + +```c++ +DockManager->setStyleSheet(""); +``` diff --git a/src/DockAreaTitleBar.h b/src/DockAreaTitleBar.h index 426e07a..279f779 100644 --- a/src/DockAreaTitleBar.h +++ b/src/DockAreaTitleBar.h @@ -86,7 +86,7 @@ protected: /** * Show context menu */ - virtual void contextMenuEvent(QContextMenuEvent *event); + virtual void contextMenuEvent(QContextMenuEvent *event) override; public slots: /** diff --git a/src/DockContainerWidget.cpp b/src/DockContainerWidget.cpp index fee062b..14a3cb4 100644 --- a/src/DockContainerWidget.cpp +++ b/src/DockContainerWidget.cpp @@ -415,9 +415,10 @@ void DockContainerWidgetPrivate::dropIntoContainer(CFloatingDockContainer* Float } else if (FloatingSplitter->orientation() == InsertParam.orientation()) { + int InsertIndex = InsertParam.append() ? Splitter->count() : 0; while (FloatingSplitter->count()) { - insertWidgetIntoSplitter(Splitter, FloatingSplitter->widget(0), InsertParam.append()); + Splitter->insertWidget(InsertIndex++, FloatingSplitter->widget(0)); } } else @@ -575,6 +576,11 @@ void DockContainerWidgetPrivate::moveIntoCenterOfSection(QWidget* Widget, CDockA if (DroppedDockWidget) { CDockAreaWidget* OldDockArea = DroppedDockWidget->dockAreaWidget(); + if (OldDockArea == TargetArea) + { + return; + } + if (OldDockArea) { OldDockArea->removeDockWidget(DroppedDockWidget);