Improved source documentation and images
@ -384,7 +384,7 @@ CMainWindow::CMainWindow(QWidget *parent) :
|
||||
|
||||
// uncomment the follwing line if you want to use non opaque undocking and splitter
|
||||
// moevements
|
||||
// CDockManager::setConfigFlags(CDockManager::DefaultNonOpaqueConfig);
|
||||
CDockManager::setConfigFlags(CDockManager::DefaultNonOpaqueConfig);
|
||||
|
||||
// Now create the dock manager and its content
|
||||
d->DockManager = new CDockManager(this);
|
||||
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 91 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 232 KiB After Width: | Height: | Size: 142 KiB |
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 88 KiB |
@ -61,22 +61,33 @@ class CFloatingWidgetTitleBar;
|
||||
class CDockingStateReader;
|
||||
|
||||
/**
|
||||
* Pure virtual interface for floating widgets
|
||||
* Pure virtual interface for floating widgets.
|
||||
* This interface is used for opaque and non-opaque undocking. If opaque
|
||||
* undocking is used, the a real CFloatingDockContainer widget will be created
|
||||
*/
|
||||
class IFloatingWidget
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Starts floating.
|
||||
* This function should get called typically from a mouse press event
|
||||
* handler
|
||||
*/
|
||||
virtual void startFloating(const QPoint& DragStartMousePos, const QSize& Size,
|
||||
eDragState DragState, QWidget* MouseEventHandler) = 0;
|
||||
|
||||
/**
|
||||
* Moves the widget to a new position relative to the position given when
|
||||
* startFloating() was called
|
||||
* startFloating() was called.
|
||||
* This function should be called from a mouse mouve event handler to
|
||||
* move the floating widget on mouse move events.
|
||||
*/
|
||||
virtual void moveFloating() = 0;
|
||||
|
||||
/**
|
||||
* Tells the widget that to finish dragging if the mouse is released
|
||||
* Tells the widget that to finish dragging if the mouse is released.
|
||||
* This function should be called from a mouse release event handler
|
||||
* to finish the dragging
|
||||
*/
|
||||
virtual void finishDragging() = 0;
|
||||
};
|
||||
|
@ -316,7 +316,7 @@ void CFloatingOverlay::paintEvent(QPaintEvent* event)
|
||||
painter.drawPixmap(QPoint(0, 0), d->ContentPreviewPixmap);
|
||||
}
|
||||
|
||||
// If we do not have a window frame then we paint a QRubberBadn like
|
||||
// If we do not have a window frame then we paint a QRubberBand like
|
||||
// frameless window
|
||||
if (!CDockManager::configFlags().testFlag(CDockManager::DragPreviewHasWindowFrame))
|
||||
{
|
||||
|
@ -21,7 +21,9 @@ struct FloatingOverlayPrivate;
|
||||
|
||||
/**
|
||||
* A floating overlay is a temporary floating widget that is just used to
|
||||
* indicate the floating widget movement
|
||||
* indicate the floating widget movement.
|
||||
* This widget is used as a placeholder for drag operations for non-opaque
|
||||
* docking
|
||||
*/
|
||||
class CFloatingOverlay : public QWidget, public IFloatingWidget
|
||||
{
|
||||
@ -30,7 +32,14 @@ private:
|
||||
friend class FloatingOverlayPrivate;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Updates the drop overlays
|
||||
*/
|
||||
virtual void moveEvent(QMoveEvent *event) override;
|
||||
|
||||
/**
|
||||
* Cares about painting the
|
||||
*/
|
||||
virtual void paintEvent(QPaintEvent *e) override;
|
||||
|
||||
/**
|
||||
@ -40,7 +49,16 @@ protected:
|
||||
|
||||
public:
|
||||
using Super = QWidget;
|
||||
|
||||
/**
|
||||
* Creates an instance for undocking the DockWidget in Content parameter
|
||||
*/
|
||||
CFloatingOverlay(CDockWidget* Content);
|
||||
|
||||
/**
|
||||
* Creates an instance for undocking the DockArea given in Content
|
||||
* parameters
|
||||
*/
|
||||
CFloatingOverlay(CDockAreaWidget* Content);
|
||||
|
||||
/**
|
||||
@ -48,6 +66,8 @@ public:
|
||||
*/
|
||||
~CFloatingOverlay();
|
||||
|
||||
|
||||
public: // implements IFloatingWidget -----------------------------------------
|
||||
virtual void startFloating(const QPoint& DragStartMousePos, const QSize& Size,
|
||||
eDragState DragState, QWidget* MouseEventHandler) override;
|
||||
|
||||
@ -58,7 +78,9 @@ public:
|
||||
virtual void moveFloating() override;
|
||||
|
||||
/**
|
||||
* Finishes dragging
|
||||
* Finishes dragging.
|
||||
* Hides the dock overlays and executes the real undocking and docking
|
||||
* of the assigned Content widget
|
||||
*/
|
||||
virtual void finishDragging() override;
|
||||
};
|
||||
|