mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-13 00:30:25 +08:00
Properly implemented showing and hiding of TitleBarUndockButton
This commit is contained in:
parent
188624440b
commit
c973482b2b
@ -66,8 +66,8 @@ static const int APPEND = -1;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* New dock area layout mimics stack layout but ony inserts the current
|
* New dock area layout mimics stack layout but only inserts the current
|
||||||
* widget
|
* widget into the internal QLayout object
|
||||||
*/
|
*/
|
||||||
class CDockAreaLayout
|
class CDockAreaLayout
|
||||||
{
|
{
|
||||||
@ -78,17 +78,27 @@ private:
|
|||||||
QWidget* m_CurrentWidget = nullptr;
|
QWidget* m_CurrentWidget = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* Creates an instance with the given parent layout
|
||||||
|
*/
|
||||||
CDockAreaLayout(QBoxLayout* ParentLayout)
|
CDockAreaLayout(QBoxLayout* ParentLayout)
|
||||||
: m_ParentLayout(ParentLayout)
|
: m_ParentLayout(ParentLayout)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the number of widgets in this layout
|
||||||
|
*/
|
||||||
int count() const
|
int count() const
|
||||||
{
|
{
|
||||||
return m_Widgets.count();
|
return m_Widgets.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inserts the widget at the given index position into the internal widget
|
||||||
|
* list
|
||||||
|
*/
|
||||||
void insertWidget(int index, QWidget* Widget)
|
void insertWidget(int index, QWidget* Widget)
|
||||||
{
|
{
|
||||||
Widget->setParent(0);
|
Widget->setParent(0);
|
||||||
@ -110,6 +120,9 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the given widget from the lyout
|
||||||
|
*/
|
||||||
void removeWidget(QWidget* Widget)
|
void removeWidget(QWidget* Widget)
|
||||||
{
|
{
|
||||||
if (currentWidget() == Widget)
|
if (currentWidget() == Widget)
|
||||||
@ -125,11 +138,17 @@ public:
|
|||||||
m_Widgets.removeOne(Widget);
|
m_Widgets.removeOne(Widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current selected widget
|
||||||
|
*/
|
||||||
QWidget* currentWidget() const
|
QWidget* currentWidget() const
|
||||||
{
|
{
|
||||||
return m_CurrentWidget;
|
return m_CurrentWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Activates the widget with the give index.
|
||||||
|
*/
|
||||||
void setCurrentIndex(int index)
|
void setCurrentIndex(int index)
|
||||||
{
|
{
|
||||||
QWidget *prev = currentWidget();
|
QWidget *prev = currentWidget();
|
||||||
@ -169,26 +188,41 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the index of the current active widget
|
||||||
|
*/
|
||||||
int currentIndex() const
|
int currentIndex() const
|
||||||
{
|
{
|
||||||
return m_CurrentIndex;
|
return m_CurrentIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if there are no widgets in the layout
|
||||||
|
*/
|
||||||
bool isEmpty() const
|
bool isEmpty() const
|
||||||
{
|
{
|
||||||
return m_Widgets.empty();
|
return m_Widgets.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the index of the given widget
|
||||||
|
*/
|
||||||
int indexOf(QWidget* w) const
|
int indexOf(QWidget* w) const
|
||||||
{
|
{
|
||||||
return m_Widgets.indexOf(w);
|
return m_Widgets.indexOf(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the widget for the given index
|
||||||
|
*/
|
||||||
QWidget* widget(int index) const
|
QWidget* widget(int index) const
|
||||||
{
|
{
|
||||||
return (index < m_Widgets.size()) ? m_Widgets.at(index) : nullptr;
|
return (index < m_Widgets.size()) ? m_Widgets.at(index) : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the geometry of the current active widget
|
||||||
|
*/
|
||||||
QRect geometry() const
|
QRect geometry() const
|
||||||
{
|
{
|
||||||
return m_Widgets.empty() ? QRect() : currentWidget()->geometry();
|
return m_Widgets.empty() ? QRect() : currentWidget()->geometry();
|
||||||
@ -254,12 +288,6 @@ struct DockAreaWidgetPrivate
|
|||||||
return DockWidget->property(INDEX_PROPERTY).toInt();
|
return DockWidget->property(INDEX_PROPERTY).toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Updates the tab bar visibility depending on the number of dock widgets
|
|
||||||
* in this area
|
|
||||||
*/
|
|
||||||
void updateTitleBarVisibility();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience function for tabbar access
|
* Convenience function for tabbar access
|
||||||
*/
|
*/
|
||||||
@ -293,19 +321,6 @@ void DockAreaWidgetPrivate::createTitleBar()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//============================================================================
|
|
||||||
void DockAreaWidgetPrivate::updateTitleBarVisibility()
|
|
||||||
{
|
|
||||||
CDockContainerWidget* Container = _this->dockContainer();
|
|
||||||
if (!Container)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
TitleBar->setVisible(!Container->isFloating() || !Container->hasTopLevelDockWidget());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
CDockAreaWidget::CDockAreaWidget(CDockManager* DockManager, CDockContainerWidget* parent) :
|
CDockAreaWidget::CDockAreaWidget(CDockManager* DockManager, CDockContainerWidget* parent) :
|
||||||
QFrame(parent),
|
QFrame(parent),
|
||||||
@ -402,7 +417,7 @@ void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
|
|||||||
hideAreaWithNoVisibleContent();
|
hideAreaWithNoVisibleContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
d->updateTitleBarVisibility();
|
updateTitleBarVisibility();
|
||||||
auto TopLevelDockWidget = dockContainer()->topLevelDockWidget();
|
auto TopLevelDockWidget = dockContainer()->topLevelDockWidget();
|
||||||
if (TopLevelDockWidget)
|
if (TopLevelDockWidget)
|
||||||
{
|
{
|
||||||
@ -440,7 +455,7 @@ void CDockAreaWidget::hideAreaWithNoVisibleContent()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->updateTitleBarVisibility();
|
updateTitleBarVisibility();
|
||||||
auto TopLevelWidget = Container->topLevelDockWidget();
|
auto TopLevelWidget = Container->topLevelDockWidget();
|
||||||
auto FloatingWidget = Container->floatingWidget();
|
auto FloatingWidget = Container->floatingWidget();
|
||||||
if (TopLevelWidget)
|
if (TopLevelWidget)
|
||||||
@ -626,14 +641,20 @@ void CDockAreaWidget::toggleDockWidgetView(CDockWidget* DockWidget, bool Open)
|
|||||||
{
|
{
|
||||||
Q_UNUSED(DockWidget);
|
Q_UNUSED(DockWidget);
|
||||||
Q_UNUSED(Open);
|
Q_UNUSED(Open);
|
||||||
updateTabBarVisibility();
|
updateTitleBarVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
void CDockAreaWidget::updateTabBarVisibility()
|
void CDockAreaWidget::updateTitleBarVisibility()
|
||||||
{
|
{
|
||||||
d->updateTitleBarVisibility();
|
CDockContainerWidget* Container = dockContainer();
|
||||||
|
if (!Container)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
d->TitleBar->setVisible(!Container->isFloating() || !Container->hasTopLevelDockWidget());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ protected:
|
|||||||
/**
|
/**
|
||||||
* Updates the dock area layout and components visibility
|
* Updates the dock area layout and components visibility
|
||||||
*/
|
*/
|
||||||
void updateTabBarVisibility();
|
void updateTitleBarVisibility();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the internal private function for setting the current widget.
|
* This is the internal private function for setting the current widget.
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QXmlStreamWriter>
|
#include <QXmlStreamWriter>
|
||||||
|
#include <QAbstractButton>
|
||||||
|
|
||||||
#include "DockManager.h"
|
#include "DockManager.h"
|
||||||
#include "DockAreaWidget.h"
|
#include "DockAreaWidget.h"
|
||||||
@ -105,6 +106,7 @@ public:
|
|||||||
bool isFloating = false;
|
bool isFloating = false;
|
||||||
CDockAreaWidget* LastAddedAreaCache[5]{0, 0, 0, 0, 0};
|
CDockAreaWidget* LastAddedAreaCache[5]{0, 0, 0, 0, 0};
|
||||||
int VisibleDockAreaCount = -1;
|
int VisibleDockAreaCount = -1;
|
||||||
|
CDockAreaWidget* TopLevelDockArea = nullptr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private data constructor
|
* Private data constructor
|
||||||
@ -144,6 +146,12 @@ public:
|
|||||||
*/
|
*/
|
||||||
void addDockAreasToList(const QList<CDockAreaWidget*> NewDockAreas);
|
void addDockAreasToList(const QList<CDockAreaWidget*> NewDockAreas);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper function for DockAreas append, that ensures that dock area signals
|
||||||
|
* are properly connected to dock container slots
|
||||||
|
*/
|
||||||
|
void appendDockAreas(const QList<CDockAreaWidget*> NewDockAreas);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save state of child nodes
|
* Save state of child nodes
|
||||||
*/
|
*/
|
||||||
@ -208,11 +216,31 @@ public:
|
|||||||
return VisibleDockAreaCount;
|
return VisibleDockAreaCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The visible dock area count changes, if dock areas are remove, added or
|
||||||
|
* when its view is toggled
|
||||||
|
*/
|
||||||
|
void onVisibleDockAreaCountChanged();
|
||||||
|
|
||||||
|
void emitDockAreasRemoved()
|
||||||
|
{
|
||||||
|
onVisibleDockAreaCountChanged();
|
||||||
|
emit _this->dockAreasRemoved();
|
||||||
|
}
|
||||||
|
|
||||||
|
void emitDockAreasAdded()
|
||||||
|
{
|
||||||
|
onVisibleDockAreaCountChanged();
|
||||||
|
emit _this->dockAreasAdded();
|
||||||
|
}
|
||||||
|
|
||||||
// private slots: ------------------------------------------------------------
|
// private slots: ------------------------------------------------------------
|
||||||
void onDockAreaViewToggled(bool Visible)
|
void onDockAreaViewToggled(bool Visible)
|
||||||
{
|
{
|
||||||
std::cout << "onDockAreaViewToggled " << Visible << std::endl;
|
CDockAreaWidget* DockArea = qobject_cast<CDockAreaWidget*>(_this->sender());
|
||||||
VisibleDockAreaCount += Visible ? 1 : -1;
|
VisibleDockAreaCount += Visible ? 1 : -1;
|
||||||
|
onVisibleDockAreaCountChanged();
|
||||||
|
emit _this->dockAreaViewToggled(DockArea, Visible);
|
||||||
}
|
}
|
||||||
}; // struct DockContainerWidgetPrivate
|
}; // struct DockContainerWidgetPrivate
|
||||||
|
|
||||||
@ -225,6 +253,24 @@ DockContainerWidgetPrivate::DockContainerWidgetPrivate(CDockContainerWidget* _pu
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================================
|
||||||
|
void DockContainerWidgetPrivate::onVisibleDockAreaCountChanged()
|
||||||
|
{
|
||||||
|
auto TopLevelDockArea = _this->topLevelDockArea();
|
||||||
|
|
||||||
|
if (TopLevelDockArea)
|
||||||
|
{
|
||||||
|
this->TopLevelDockArea = TopLevelDockArea;
|
||||||
|
TopLevelDockArea->titleBarButton(TitleBarButtonUndock)->setVisible(false || !_this->isFloating());
|
||||||
|
}
|
||||||
|
else if (this->TopLevelDockArea)
|
||||||
|
{
|
||||||
|
this->TopLevelDockArea->titleBarButton(TitleBarButtonUndock)->setVisible(true);
|
||||||
|
this->TopLevelDockArea = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
void DockContainerWidgetPrivate::dropIntoContainer(CFloatingDockContainer* FloatingWidget,
|
void DockContainerWidgetPrivate::dropIntoContainer(CFloatingDockContainer* FloatingWidget,
|
||||||
DockWidgetArea area)
|
DockWidgetArea area)
|
||||||
@ -299,7 +345,7 @@ void DockContainerWidgetPrivate::dropIntoSection(CFloatingDockContainer* Floatin
|
|||||||
}
|
}
|
||||||
TargetArea->setCurrentIndex(0); // make the topmost widget active
|
TargetArea->setCurrentIndex(0); // make the topmost widget active
|
||||||
FloatingWidget->deleteLater();
|
FloatingWidget->deleteLater();
|
||||||
TargetArea->updateTabBarVisibility();
|
TargetArea->updateTitleBarVisibility();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,21 +410,39 @@ void DockContainerWidgetPrivate::addDockAreasToList(const QList<CDockAreaWidget*
|
|||||||
{
|
{
|
||||||
int CountBefore = DockAreas.count();
|
int CountBefore = DockAreas.count();
|
||||||
int NewAreaCount = NewDockAreas.count();
|
int NewAreaCount = NewDockAreas.count();
|
||||||
DockAreas.append(NewDockAreas);
|
appendDockAreas(NewDockAreas);
|
||||||
|
// If the user dropped a floating widget that contains only one single
|
||||||
|
// visible dock area, then its title bar button TitleBarButtonUndock is
|
||||||
|
// likely hidden. We need to ensure, that it is visible
|
||||||
|
for (auto DockArea : NewDockAreas)
|
||||||
|
{
|
||||||
|
DockArea->titleBarButton(TitleBarButtonUndock)->setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
// We need to ensure, that the dock area title bar is visible. The title bar
|
// We need to ensure, that the dock area title bar is visible. The title bar
|
||||||
// is invisible, if the dock are is a single dock area in a floating widget.
|
// is invisible, if the dock are is a single dock area in a floating widget.
|
||||||
if (1 == CountBefore)
|
if (1 == CountBefore)
|
||||||
{
|
{
|
||||||
DockAreas.at(0)->updateTabBarVisibility();
|
DockAreas.at(0)->updateTitleBarVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (1 == NewAreaCount)
|
if (1 == NewAreaCount)
|
||||||
{
|
{
|
||||||
DockAreas.last()->updateTabBarVisibility();
|
DockAreas.last()->updateTitleBarVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
emit _this->dockAreasAdded();
|
emitDockAreasAdded();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================================
|
||||||
|
void DockContainerWidgetPrivate::appendDockAreas(const QList<CDockAreaWidget*> NewDockAreas)
|
||||||
|
{
|
||||||
|
DockAreas.append(NewDockAreas);
|
||||||
|
for (auto DockArea : NewDockAreas)
|
||||||
|
{
|
||||||
|
_this->connect(DockArea, SIGNAL(viewToggled(bool)), SLOT(onDockAreaViewToggled(bool)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -588,7 +652,7 @@ bool DockContainerWidgetPrivate::restoreDockArea(QXmlStreamReader& s,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
DockArea->setProperty("currentDockWidget", CurrentDockWidget);
|
DockArea->setProperty("currentDockWidget", CurrentDockWidget);
|
||||||
DockAreas.append(DockArea);
|
appendDockAreas({DockArea});
|
||||||
}
|
}
|
||||||
|
|
||||||
CreatedWidget = DockArea;
|
CreatedWidget = DockArea;
|
||||||
@ -631,7 +695,7 @@ CDockAreaWidget* DockContainerWidgetPrivate::dockWidgetIntoContainer(DockWidgetA
|
|||||||
CDockAreaWidget* NewDockArea = new CDockAreaWidget(DockManager, _this);
|
CDockAreaWidget* NewDockArea = new CDockAreaWidget(DockManager, _this);
|
||||||
NewDockArea->addDockWidget(Dockwidget);
|
NewDockArea->addDockWidget(Dockwidget);
|
||||||
addDockArea(NewDockArea, area);
|
addDockArea(NewDockArea, area);
|
||||||
NewDockArea->updateTabBarVisibility();
|
NewDockArea->updateTitleBarVisibility();
|
||||||
LastAddedAreaCache[areaIdToIndex(area)] = NewDockArea;
|
LastAddedAreaCache[areaIdToIndex(area)] = NewDockArea;
|
||||||
return NewDockArea;
|
return NewDockArea;
|
||||||
}
|
}
|
||||||
@ -673,9 +737,9 @@ void DockContainerWidgetPrivate::addDockArea(CDockAreaWidget* NewDockArea, DockW
|
|||||||
RootSplitter = NewSplitter;
|
RootSplitter = NewSplitter;
|
||||||
}
|
}
|
||||||
|
|
||||||
DockAreas.append(NewDockArea);
|
appendDockAreas({NewDockArea});
|
||||||
NewDockArea->updateTabBarVisibility();
|
NewDockArea->updateTitleBarVisibility();
|
||||||
emit _this->dockAreasAdded();
|
emitDockAreasAdded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -744,8 +808,8 @@ CDockAreaWidget* DockContainerWidgetPrivate::dockWidgetIntoDockArea(DockWidgetAr
|
|||||||
TargetAreaSplitter->insertWidget(index, NewSplitter);
|
TargetAreaSplitter->insertWidget(index, NewSplitter);
|
||||||
}
|
}
|
||||||
|
|
||||||
DockAreas.append(NewDockArea);
|
appendDockAreas({NewDockArea});
|
||||||
emit _this->dockAreasAdded();
|
emitDockAreasAdded();
|
||||||
return NewDockArea;
|
return NewDockArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -853,6 +917,7 @@ void CDockContainerWidget::addDockArea(CDockAreaWidget* DockAreaWidget,
|
|||||||
void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
|
void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
|
||||||
{
|
{
|
||||||
qDebug() << "CDockContainerWidget::removeDockArea";
|
qDebug() << "CDockContainerWidget::removeDockArea";
|
||||||
|
area->disconnect(this);
|
||||||
d->DockAreas.removeAll(area);
|
d->DockAreas.removeAll(area);
|
||||||
CDockSplitter* Splitter = internal::findParent<CDockSplitter*>(area);
|
CDockSplitter* Splitter = internal::findParent<CDockSplitter*>(area);
|
||||||
|
|
||||||
@ -913,7 +978,7 @@ emitAndExit:
|
|||||||
// one single visible dock widget
|
// one single visible dock widget
|
||||||
CDockWidget::emitTopLevelEventForWidget(TopLevelWidget, true);
|
CDockWidget::emitTopLevelEventForWidget(TopLevelWidget, true);
|
||||||
dumpLayout();
|
dumpLayout();
|
||||||
emit dockAreasRemoved();
|
d->emitDockAreasRemoved();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -240,6 +240,12 @@ signals:
|
|||||||
* This signal is emitted if one or multiple dock areas has been removed
|
* This signal is emitted if one or multiple dock areas has been removed
|
||||||
*/
|
*/
|
||||||
void dockAreasRemoved();
|
void dockAreasRemoved();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This signal is emitted if a dock area is opened or closed via
|
||||||
|
* toggleView() function
|
||||||
|
*/
|
||||||
|
void dockAreaViewToggled(CDockAreaWidget* DockArea, bool Open);
|
||||||
}; // class DockContainerWidget
|
}; // class DockContainerWidget
|
||||||
} // namespace ads
|
} // namespace ads
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -643,7 +643,7 @@ void CDockWidget::emitTopLevelEventForWidget(CDockWidget* TopLevelDockWidget, bo
|
|||||||
{
|
{
|
||||||
if (TopLevelDockWidget)
|
if (TopLevelDockWidget)
|
||||||
{
|
{
|
||||||
TopLevelDockWidget->dockAreaWidget()->updateTabBarVisibility();
|
TopLevelDockWidget->dockAreaWidget()->updateTitleBarVisibility();
|
||||||
TopLevelDockWidget->emitTopLevelChanged(Floating);
|
TopLevelDockWidget->emitTopLevelChanged(Floating);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -351,13 +351,13 @@ void CFloatingDockContainer::showEvent(QShowEvent *event)
|
|||||||
{
|
{
|
||||||
std::cout << "CFloatingDockContainer showEvent" << std::endl;
|
std::cout << "CFloatingDockContainer showEvent" << std::endl;
|
||||||
QWidget::showEvent(event);
|
QWidget::showEvent(event);
|
||||||
for (auto DockArea : d->DockContainer->openedDockAreas())
|
/*for (auto DockArea : d->DockContainer->openedDockAreas())
|
||||||
{
|
{
|
||||||
for (auto DockWidget : DockArea->openedDockWidgets())
|
for (auto DockWidget : DockArea->openedDockWidgets())
|
||||||
{
|
{
|
||||||
DockWidget->setToggleViewActionChecked(true);
|
DockWidget->setToggleViewActionChecked(true);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -467,12 +467,10 @@ bool CFloatingDockContainer::isClosable() const
|
|||||||
void CFloatingDockContainer::onDockAreasAddedOrRemoved()
|
void CFloatingDockContainer::onDockAreasAddedOrRemoved()
|
||||||
{
|
{
|
||||||
qDebug() << "CFloatingDockContainer::onDockAreasAddedOrRemoved()";
|
qDebug() << "CFloatingDockContainer::onDockAreasAddedOrRemoved()";
|
||||||
std::cout << "CFloatingDockContainer::onDockAreasAddedOrRemoved()" << std::endl;
|
|
||||||
auto TopLevelDockArea = d->DockContainer->topLevelDockArea();
|
auto TopLevelDockArea = d->DockContainer->topLevelDockArea();
|
||||||
if (TopLevelDockArea)
|
if (TopLevelDockArea)
|
||||||
{
|
{
|
||||||
d->SingleDockArea = TopLevelDockArea;
|
d->SingleDockArea = TopLevelDockArea;
|
||||||
d->SingleDockArea->titleBarButton(TitleBarButtonUndock)->setVisible(false);
|
|
||||||
this->setWindowTitle(d->SingleDockArea->currentDockWidget()->windowTitle());
|
this->setWindowTitle(d->SingleDockArea->currentDockWidget()->windowTitle());
|
||||||
connect(d->SingleDockArea, SIGNAL(currentChanged(int)), this,
|
connect(d->SingleDockArea, SIGNAL(currentChanged(int)), this,
|
||||||
SLOT(onDockAreaCurrentChanged(int)));
|
SLOT(onDockAreaCurrentChanged(int)));
|
||||||
@ -481,7 +479,6 @@ void CFloatingDockContainer::onDockAreasAddedOrRemoved()
|
|||||||
{
|
{
|
||||||
if (d->SingleDockArea)
|
if (d->SingleDockArea)
|
||||||
{
|
{
|
||||||
d->SingleDockArea->titleBarButton(TitleBarButtonUndock)->setVisible(true);
|
|
||||||
disconnect(d->SingleDockArea, SIGNAL(currentChanged(int)), this,
|
disconnect(d->SingleDockArea, SIGNAL(currentChanged(int)), this,
|
||||||
SLOT(onDockAreaCurrentChanged(int)));
|
SLOT(onDockAreaCurrentChanged(int)));
|
||||||
d->SingleDockArea = nullptr;
|
d->SingleDockArea = nullptr;
|
||||||
|
122
src/images/close-button-disabled.svg
Normal file
122
src/images/close-button-disabled.svg
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
version="1.1"
|
||||||
|
id="Capa_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
width="512"
|
||||||
|
height="512"
|
||||||
|
viewBox="0 0 512 512"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:docname="close-button-disabled.svg"
|
||||||
|
inkscape:version="0.92.3 (2405546, 2018-03-11)"><metadata
|
||||||
|
id="metadata897"><rdf:RDF><cc:Work
|
||||||
|
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||||
|
id="defs895" /><sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1017"
|
||||||
|
id="namedview893"
|
||||||
|
showgrid="false"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0"
|
||||||
|
inkscape:zoom="0.85862966"
|
||||||
|
inkscape:cx="345.29142"
|
||||||
|
inkscape:cy="32.731258"
|
||||||
|
inkscape:window-x="-8"
|
||||||
|
inkscape:window-y="-8"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="Capa_1" />
|
||||||
|
<g
|
||||||
|
id="g860"
|
||||||
|
transform="matrix(0.71708683,0,0,0.71708683,128,128)"
|
||||||
|
style="stroke:none;stroke-opacity:1;fill:#000000;fill-opacity:0.50196081">
|
||||||
|
<g
|
||||||
|
id="close"
|
||||||
|
style="stroke:none;stroke-opacity:1;fill:#000000;fill-opacity:0.50196081">
|
||||||
|
<polygon
|
||||||
|
points="357,321.3 214.2,178.5 357,35.7 321.3,0 178.5,142.8 35.7,0 0,35.7 142.8,178.5 0,321.3 35.7,357 178.5,214.2 321.3,357 "
|
||||||
|
id="polygon857"
|
||||||
|
style="stroke:none;stroke-opacity:1;fill:#000000;fill-opacity:0.50196081" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g862"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g864"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g866"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g868"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g870"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g872"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g874"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g876"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g878"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g880"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g882"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g884"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g886"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g888"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g890"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.9 KiB |
119
src/images/close-button.svg
Normal file
119
src/images/close-button.svg
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
version="1.1"
|
||||||
|
id="Capa_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
width="512"
|
||||||
|
height="512"
|
||||||
|
viewBox="0 0 512 512"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:docname="close-button.svg"
|
||||||
|
inkscape:version="0.92.3 (2405546, 2018-03-11)"><metadata
|
||||||
|
id="metadata897"><rdf:RDF><cc:Work
|
||||||
|
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||||
|
id="defs895" /><sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1017"
|
||||||
|
id="namedview893"
|
||||||
|
showgrid="false"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0"
|
||||||
|
inkscape:zoom="0.85862966"
|
||||||
|
inkscape:cx="345.29142"
|
||||||
|
inkscape:cy="32.731258"
|
||||||
|
inkscape:window-x="-8"
|
||||||
|
inkscape:window-y="-8"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="Capa_1" />
|
||||||
|
<g
|
||||||
|
id="g860"
|
||||||
|
transform="matrix(0.71708683,0,0,0.71708683,128,128)">
|
||||||
|
<g
|
||||||
|
id="close">
|
||||||
|
<polygon
|
||||||
|
points="357,321.3 214.2,178.5 357,35.7 321.3,0 178.5,142.8 35.7,0 0,35.7 142.8,178.5 0,321.3 35.7,357 178.5,214.2 321.3,357 "
|
||||||
|
id="polygon857" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g862"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g864"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g866"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g868"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g870"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g872"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g874"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g876"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g878"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g880"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g882"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g884"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g886"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g888"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g890"
|
||||||
|
transform="translate(0,155)">
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
Loading…
Reference in New Issue
Block a user