File tree Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -56,3 +56,13 @@ ads--CDockWidget
56
56
border-style : solid;
57
57
border-width : 1px 0 0 0 ;
58
58
}
59
+
60
+ QPushButton # closeButton
61
+ {
62
+ padding : 0px ;
63
+ }
64
+
65
+ QPushButton # tabsMenuButton
66
+ {
67
+ padding : 0px ;
68
+ }
Original file line number Diff line number Diff line change 36
36
37
37
#include < iostream>
38
38
39
+ #include " DockAreaWidget.h"
40
+
39
41
namespace ads
40
42
{
41
43
// ============================================================================
@@ -223,7 +225,24 @@ DockWidgetAreas CDockOverlay::allowedAreas() const
223
225
// ============================================================================
224
226
DockWidgetArea CDockOverlay::dropAreaUnderCursor () const
225
227
{
226
- return d->Cross ->cursorLocation ();
228
+ DockWidgetArea Result = d->Cross ->cursorLocation ();
229
+ if (Result != InvalidDockWidgetArea)
230
+ {
231
+ return Result;
232
+ }
233
+
234
+ CDockAreaWidget* DockArea = dynamic_cast <CDockAreaWidget*>(d->TargetWidget .data ());
235
+ if (!DockArea)
236
+ {
237
+ return Result;
238
+ }
239
+
240
+ if (DockArea->titleAreaGeometry ().contains (DockArea->mapFromGlobal (QCursor::pos ())))
241
+ {
242
+ return CenterDockWidgetArea;
243
+ }
244
+
245
+ return Result;
227
246
}
228
247
229
248
@@ -516,7 +535,11 @@ DockWidgetArea CDockOverlayCross::cursorLocation() const
516
535
void CDockOverlayCross::showEvent (QShowEvent*)
517
536
{
518
537
resize (d->DockOverlay ->size ());
519
- move (d->DockOverlay ->pos ());
538
+ QPoint TopLeft = d->DockOverlay ->pos ();
539
+ QPoint Offest ((this ->width () - d->DockOverlay ->width ()) / 2 ,
540
+ (this ->height () - d->DockOverlay ->height ()) / 2 );
541
+ QPoint CrossTopLeft = TopLeft - Offest;
542
+ move (CrossTopLeft);
520
543
}
521
544
522
545
You can’t perform that action at this time.
0 commit comments