Skip to content

Commit 549646d

Browse files
author
Uwe Kindler
committed
Fixed some small bugs in drop indicator painting
1 parent 7ba3c1f commit 549646d

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/DockAreaWidget.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ class CTabsScrollArea : public QScrollArea
168168
*/
169169
virtual void mouseDoubleClickEvent(QMouseEvent *event) override
170170
{
171+
// If this is the last dock area in a dock container it does not make
172+
// sense to move it to a new floating widget and leave this one
173+
// empty
174+
if (m_DockArea->dockContainer()->isFloating() && m_DockArea->dockContainer()->dockAreaCount() == 1)
175+
{
176+
return;
177+
}
171178
startFloating(event->pos());
172179
}
173180

src/DockOverlay.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ static QPixmap createDropIndicatorPixmap(const QPalette& pal, const QSizeF& size
9191
break;
9292
}
9393

94-
if (CDockOverlay::ModeContainerOverlay == Mode)
94+
QSizeF baseSize = baseRect.size();
95+
if (CDockOverlay::ModeContainerOverlay == Mode && DockWidgetArea != CenterDockWidgetArea)
9596
{
9697
baseRect = areaRect;
98+
areaRect = QRectF();
9799
}
98100

99101
p.fillRect(baseRect, backgroundColor);
@@ -126,11 +128,12 @@ static QPixmap createDropIndicatorPixmap(const QPalette& pal, const QSizeF& size
126128

127129
// draw window title bar
128130
p.setBrush(borderColor);
129-
QRectF FrameRect(baseRect.topLeft(), QSizeF(baseRect.width(), baseRect.height() / 10));
131+
QRectF FrameRect(baseRect.topLeft(), QSizeF(baseRect.width(), baseSize.height() / 10));
130132
p.drawRect(FrameRect);
131133
p.restore();
132134

133-
if (CDockOverlay::ModeContainerOverlay == Mode)
135+
// Draw arrow for outer container drop indicators
136+
if (CDockOverlay::ModeContainerOverlay == Mode && DockWidgetArea != CenterDockWidgetArea)
134137
{
135138
QRectF ArrowRect;
136139
ArrowRect.setSize(ShadowRect.size() * 0.7);

0 commit comments

Comments
 (0)