From 549646d113e0022a5bf82a5f10fa6c06751c9544 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Mon, 27 Mar 2017 16:16:22 +0200 Subject: [PATCH] Fixed some small bugs in drop indicator painting --- src/DockAreaWidget.cpp | 7 +++++++ src/DockOverlay.cpp | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/DockAreaWidget.cpp b/src/DockAreaWidget.cpp index 84b428a..7c353bf 100644 --- a/src/DockAreaWidget.cpp +++ b/src/DockAreaWidget.cpp @@ -168,6 +168,13 @@ protected: */ virtual void mouseDoubleClickEvent(QMouseEvent *event) override { + // If this is the last dock area in a dock container it does not make + // sense to move it to a new floating widget and leave this one + // empty + if (m_DockArea->dockContainer()->isFloating() && m_DockArea->dockContainer()->dockAreaCount() == 1) + { + return; + } startFloating(event->pos()); } diff --git a/src/DockOverlay.cpp b/src/DockOverlay.cpp index dc8bbaa..66078ce 100644 --- a/src/DockOverlay.cpp +++ b/src/DockOverlay.cpp @@ -91,9 +91,11 @@ static QPixmap createDropIndicatorPixmap(const QPalette& pal, const QSizeF& size break; } - if (CDockOverlay::ModeContainerOverlay == Mode) + QSizeF baseSize = baseRect.size(); + if (CDockOverlay::ModeContainerOverlay == Mode && DockWidgetArea != CenterDockWidgetArea) { baseRect = areaRect; + areaRect = QRectF(); } p.fillRect(baseRect, backgroundColor); @@ -126,11 +128,12 @@ static QPixmap createDropIndicatorPixmap(const QPalette& pal, const QSizeF& size // draw window title bar p.setBrush(borderColor); - QRectF FrameRect(baseRect.topLeft(), QSizeF(baseRect.width(), baseRect.height() / 10)); + QRectF FrameRect(baseRect.topLeft(), QSizeF(baseRect.width(), baseSize.height() / 10)); p.drawRect(FrameRect); p.restore(); - if (CDockOverlay::ModeContainerOverlay == Mode) + // Draw arrow for outer container drop indicators + if (CDockOverlay::ModeContainerOverlay == Mode && DockWidgetArea != CenterDockWidgetArea) { QRectF ArrowRect; ArrowRect.setSize(ShadowRect.size() * 0.7);