mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-26 14:29:02 +08:00
Started implementing support for docking multiple sections into section
This commit is contained in:
parent
b93d2fbd48
commit
70a7a7b352
@ -46,7 +46,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Returns the current zOrderIndex
|
* Returns the current zOrderIndex
|
||||||
*/
|
*/
|
||||||
unsigned int zOrderIndex() const;
|
virtual unsigned int zOrderIndex() const;
|
||||||
|
|
||||||
void dropFloatingWidget(FloatingWidget* FloatingWidget,
|
void dropFloatingWidget(FloatingWidget* FloatingWidget,
|
||||||
const QPoint& TargetPos);
|
const QPoint& TargetPos);
|
||||||
|
@ -57,8 +57,6 @@ public:
|
|||||||
FloatingWidget(MainContainerWidget* container, SectionWidget* sectionWidget);
|
FloatingWidget(MainContainerWidget* container, SectionWidget* sectionWidget);
|
||||||
virtual ~FloatingWidget();
|
virtual ~FloatingWidget();
|
||||||
|
|
||||||
SectionContent::RefPtr content() const { return _content; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current zOrderIndex
|
* Returns the current zOrderIndex
|
||||||
*/
|
*/
|
||||||
@ -87,9 +85,6 @@ private:
|
|||||||
void setDraggingActive(bool Active);
|
void setDraggingActive(bool Active);
|
||||||
|
|
||||||
MainContainerWidget* m_MainContainerWidget;
|
MainContainerWidget* m_MainContainerWidget;
|
||||||
SectionContent::RefPtr _content;
|
|
||||||
//SectionTitleWidget* _titleWidget;
|
|
||||||
//SectionContentWidget* _contentWidget;
|
|
||||||
CContainerWidget* m_ContainerWidget;
|
CContainerWidget* m_ContainerWidget;
|
||||||
CContainerWidget* m_DropContainer;
|
CContainerWidget* m_DropContainer;
|
||||||
bool m_DraggingActive = false;
|
bool m_DraggingActive = false;
|
||||||
|
@ -117,6 +117,8 @@ public:
|
|||||||
|
|
||||||
static QSplitter* newSplitter(Qt::Orientation orientation = Qt::Horizontal, QWidget* parent = 0);
|
static QSplitter* newSplitter(Qt::Orientation orientation = Qt::Horizontal, QWidget* parent = 0);
|
||||||
|
|
||||||
|
virtual unsigned int zOrderIndex() const {return 0;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Serialization
|
// Serialization
|
||||||
QByteArray saveHierarchy() const;
|
QByteArray saveHierarchy() const;
|
||||||
|
@ -186,7 +186,7 @@ void CContainerWidget::dropIntoContainer(FloatingWidget* FloatingWidget, DropAre
|
|||||||
sp->addWidget(SectionWidget);
|
sp->addWidget(SectionWidget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((FloatingMainSplitter->orientation() == orientation) &&
|
else if ((FloatingMainSplitter->orientation() == orientation || FloatingMainSplitter->count() == 1) &&
|
||||||
(OldSplitter->count() == 1 || OldSplitter->orientation() == orientation))
|
(OldSplitter->count() == 1 || OldSplitter->orientation() == orientation))
|
||||||
{
|
{
|
||||||
OldSplitter->setOrientation(orientation);
|
OldSplitter->setOrientation(orientation);
|
||||||
@ -236,19 +236,22 @@ void CContainerWidget::dropIntoSection(FloatingWidget* FloatingWidget,
|
|||||||
{
|
{
|
||||||
CContainerWidget* FloatingContainer = FloatingWidget->containerWidget();
|
CContainerWidget* FloatingContainer = FloatingWidget->containerWidget();
|
||||||
QSplitter* FloatingMainSplitter = FloatingContainer->findChild<QSplitter*>(QString(),
|
QSplitter* FloatingMainSplitter = FloatingContainer->findChild<QSplitter*>(QString(),
|
||||||
Qt::FindDirectChildrenOnly); QSplitter* OldSplitter = this->findChild<QSplitter*>(QString(), Qt::FindDirectChildrenOnly);
|
Qt::FindDirectChildrenOnly);
|
||||||
QList<SectionWidget*> SectionWidgets;
|
QList<SectionWidget*> SectionWidgets;
|
||||||
for (int i = 0; i < FloatingMainSplitter->count(); ++i)
|
for (int i = 0; i < FloatingMainSplitter->count(); ++i)
|
||||||
{
|
{
|
||||||
SectionWidgets.append(static_cast<SectionWidget*>(FloatingMainSplitter->widget(i)));
|
SectionWidgets.append(static_cast<SectionWidget*>(FloatingMainSplitter->widget(i)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Qt::Orientation Orientation;
|
||||||
|
int InsertIndexOffset;
|
||||||
switch (area)
|
switch (area)
|
||||||
{
|
{
|
||||||
/*case TopDropArea:return insertNewSectionWidget(data, targetSectionWidget, section_widget, Qt::Vertical, 0);
|
case TopDropArea: Orientation = Qt::Vertical; InsertIndexOffset = 0;break;
|
||||||
case RightDropArea: return insertNewSectionWidget(data, targetSectionWidget, section_widget, Qt::Horizontal, 1);
|
case RightDropArea: Orientation = Qt::Horizontal; InsertIndexOffset = 1;break;
|
||||||
case BottomDropArea: return insertNewSectionWidget(data, targetSectionWidget, section_widget, Qt::Vertical, 1);
|
case BottomDropArea: Orientation = Qt::Vertical; InsertIndexOffset = 1;break;
|
||||||
case LeftDropArea: return insertNewSectionWidget(data, targetSectionWidget, section_widget, Qt::Horizontal, 0);*/
|
case LeftDropArea: Orientation = Qt::Horizontal; InsertIndexOffset = 0;break;
|
||||||
|
|
||||||
case CenterDropArea:
|
case CenterDropArea:
|
||||||
{
|
{
|
||||||
QList<SectionWidget*> SectionWidgets = FloatingContainer->findChildren<SectionWidget*>(QString(), Qt::FindChildrenRecursively);
|
QList<SectionWidget*> SectionWidgets = FloatingContainer->findChildren<SectionWidget*>(QString(), Qt::FindChildrenRecursively);
|
||||||
@ -274,6 +277,48 @@ void CContainerWidget::dropIntoSection(FloatingWidget* FloatingWidget,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSplitter* targetSectionSplitter = findParentSplitter(targetSection);
|
||||||
|
std::cout << "target->orientaton " << targetSectionSplitter->orientation()
|
||||||
|
<< " orien " << Orientation << std::endl;
|
||||||
|
int index = targetSectionSplitter->indexOf(targetSection);
|
||||||
|
if (targetSectionSplitter->orientation() == Orientation)
|
||||||
|
{
|
||||||
|
std::cout << "targetSectionSplitter->orientation() == Orientation" << std::endl;
|
||||||
|
if (FloatingMainSplitter->orientation() == Orientation || FloatingMainSplitter->count() == 1)
|
||||||
|
{
|
||||||
|
std::cout << "FloatingMainSplitter->orientation() == Orientation || FloatingMainSplitter->count() == 1" << std::endl;
|
||||||
|
for (int i = 0; i < SectionWidgets.count(); ++i)
|
||||||
|
{
|
||||||
|
targetSectionSplitter->insertWidget(index + InsertIndexOffset, SectionWidgets[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
targetSectionSplitter->insertWidget(index + InsertIndexOffset, FloatingMainSplitter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cout << "targetSectionSplitter->orientation() != Orientation" << std::endl;
|
||||||
|
QSplitter* s = MainContainerWidget::newSplitter(Orientation);
|
||||||
|
if (FloatingMainSplitter->orientation() == Orientation || FloatingMainSplitter->count() == 1)
|
||||||
|
{
|
||||||
|
std::cout << "FloatingMainSplitter->orientation() == Orientation || FloatingMainSplitter->count() == 1" << std::endl;
|
||||||
|
for (int i = 0; i < SectionWidgets.count(); ++i)
|
||||||
|
{
|
||||||
|
s->addWidget(SectionWidgets[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s->addWidget(FloatingMainSplitter);
|
||||||
|
}
|
||||||
|
|
||||||
|
s->addWidget(targetSection);
|
||||||
|
targetSectionSplitter->insertWidget(index, s);
|
||||||
|
}
|
||||||
|
FloatingWidget->deleteLater();
|
||||||
|
|
||||||
/* InternalContentData data;
|
/* InternalContentData data;
|
||||||
if (!sectionwidget->takeContent(m_Content->uid(), data))
|
if (!sectionwidget->takeContent(m_Content->uid(), data))
|
||||||
{
|
{
|
||||||
@ -335,7 +380,7 @@ SectionWidget* CContainerWidget::sectionWidgetAt(const QPoint& pos) const
|
|||||||
|
|
||||||
bool CContainerWidget::isInFrontOf(CContainerWidget* Other) const
|
bool CContainerWidget::isInFrontOf(CContainerWidget* Other) const
|
||||||
{
|
{
|
||||||
return this->m_zOrderIndex > Other->m_zOrderIndex;
|
return this->zOrderIndex() > Other->zOrderIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
SectionWidget* CContainerWidget::dropContent(const InternalContentData& data, SectionWidget* targetSectionWidget, DropArea area, bool autoActive)
|
SectionWidget* CContainerWidget::dropContent(const InternalContentData& data, SectionWidget* targetSectionWidget, DropArea area, bool autoActive)
|
||||||
@ -396,6 +441,7 @@ SectionWidget* CContainerWidget::newSectionWidget()
|
|||||||
void CContainerWidget::addSectionWidget(SectionWidget* section)
|
void CContainerWidget::addSectionWidget(SectionWidget* section)
|
||||||
{
|
{
|
||||||
ADS_Expects(section != NULL);
|
ADS_Expects(section != NULL);
|
||||||
|
|
||||||
if (section->containerWidget())
|
if (section->containerWidget())
|
||||||
{
|
{
|
||||||
section->containerWidget()->takeSection(section);
|
section->containerWidget()->takeSection(section);
|
||||||
|
@ -171,8 +171,6 @@ DropArea DropOverlay::showDropOverlay(QWidget* target)
|
|||||||
return da;
|
return da;
|
||||||
}
|
}
|
||||||
|
|
||||||
//hideDropOverlay();
|
|
||||||
//std::cout << "_target != target, hideDropOverlay(), _fullAreaDrop = false" << std::endl;
|
|
||||||
_target = target;
|
_target = target;
|
||||||
_targetRect = QRect();
|
_targetRect = QRect();
|
||||||
_lastLocation = InvalidDropArea;
|
_lastLocation = InvalidDropArea;
|
||||||
|
@ -138,8 +138,7 @@ void CFloatingTitleWidget::onMaximizeButtonClicked()
|
|||||||
|
|
||||||
FloatingWidget::FloatingWidget(MainContainerWidget* MainContainer, SectionContent::RefPtr sc, SectionTitleWidget* titleWidget, SectionContentWidget* contentWidget, QWidget* parent) :
|
FloatingWidget::FloatingWidget(MainContainerWidget* MainContainer, SectionContent::RefPtr sc, SectionTitleWidget* titleWidget, SectionContentWidget* contentWidget, QWidget* parent) :
|
||||||
QWidget(MainContainer, Qt::Window),
|
QWidget(MainContainer, Qt::Window),
|
||||||
m_MainContainerWidget(MainContainer),
|
m_MainContainerWidget(MainContainer)
|
||||||
_content(sc)
|
|
||||||
{
|
{
|
||||||
QBoxLayout* l = new QBoxLayout(QBoxLayout::TopToBottom);
|
QBoxLayout* l = new QBoxLayout(QBoxLayout::TopToBottom);
|
||||||
l->setContentsMargins(0, 0, 0, 0);
|
l->setContentsMargins(0, 0, 0, 0);
|
||||||
@ -207,7 +206,7 @@ bool FloatingWidget::takeContent(InternalContentData& data)
|
|||||||
|
|
||||||
void FloatingWidget::onCloseButtonClicked()
|
void FloatingWidget::onCloseButtonClicked()
|
||||||
{
|
{
|
||||||
m_MainContainerWidget->hideSectionContent(_content);
|
//m_MainContainerWidget->hideSectionContent(_content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -336,6 +335,10 @@ unsigned int FloatingWidget::zOrderIndex() const
|
|||||||
|
|
||||||
void FloatingWidget::updateDropOverlays(const QPoint& GlobalPos)
|
void FloatingWidget::updateDropOverlays(const QPoint& GlobalPos)
|
||||||
{
|
{
|
||||||
|
if (!isVisible())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
MainContainerWidget* MainContainerWidget = mainContainerWidget();
|
MainContainerWidget* MainContainerWidget = mainContainerWidget();
|
||||||
auto Containers = MainContainerWidget->m_Containers;
|
auto Containers = MainContainerWidget->m_Containers;
|
||||||
CContainerWidget* TopContainer = nullptr;
|
CContainerWidget* TopContainer = nullptr;
|
||||||
@ -390,12 +393,12 @@ void FloatingWidget::updateDropOverlays(const QPoint& GlobalPos)
|
|||||||
|
|
||||||
if (TopContainer)
|
if (TopContainer)
|
||||||
{
|
{
|
||||||
MainContainerWidget->dropOverlay()->showDropOverlay(TopContainer);
|
ContainerDropOverlay->showDropOverlay(TopContainer);
|
||||||
MainContainerWidget->dropOverlay()->raise();
|
ContainerDropOverlay->raise();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MainContainerWidget->dropOverlay()->hideDropOverlay();
|
ContainerDropOverlay->hideDropOverlay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,8 +36,8 @@ QSplitter* MainContainerWidget::newSplitter(Qt::Orientation orientation, QWidget
|
|||||||
MainContainerWidget::MainContainerWidget(QWidget *parent) :
|
MainContainerWidget::MainContainerWidget(QWidget *parent) :
|
||||||
CContainerWidget(this, parent)
|
CContainerWidget(this, parent)
|
||||||
{
|
{
|
||||||
m_SectionDropOverlay = new DropOverlay(0, DropOverlay::ModeSectionOverlay);
|
m_SectionDropOverlay = new DropOverlay(this, DropOverlay::ModeSectionOverlay);
|
||||||
m_ContainerDropOverlay = new DropOverlay(0, DropOverlay::ModeContainerOverlay);
|
m_ContainerDropOverlay = new DropOverlay(this, DropOverlay::ModeContainerOverlay);
|
||||||
m_ContainerDropOverlay->setAttribute(Qt::WA_TransparentForMouseEvents);
|
m_ContainerDropOverlay->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
m_ContainerDropOverlay->setWindowFlags(m_ContainerDropOverlay->windowFlags() | Qt::WindowTransparentForInput);
|
m_ContainerDropOverlay->setWindowFlags(m_ContainerDropOverlay->windowFlags() | Qt::WindowTransparentForInput);
|
||||||
m_Containers.append(this);
|
m_Containers.append(this);
|
||||||
@ -118,12 +118,12 @@ bool MainContainerWidget::showSectionContent(const SectionContent::RefPtr& sc)
|
|||||||
for (int i = 0; i < m_Floatings.count(); ++i)
|
for (int i = 0; i < m_Floatings.count(); ++i)
|
||||||
{
|
{
|
||||||
FloatingWidget* fw = m_Floatings.at(i);
|
FloatingWidget* fw = m_Floatings.at(i);
|
||||||
const bool found = fw->content()->uid() == sc->uid();
|
/*const bool found = fw->content()->uid() == sc->uid();
|
||||||
if (!found)
|
if (!found)
|
||||||
continue;
|
continue;*/
|
||||||
fw->setVisible(true);
|
fw->setVisible(true);
|
||||||
fw->_titleWidget->setVisible(true);
|
//fw->_titleWidget->setVisible(true);
|
||||||
fw->_contentWidget->setVisible(true);
|
//fw->_contentWidget->setVisible(true);
|
||||||
emit sectionContentVisibilityChanged(sc, true);
|
emit sectionContentVisibilityChanged(sc, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -173,9 +173,9 @@ bool MainContainerWidget::hideSectionContent(const SectionContent::RefPtr& sc)
|
|||||||
// We can simply hide floatings, nothing else required.
|
// We can simply hide floatings, nothing else required.
|
||||||
for (int i = 0; i < m_Floatings.count(); ++i)
|
for (int i = 0; i < m_Floatings.count(); ++i)
|
||||||
{
|
{
|
||||||
const bool found = m_Floatings.at(i)->content()->uid() == sc->uid();
|
/*const bool found = m_Floatings.at(i)->content()->uid() == sc->uid();
|
||||||
if (!found)
|
if (!found)
|
||||||
continue;
|
continue;*/
|
||||||
m_Floatings.at(i)->setVisible(false);
|
m_Floatings.at(i)->setVisible(false);
|
||||||
emit sectionContentVisibilityChanged(sc, false);
|
emit sectionContentVisibilityChanged(sc, false);
|
||||||
return true;
|
return true;
|
||||||
@ -240,8 +240,8 @@ bool MainContainerWidget::raiseSectionContent(const SectionContent::RefPtr& sc)
|
|||||||
for (int i = 0; i < m_Floatings.size(); ++i)
|
for (int i = 0; i < m_Floatings.size(); ++i)
|
||||||
{
|
{
|
||||||
FloatingWidget* fw = m_Floatings.at(i);
|
FloatingWidget* fw = m_Floatings.at(i);
|
||||||
if (fw->content()->uid() != sc->uid())
|
/*if (fw->content()->uid() != sc->uid())
|
||||||
continue;
|
continue;*/
|
||||||
fw->setVisible(true);
|
fw->setVisible(true);
|
||||||
fw->raise();
|
fw->raise();
|
||||||
return true;
|
return true;
|
||||||
@ -262,9 +262,9 @@ bool MainContainerWidget::isSectionContentVisible(const SectionContent::RefPtr&
|
|||||||
// Search SC in floatings
|
// Search SC in floatings
|
||||||
for (int i = 0; i < m_Floatings.count(); ++i)
|
for (int i = 0; i < m_Floatings.count(); ++i)
|
||||||
{
|
{
|
||||||
const bool found = m_Floatings.at(i)->content()->uid() == sc->uid();
|
/*const bool found = m_Floatings.at(i)->content()->uid() == sc->uid();
|
||||||
if (!found)
|
if (!found)
|
||||||
continue;
|
continue;*/
|
||||||
return m_Floatings.at(i)->isVisible();
|
return m_Floatings.at(i)->isVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,7 +330,7 @@ QMenu* MainContainerWidget::createContextMenu() const
|
|||||||
// Floating contents
|
// Floating contents
|
||||||
for (int i = 0; i < m_Floatings.size(); ++i)
|
for (int i = 0; i < m_Floatings.size(); ++i)
|
||||||
{
|
{
|
||||||
const FloatingWidget* fw = m_Floatings.at(i);
|
/*const FloatingWidget* fw = m_Floatings.at(i);
|
||||||
const SectionContent::RefPtr sc = fw->content();
|
const SectionContent::RefPtr sc = fw->content();
|
||||||
|
|
||||||
QAction* a = new QAction(QIcon(), sc->visibleTitle(), NULL);
|
QAction* a = new QAction(QIcon(), sc->visibleTitle(), NULL);
|
||||||
@ -340,7 +340,7 @@ QMenu* MainContainerWidget::createContextMenu() const
|
|||||||
a->setCheckable(true);
|
a->setCheckable(true);
|
||||||
a->setChecked(fw->isVisible());
|
a->setChecked(fw->isVisible());
|
||||||
connect(a, SIGNAL(toggled(bool)), this, SLOT(onActionToggleSectionContentVisibility(bool)));
|
connect(a, SIGNAL(toggled(bool)), this, SLOT(onActionToggleSectionContentVisibility(bool)));
|
||||||
actions.insert(a->text(), a);
|
actions.insert(a->text(), a);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create menu from "actions"
|
// Create menu from "actions"
|
||||||
@ -512,7 +512,7 @@ void MainContainerWidget::saveFloatingWidgets(QDataStream& out) const
|
|||||||
for (int i = 0; i < m_Floatings.count(); ++i)
|
for (int i = 0; i < m_Floatings.count(); ++i)
|
||||||
{
|
{
|
||||||
FloatingWidget* fw = m_Floatings.at(i);
|
FloatingWidget* fw = m_Floatings.at(i);
|
||||||
out << fw->content()->uniqueName();
|
/*out << fw->content()->uniqueName();*/
|
||||||
out << fw->saveGeometry();
|
out << fw->saveGeometry();
|
||||||
out << fw->isVisible();
|
out << fw->isVisible();
|
||||||
}
|
}
|
||||||
@ -714,8 +714,8 @@ bool MainContainerWidget::restoreHierarchy(const QByteArray& data)
|
|||||||
|
|
||||||
// Collect all contents which has been restored
|
// Collect all contents which has been restored
|
||||||
QList<SectionContent::RefPtr> contents;
|
QList<SectionContent::RefPtr> contents;
|
||||||
for (int i = 0; i < floatings.count(); ++i)
|
/*for (int i = 0; i < floatings.count(); ++i)
|
||||||
contents.append(floatings.at(i)->content());
|
contents.append(floatings.at(i)->content());*/
|
||||||
for (int i = 0; i < sections.count(); ++i)
|
for (int i = 0; i < sections.count(); ++i)
|
||||||
for (int j = 0; j < sections.at(i)->contents().count(); ++j)
|
for (int j = 0; j < sections.at(i)->contents().count(); ++j)
|
||||||
contents.append(sections.at(i)->contents().at(j));
|
contents.append(sections.at(i)->contents().at(j));
|
||||||
@ -811,8 +811,8 @@ bool MainContainerWidget::restoreFloatingWidgets(QDataStream& in, int version, Q
|
|||||||
fw->setVisible(visible);
|
fw->setVisible(visible);
|
||||||
if (visible)
|
if (visible)
|
||||||
{
|
{
|
||||||
fw->_titleWidget->setVisible(visible);
|
//fw->_titleWidget->setVisible(visible);
|
||||||
fw->_contentWidget->setVisible(visible);
|
//fw->_contentWidget->setVisible(visible);
|
||||||
}
|
}
|
||||||
floatings.append(fw);
|
floatings.append(fw);
|
||||||
//data.titleWidget->m_FloatingWidget = fw; // $mfreiholz: Don't look at it :-< It's more than ugly...
|
//data.titleWidget->m_FloatingWidget = fw; // $mfreiholz: Don't look at it :-< It's more than ugly...
|
||||||
@ -932,9 +932,9 @@ bool MainContainerWidget::takeContent(const SectionContent::RefPtr& sc, Internal
|
|||||||
// Search in floating widgets
|
// Search in floating widgets
|
||||||
for (int i = 0; i < m_Floatings.count() && !found; ++i)
|
for (int i = 0; i < m_Floatings.count() && !found; ++i)
|
||||||
{
|
{
|
||||||
found = m_Floatings.at(i)->content()->uid() == sc->uid();
|
/*found = m_Floatings.at(i)->content()->uid() == sc->uid();
|
||||||
if (found)
|
if (found)
|
||||||
m_Floatings.at(i)->takeContent(data);
|
m_Floatings.at(i)->takeContent(data);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search in hidden items
|
// Search in hidden items
|
||||||
|
@ -184,36 +184,6 @@ void SectionTitleWidget::startFloating(QMouseEvent* ev, MainContainerWidget* cw,
|
|||||||
ContainerDropOverlay->raise();
|
ContainerDropOverlay->raise();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
FloatingWidget* MainContainerWidget::startFloating(SectionWidget* sectionwidget, int ContentUid, const QPoint& TargetPos)
|
|
||||||
{
|
|
||||||
// Create floating widget.
|
|
||||||
InternalContentData data;
|
|
||||||
if (!sectionwidget->takeContent(ContentUid, data))
|
|
||||||
{
|
|
||||||
qWarning() << "THIS SHOULD NOT HAPPEN!!" << ContentUid;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
FloatingWidget* fw = new FloatingWidget(this, data.content, data.titleWidget, data.contentWidget, this);
|
|
||||||
fw->resize(sectionwidget->size());
|
|
||||||
fw->setObjectName("FloatingWidget");
|
|
||||||
fw->startFloating(TargetPos);
|
|
||||||
|
|
||||||
// Delete old section, if it is empty now.
|
|
||||||
if (sectionwidget->contents().isEmpty())
|
|
||||||
{
|
|
||||||
delete sectionwidget;
|
|
||||||
sectionwidget = NULL;
|
|
||||||
}
|
|
||||||
deleteEmptySplitter(this);
|
|
||||||
|
|
||||||
m_ContainerDropOverlay->setAllowedAreas(OuterAreas);
|
|
||||||
m_ContainerDropOverlay->showDropOverlay(this);
|
|
||||||
m_ContainerDropOverlay->raise();
|
|
||||||
return fw;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
void SectionTitleWidget::moveTab(QMouseEvent* ev)
|
void SectionTitleWidget::moveTab(QMouseEvent* ev)
|
||||||
{
|
{
|
||||||
@ -272,7 +242,7 @@ void SectionTitleWidget::mouseMoveEvent(QMouseEvent* ev)
|
|||||||
&& sectionwidget->titleAreaGeometry().contains(sectionwidget->mapFromGlobal(ev->globalPos())))
|
&& sectionwidget->titleAreaGeometry().contains(sectionwidget->mapFromGlobal(ev->globalPos())))
|
||||||
{
|
{
|
||||||
m_TabMoving = true;
|
m_TabMoving = true;
|
||||||
raise(); // Raise current title-widget above other tabs
|
//raise(); // Raise current title-widget above other tabs
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QFrame::mouseMoveEvent(ev);
|
QFrame::mouseMoveEvent(ev);
|
||||||
|
@ -123,7 +123,18 @@ int SectionWidget::uid() const
|
|||||||
|
|
||||||
CContainerWidget* SectionWidget::containerWidget() const
|
CContainerWidget* SectionWidget::containerWidget() const
|
||||||
{
|
{
|
||||||
return dynamic_cast<CContainerWidget*>(parent());
|
QWidget* Parent = parentWidget();
|
||||||
|
while (Parent)
|
||||||
|
{
|
||||||
|
CContainerWidget* Container = dynamic_cast<CContainerWidget*>(Parent);
|
||||||
|
if (Container)
|
||||||
|
{
|
||||||
|
return Container;
|
||||||
|
}
|
||||||
|
Parent = Parent->parentWidget();
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect SectionWidget::titleAreaGeometry() const
|
QRect SectionWidget::titleAreaGeometry() const
|
||||||
|
Loading…
Reference in New Issue
Block a user