mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-24 05:22:06 +08:00
Improved handling of tabified widgets, improced CSS to decrease height of title bars
This commit is contained in:
parent
a8ccbfa407
commit
fade9d7b7c
@ -56,3 +56,13 @@ ads--CDockWidget
|
||||
border-style: solid;
|
||||
border-width: 1px 0 0 0;
|
||||
}
|
||||
|
||||
QPushButton#closeButton
|
||||
{
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
QPushButton#tabsMenuButton
|
||||
{
|
||||
padding: 0px;
|
||||
}
|
||||
|
@ -36,6 +36,8 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "DockAreaWidget.h"
|
||||
|
||||
namespace ads
|
||||
{
|
||||
//============================================================================
|
||||
@ -223,7 +225,24 @@ DockWidgetAreas CDockOverlay::allowedAreas() const
|
||||
//============================================================================
|
||||
DockWidgetArea CDockOverlay::dropAreaUnderCursor() const
|
||||
{
|
||||
return d->Cross->cursorLocation();
|
||||
DockWidgetArea Result = d->Cross->cursorLocation();
|
||||
if (Result != InvalidDockWidgetArea)
|
||||
{
|
||||
return Result;
|
||||
}
|
||||
|
||||
CDockAreaWidget* DockArea = dynamic_cast<CDockAreaWidget*>(d->TargetWidget.data());
|
||||
if (!DockArea)
|
||||
{
|
||||
return Result;
|
||||
}
|
||||
|
||||
if (DockArea->titleAreaGeometry().contains(DockArea->mapFromGlobal(QCursor::pos())))
|
||||
{
|
||||
return CenterDockWidgetArea;
|
||||
}
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
||||
@ -516,7 +535,11 @@ DockWidgetArea CDockOverlayCross::cursorLocation() const
|
||||
void CDockOverlayCross::showEvent(QShowEvent*)
|
||||
{
|
||||
resize(d->DockOverlay->size());
|
||||
move(d->DockOverlay->pos());
|
||||
QPoint TopLeft = d->DockOverlay->pos();
|
||||
QPoint Offest((this->width() - d->DockOverlay->width()) / 2,
|
||||
(this->height() - d->DockOverlay->height()) / 2);
|
||||
QPoint CrossTopLeft = TopLeft - Offest;
|
||||
move(CrossTopLeft);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user