2017-02-27 21:15:20 +08:00
|
|
|
/*******************************************************************************
|
2017-06-10 04:04:02 +08:00
|
|
|
** Qt Advanced Docking System
|
2017-02-27 21:15:20 +08:00
|
|
|
** Copyright (C) 2017 Uwe Kindler
|
2017-06-10 04:04:02 +08:00
|
|
|
**
|
|
|
|
** This library is free software; you can redistribute it and/or
|
|
|
|
** modify it under the terms of the GNU Lesser General Public
|
|
|
|
** License as published by the Free Software Foundation; either
|
|
|
|
** version 2.1 of the License, or (at your option) any later version.
|
|
|
|
**
|
|
|
|
** This library is distributed in the hope that it will be useful,
|
2017-02-27 21:15:20 +08:00
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2017-06-10 04:04:02 +08:00
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
** Lesser General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU Lesser General Public
|
|
|
|
** License along with this library; If not, see <http://www.gnu.org/licenses/>.
|
2017-02-27 21:15:20 +08:00
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
2017-02-25 05:44:02 +08:00
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
/// \file DockWidgetTab.cpp
|
2017-02-25 05:44:02 +08:00
|
|
|
/// \author Uwe Kindler
|
2017-02-27 21:15:20 +08:00
|
|
|
/// \date 27.02.2017
|
2018-08-24 19:41:58 +08:00
|
|
|
/// \brief Implementation of CDockWidgetTab class
|
2017-02-25 05:44:02 +08:00
|
|
|
//============================================================================
|
|
|
|
|
2017-02-27 21:15:20 +08:00
|
|
|
|
2017-02-25 05:44:02 +08:00
|
|
|
//============================================================================
|
|
|
|
// INCLUDES
|
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
#include "DockWidgetTab.h"
|
2017-02-25 05:44:02 +08:00
|
|
|
|
2017-02-27 21:15:20 +08:00
|
|
|
#include <QBoxLayout>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QMouseEvent>
|
|
|
|
#include <QStyle>
|
2017-02-28 22:23:02 +08:00
|
|
|
#include <QApplication>
|
2017-03-01 21:09:56 +08:00
|
|
|
#include <QSplitter>
|
2017-03-28 18:01:27 +08:00
|
|
|
#include <QDebug>
|
2017-02-27 21:15:20 +08:00
|
|
|
|
2017-03-01 21:09:56 +08:00
|
|
|
#include "ads_globals.h"
|
2017-02-27 21:15:20 +08:00
|
|
|
#include "DockWidget.h"
|
2017-02-28 22:23:02 +08:00
|
|
|
#include "DockAreaWidget.h"
|
2017-03-01 21:09:56 +08:00
|
|
|
#include "FloatingDockContainer.h"
|
2017-03-02 18:43:48 +08:00
|
|
|
#include "DockOverlay.h"
|
|
|
|
#include "DockManager.h"
|
2017-02-27 21:15:20 +08:00
|
|
|
|
2018-10-12 15:17:14 +08:00
|
|
|
#include <iostream>
|
|
|
|
|
2017-02-25 05:44:02 +08:00
|
|
|
namespace ads
|
|
|
|
{
|
2017-03-01 21:09:56 +08:00
|
|
|
/**
|
|
|
|
* The different dragging states
|
|
|
|
*/
|
|
|
|
enum eDragState
|
|
|
|
{
|
|
|
|
DraggingInactive, //!< DraggingInactive
|
|
|
|
DraggingMousePressed, //!< DraggingMousePressed
|
|
|
|
DraggingTab, //!< DraggingTab
|
|
|
|
DraggingFloatingWidget//!< DraggingFloatingWidget
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-02-27 21:15:20 +08:00
|
|
|
/**
|
2018-08-24 19:41:58 +08:00
|
|
|
* Private data class of CDockWidgetTab class (pimpl)
|
2017-02-27 21:15:20 +08:00
|
|
|
*/
|
2018-08-24 19:41:58 +08:00
|
|
|
struct DockWidgetTabPrivate
|
2017-02-27 21:15:20 +08:00
|
|
|
{
|
2018-08-24 19:41:58 +08:00
|
|
|
CDockWidgetTab* _this;
|
2017-02-27 21:15:20 +08:00
|
|
|
CDockWidget* DockWidget;
|
|
|
|
QLabel* IconLabel;
|
|
|
|
QLabel* TitleLabel;
|
|
|
|
QPoint DragStartMousePosition;
|
|
|
|
bool IsActiveTab = false;
|
2017-02-28 22:23:02 +08:00
|
|
|
CDockAreaWidget* DockArea = nullptr;
|
2017-03-01 21:09:56 +08:00
|
|
|
eDragState DragState = DraggingInactive;
|
2017-03-03 20:42:41 +08:00
|
|
|
CFloatingDockContainer* FloatingWidget = nullptr;
|
2018-01-02 15:01:23 +08:00
|
|
|
QIcon Icon;
|
2017-02-27 21:15:20 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Private data constructor
|
|
|
|
*/
|
2018-08-24 19:41:58 +08:00
|
|
|
DockWidgetTabPrivate(CDockWidgetTab* _public);
|
2017-02-27 21:15:20 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates the complete layout including all controls
|
|
|
|
*/
|
|
|
|
void createLayout();
|
2017-02-28 22:23:02 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Moves the tab depending on the position in the given mouse event
|
|
|
|
*/
|
|
|
|
void moveTab(QMouseEvent* ev);
|
2017-03-01 21:09:56 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Test function for current drag state
|
|
|
|
*/
|
|
|
|
bool isDraggingState(eDragState dragState)
|
|
|
|
{
|
|
|
|
return this->DragState == dragState;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the given global point is inside the title area geometry
|
|
|
|
* rectangle.
|
|
|
|
* The position is given as global position.
|
|
|
|
*/
|
|
|
|
bool titleAreaGeometryContains(const QPoint& GlobalPos) const
|
|
|
|
{
|
|
|
|
return DockArea->titleAreaGeometry().contains(DockArea->mapFromGlobal(GlobalPos));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Starts floating of the dock widget that belongs to this title bar
|
2017-03-02 18:43:48 +08:00
|
|
|
* Returns true, if floating has been started and false if floating
|
|
|
|
* is not possible for any reason
|
2017-03-01 21:09:56 +08:00
|
|
|
*/
|
2017-03-29 18:18:49 +08:00
|
|
|
bool startFloating();
|
2017-02-27 21:15:20 +08:00
|
|
|
};
|
2018-08-24 19:41:58 +08:00
|
|
|
// struct DockWidgetTabPrivate
|
2017-02-27 21:15:20 +08:00
|
|
|
|
2017-03-13 04:41:50 +08:00
|
|
|
|
2017-02-27 21:15:20 +08:00
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
DockWidgetTabPrivate::DockWidgetTabPrivate(CDockWidgetTab* _public) :
|
2017-02-27 21:15:20 +08:00
|
|
|
_this(_public)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
void DockWidgetTabPrivate::createLayout()
|
2017-02-27 21:15:20 +08:00
|
|
|
{
|
|
|
|
QBoxLayout* l = new QBoxLayout(QBoxLayout::LeftToRight);
|
|
|
|
l->setContentsMargins(0, 0, 0, 0);
|
|
|
|
_this->setLayout(l);
|
|
|
|
|
|
|
|
IconLabel = new QLabel();
|
|
|
|
IconLabel->setAlignment(Qt::AlignVCenter);
|
|
|
|
l->addWidget(IconLabel, Qt::AlignVCenter);
|
|
|
|
|
|
|
|
TitleLabel = new QLabel();
|
2018-08-29 14:47:05 +08:00
|
|
|
TitleLabel->setObjectName("dockWidgetTabLabel");
|
2017-02-27 21:15:20 +08:00
|
|
|
l->addWidget(TitleLabel, 1);
|
|
|
|
|
|
|
|
IconLabel->setVisible(false);
|
|
|
|
TitleLabel->setVisible(true);
|
|
|
|
TitleLabel->setText(DockWidget->windowTitle());
|
|
|
|
}
|
|
|
|
|
2017-02-28 22:23:02 +08:00
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
void DockWidgetTabPrivate::moveTab(QMouseEvent* ev)
|
2017-02-28 22:23:02 +08:00
|
|
|
{
|
|
|
|
ev->accept();
|
|
|
|
int left, top, right, bottom;
|
|
|
|
_this->getContentsMargins(&left, &top, &right, &bottom);
|
|
|
|
QPoint moveToPos = _this->mapToParent(ev->pos()) - DragStartMousePosition;
|
|
|
|
moveToPos.setY(0);
|
|
|
|
_this->move(moveToPos);
|
|
|
|
_this->raise();
|
|
|
|
}
|
|
|
|
|
2017-02-27 21:15:20 +08:00
|
|
|
|
2017-03-01 21:09:56 +08:00
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
bool DockWidgetTabPrivate::startFloating()
|
2017-03-01 21:09:56 +08:00
|
|
|
{
|
2018-09-14 19:21:29 +08:00
|
|
|
auto dockContainer = DockWidget->dockContainer();
|
|
|
|
qDebug() << "isFloating " << dockContainer->isFloating();
|
|
|
|
qDebug() << "areaCount " << dockContainer->dockAreaCount();
|
2018-09-14 14:46:10 +08:00
|
|
|
qDebug() << "widgetCount " << DockWidget->dockAreaWidget()->dockWidgetsCount();
|
2017-03-02 18:43:48 +08:00
|
|
|
// if this is the last dock widget inside of this floating widget,
|
2017-09-06 21:45:22 +08:00
|
|
|
// then it does not make any sense, to make it floating because
|
2017-03-02 18:43:48 +08:00
|
|
|
// it is already floating
|
2018-09-14 19:21:29 +08:00
|
|
|
if (dockContainer->isFloating()
|
|
|
|
&& (dockContainer->visibleDockAreaCount() == 1)
|
2018-09-14 14:46:10 +08:00
|
|
|
&& (DockWidget->dockAreaWidget()->dockWidgetsCount() == 1))
|
2017-03-02 18:43:48 +08:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-28 18:01:27 +08:00
|
|
|
qDebug() << "startFloating";
|
2017-03-01 21:09:56 +08:00
|
|
|
DragState = DraggingFloatingWidget;
|
|
|
|
QSize Size = DockArea->size();
|
|
|
|
CFloatingDockContainer* FloatingWidget = nullptr;
|
2018-09-14 14:46:10 +08:00
|
|
|
if (DockArea->dockWidgetsCount() > 1)
|
2017-03-01 21:09:56 +08:00
|
|
|
{
|
|
|
|
// If section widget has multiple tabs, we take only one tab
|
|
|
|
FloatingWidget = new CFloatingDockContainer(DockWidget);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-08-24 19:41:58 +08:00
|
|
|
qDebug() << "DockWidgetTabPrivate::startFloating DockArea";
|
2017-03-01 21:09:56 +08:00
|
|
|
// If section widget has only one content widget, we can move the complete
|
2017-03-24 23:17:55 +08:00
|
|
|
// dock area into floating widget
|
2017-03-01 21:09:56 +08:00
|
|
|
FloatingWidget = new CFloatingDockContainer(DockArea);
|
|
|
|
}
|
|
|
|
|
2017-03-01 21:36:46 +08:00
|
|
|
FloatingWidget->startFloating(DragStartMousePosition, Size);
|
2017-03-02 18:43:48 +08:00
|
|
|
auto Overlay = DockWidget->dockManager()->containerOverlay();
|
|
|
|
Overlay->setAllowedAreas(OuterDockAreas);
|
2017-03-03 20:42:41 +08:00
|
|
|
this->FloatingWidget = FloatingWidget;
|
2018-09-26 15:57:36 +08:00
|
|
|
DockWidget->emitTopLevelChanged(true);
|
2017-03-02 18:43:48 +08:00
|
|
|
return true;
|
2017-03-01 21:09:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-02-27 21:15:20 +08:00
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
CDockWidgetTab::CDockWidgetTab(CDockWidget* DockWidget, QWidget *parent) :
|
2017-02-27 21:15:20 +08:00
|
|
|
QFrame(parent),
|
2018-08-24 19:41:58 +08:00
|
|
|
d(new DockWidgetTabPrivate(this))
|
2017-02-27 21:15:20 +08:00
|
|
|
{
|
2017-03-02 18:43:48 +08:00
|
|
|
setAttribute(Qt::WA_NoMousePropagation, true);
|
2017-02-27 21:15:20 +08:00
|
|
|
d->DockWidget = DockWidget;
|
|
|
|
d->createLayout();
|
|
|
|
}
|
|
|
|
|
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
CDockWidgetTab::~CDockWidgetTab()
|
2017-02-27 21:15:20 +08:00
|
|
|
{
|
2018-08-24 19:41:58 +08:00
|
|
|
qDebug() << "~CDockWidgetTab()";
|
2017-02-27 21:15:20 +08:00
|
|
|
delete d;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
void CDockWidgetTab::mousePressEvent(QMouseEvent* ev)
|
2017-02-27 21:15:20 +08:00
|
|
|
{
|
|
|
|
if (ev->button() == Qt::LeftButton)
|
|
|
|
{
|
2018-08-24 19:41:58 +08:00
|
|
|
qDebug() << "CDockWidgetTab::mousePressEvent";
|
2017-02-27 21:15:20 +08:00
|
|
|
ev->accept();
|
|
|
|
d->DragStartMousePosition = ev->pos();
|
2017-03-01 21:09:56 +08:00
|
|
|
d->DragState = DraggingMousePressed;
|
2018-10-12 15:17:14 +08:00
|
|
|
emit clicked();
|
2017-02-27 21:15:20 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
QFrame::mousePressEvent(ev);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
void CDockWidgetTab::mouseReleaseEvent(QMouseEvent* ev)
|
2017-02-27 21:15:20 +08:00
|
|
|
{
|
2018-08-24 19:41:58 +08:00
|
|
|
qDebug() << "CDockWidgetTab::mouseReleaseEvent";
|
2018-10-12 15:17:14 +08:00
|
|
|
// End of tab moving, emit signal
|
2017-03-01 21:09:56 +08:00
|
|
|
if (d->isDraggingState(DraggingTab) && d->DockArea)
|
2017-02-28 22:23:02 +08:00
|
|
|
{
|
2018-10-12 15:17:14 +08:00
|
|
|
emit moved(ev->globalPos());
|
2017-02-28 22:23:02 +08:00
|
|
|
}
|
|
|
|
|
2017-02-27 21:15:20 +08:00
|
|
|
d->DragStartMousePosition = QPoint();
|
2017-03-01 21:09:56 +08:00
|
|
|
d->DragState = DraggingInactive;
|
2017-02-28 22:23:02 +08:00
|
|
|
QFrame::mouseReleaseEvent(ev);
|
2017-02-27 21:15:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
void CDockWidgetTab::mouseMoveEvent(QMouseEvent* ev)
|
2017-02-27 21:15:20 +08:00
|
|
|
{
|
2017-03-01 21:09:56 +08:00
|
|
|
if (!(ev->buttons() & Qt::LeftButton) || d->isDraggingState(DraggingInactive))
|
|
|
|
{
|
|
|
|
d->DragState = DraggingInactive;
|
|
|
|
QFrame::mouseMoveEvent(ev);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-10-12 15:17:14 +08:00
|
|
|
// move floating window
|
2017-03-01 21:09:56 +08:00
|
|
|
if (d->isDraggingState(DraggingFloatingWidget))
|
2017-02-28 22:23:02 +08:00
|
|
|
{
|
2018-08-24 20:04:21 +08:00
|
|
|
d->FloatingWidget->moveFloating();
|
2017-02-28 22:23:02 +08:00
|
|
|
QFrame::mouseMoveEvent(ev);
|
|
|
|
return;
|
|
|
|
}
|
2017-02-27 21:15:20 +08:00
|
|
|
|
2017-02-28 22:23:02 +08:00
|
|
|
// move tab
|
2017-03-01 21:09:56 +08:00
|
|
|
if (d->isDraggingState(DraggingTab))
|
2017-02-28 22:23:02 +08:00
|
|
|
{
|
2018-08-24 20:04:21 +08:00
|
|
|
// Moving the tab is always allowed because it does not mean moving the
|
|
|
|
// dock widget around
|
|
|
|
d->moveTab(ev);
|
2017-02-28 22:23:02 +08:00
|
|
|
}
|
|
|
|
|
2017-03-01 21:09:56 +08:00
|
|
|
bool MouseInsideTitleArea = d->titleAreaGeometryContains(ev->globalPos());
|
|
|
|
if (!MouseInsideTitleArea)
|
|
|
|
{
|
2018-09-14 14:46:10 +08:00
|
|
|
// If this is the last dock area in a dock container with only
|
|
|
|
// one single dock widget it does not make sense to move it to a new
|
|
|
|
// floating widget and leave this one empty
|
|
|
|
if (d->DockArea->dockContainer()->isFloating()
|
|
|
|
&& d->DockArea->openDockWidgetsCount() == 1
|
|
|
|
&& d->DockArea->dockContainer()->visibleDockAreaCount() == 1)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-08-24 20:04:21 +08:00
|
|
|
// Floating is only allowed for widgets that are movable
|
|
|
|
if (d->DockWidget->features().testFlag(CDockWidget::DockWidgetMovable))
|
|
|
|
{
|
2018-08-10 18:54:09 +08:00
|
|
|
d->startFloating();
|
|
|
|
}
|
2017-03-02 18:43:48 +08:00
|
|
|
return;
|
2017-03-01 21:09:56 +08:00
|
|
|
}
|
2018-09-14 14:46:10 +08:00
|
|
|
else if (d->DockArea->openDockWidgetsCount() > 1
|
2017-03-02 18:43:48 +08:00
|
|
|
&& (ev->pos() - d->DragStartMousePosition).manhattanLength() >= QApplication::startDragDistance()) // Wait a few pixels before start moving
|
2017-02-28 22:23:02 +08:00
|
|
|
{
|
2018-08-24 20:04:21 +08:00
|
|
|
d->DragState = DraggingTab;
|
2017-02-28 22:23:02 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
QFrame::mouseMoveEvent(ev);
|
2017-02-27 21:15:20 +08:00
|
|
|
}
|
2017-02-25 05:44:02 +08:00
|
|
|
|
2017-02-27 21:15:20 +08:00
|
|
|
|
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
bool CDockWidgetTab::isActiveTab() const
|
2017-02-27 21:15:20 +08:00
|
|
|
{
|
|
|
|
return d->IsActiveTab;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
void CDockWidgetTab::setActiveTab(bool active)
|
2017-02-27 21:15:20 +08:00
|
|
|
{
|
|
|
|
if (d->IsActiveTab == active)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
d->IsActiveTab = active;
|
|
|
|
style()->unpolish(this);
|
|
|
|
style()->polish(this);
|
|
|
|
d->TitleLabel->style()->unpolish(d->TitleLabel);
|
|
|
|
d->TitleLabel->style()->polish(d->TitleLabel);
|
|
|
|
update();
|
|
|
|
|
|
|
|
emit activeTabChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
CDockWidget* CDockWidgetTab::dockWidget() const
|
2017-02-27 21:15:20 +08:00
|
|
|
{
|
|
|
|
return d->DockWidget;
|
|
|
|
}
|
2017-02-28 22:23:02 +08:00
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
void CDockWidgetTab::setDockAreaWidget(CDockAreaWidget* DockArea)
|
2017-02-28 22:23:02 +08:00
|
|
|
{
|
|
|
|
d->DockArea = DockArea;
|
|
|
|
}
|
2017-03-01 21:09:56 +08:00
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
CDockAreaWidget* CDockWidgetTab::dockAreaWidget() const
|
2017-03-01 21:09:56 +08:00
|
|
|
{
|
|
|
|
return d->DockArea;
|
|
|
|
}
|
2018-01-02 15:01:23 +08:00
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
void CDockWidgetTab::setIcon(const QIcon& Icon)
|
2018-01-02 15:01:23 +08:00
|
|
|
{
|
|
|
|
d->Icon = Icon;
|
|
|
|
d->IconLabel->setPixmap(Icon.pixmap(this->windowHandle(), QSize(16, 16)));
|
|
|
|
d->IconLabel->setVisible(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
2018-08-24 19:41:58 +08:00
|
|
|
const QIcon& CDockWidgetTab::icon() const
|
2018-01-02 15:01:23 +08:00
|
|
|
{
|
|
|
|
return d->Icon;
|
|
|
|
}
|
2018-09-07 19:13:44 +08:00
|
|
|
|
|
|
|
|
2018-10-12 15:17:14 +08:00
|
|
|
//============================================================================
|
|
|
|
QString CDockWidgetTab::text() const
|
|
|
|
{
|
|
|
|
return d->TitleLabel->text();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-09-07 19:13:44 +08:00
|
|
|
//============================================================================
|
|
|
|
void CDockWidgetTab::mouseDoubleClickEvent(QMouseEvent *event)
|
|
|
|
{
|
|
|
|
// If this is the last dock area in a dock container it does not make
|
|
|
|
// sense to move it to a new floating widget and leave this one
|
|
|
|
// empty
|
2018-09-14 14:46:10 +08:00
|
|
|
if (!d->DockArea->dockContainer()->isFloating() || d->DockArea->dockWidgetsCount() > 1)
|
2018-09-07 19:13:44 +08:00
|
|
|
{
|
|
|
|
d->startFloating();
|
|
|
|
}
|
|
|
|
|
|
|
|
Super::mouseDoubleClickEvent(event);
|
|
|
|
}
|
|
|
|
|
2018-09-14 19:21:29 +08:00
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
void CDockWidgetTab::setVisible(bool visible)
|
|
|
|
{
|
|
|
|
if (!visible)
|
|
|
|
{
|
|
|
|
qDebug() << "CDockWidgetTab::setVisible " << visible;
|
|
|
|
}
|
|
|
|
Super::setVisible(visible);
|
|
|
|
}
|
|
|
|
|
2017-02-25 05:44:02 +08:00
|
|
|
} // namespace ads
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
2018-08-24 19:41:58 +08:00
|
|
|
// EOF DockWidgetTab.cpp
|