Fixed vertical alignment of label in FloatingWidgetTitleBar

Added call to FloatingWidget->finishDragging()
This commit is contained in:
Uwe Kindler 2019-12-13 13:19:24 +01:00
parent 02143eac71
commit 5b3a0a28df

View File

@ -77,7 +77,7 @@ void FloatingWidgetTitleBarPrivate::createLayout()
TitleLabel->setElideMode(Qt::ElideRight); TitleLabel->setElideMode(Qt::ElideRight);
TitleLabel->setText("DockWidget->windowTitle()"); TitleLabel->setText("DockWidget->windowTitle()");
TitleLabel->setObjectName("floatingTitleLabel"); TitleLabel->setObjectName("floatingTitleLabel");
TitleLabel->setAlignment(Qt::AlignLeft); TitleLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
CloseButton = new tCloseButton(); CloseButton = new tCloseButton();
CloseButton->setObjectName("floatingTitleCloseButton"); CloseButton->setObjectName("floatingTitleCloseButton");
@ -145,6 +145,10 @@ void CFloatingWidgetTitleBar::mousePressEvent(QMouseEvent *ev)
void CFloatingWidgetTitleBar::mouseReleaseEvent(QMouseEvent *ev) void CFloatingWidgetTitleBar::mouseReleaseEvent(QMouseEvent *ev)
{ {
d->DragState = DraggingInactive; d->DragState = DraggingInactive;
if (d->FloatingWidget)
{
d->FloatingWidget->finishDragging();
}
Super::mouseReleaseEvent(ev); Super::mouseReleaseEvent(ev);
} }