Improved handling of tabified widgets, improced CSS to decrease height of title bars

This commit is contained in:
Uwe Kindler 2017-03-03 14:27:37 +01:00
parent a8ccbfa407
commit fade9d7b7c
2 changed files with 35 additions and 2 deletions

View File

@ -56,3 +56,13 @@ ads--CDockWidget
border-style: solid;
border-width: 1px 0 0 0;
}
QPushButton#closeButton
{
padding: 0px;
}
QPushButton#tabsMenuButton
{
padding: 0px;
}

View File

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