Fixed some small bugs in drop indicator painting

This commit is contained in:
Uwe Kindler 2017-03-27 16:16:22 +02:00
parent 7ba3c1f244
commit 549646d113
2 changed files with 13 additions and 3 deletions

View File

@ -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());
}

View File

@ -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);