mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 21:25:44 +08:00
Removed code for disabling close button because this caused trouble, fixed updating of window title if dock area is removed
This commit is contained in:
parent
927be9a7d9
commit
81523b0346
@ -57,6 +57,7 @@
|
|||||||
#include "DockManager.h"
|
#include "DockManager.h"
|
||||||
#include "DockWidget.h"
|
#include "DockWidget.h"
|
||||||
#include "DockAreaWidget.h"
|
#include "DockAreaWidget.h"
|
||||||
|
#include "AnimatedLabel.h"
|
||||||
|
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
@ -281,6 +282,8 @@ CMainWindow::CMainWindow(QWidget *parent) :
|
|||||||
|
|
||||||
d->restoreState();
|
d->restoreState();
|
||||||
d->restorePerspectives();
|
d->restorePerspectives();
|
||||||
|
/*CAnimatedLabel* AnimatedLabel = new CAnimatedLabel();
|
||||||
|
AnimatedLabel->show();*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,15 +9,19 @@ CONFIG *= c++14
|
|||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
MainWindow.cpp
|
MainWindow.cpp \
|
||||||
|
AnimatedLabel.cpp
|
||||||
|
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
MainWindow.h
|
MainWindow.h \
|
||||||
|
AnimatedLabel.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
mainwindow.ui
|
mainwindow.ui
|
||||||
|
|
||||||
|
RESOURCES += main.qrc
|
||||||
|
|
||||||
LIBS += -L$${ADS_OUT_ROOT}/lib
|
LIBS += -L$${ADS_OUT_ROOT}/lib
|
||||||
|
|
||||||
# Dependency: AdvancedDockingSystem (shared)
|
# Dependency: AdvancedDockingSystem (shared)
|
||||||
|
@ -91,17 +91,6 @@ struct FloatingDockContainerPrivate
|
|||||||
{
|
{
|
||||||
DraggingState = StateId;
|
DraggingState = StateId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Disables the window close button if the content is not closable
|
|
||||||
*/
|
|
||||||
void disableCloseButton()
|
|
||||||
{
|
|
||||||
auto Flags = _this->windowFlags();
|
|
||||||
Flags |= Qt::CustomizeWindowHint;
|
|
||||||
Flags &= ~Qt::WindowCloseButtonHint;
|
|
||||||
_this->setWindowFlags(Flags);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
// struct FloatingDockContainerPrivate
|
// struct FloatingDockContainerPrivate
|
||||||
|
|
||||||
@ -261,10 +250,6 @@ CFloatingDockContainer::CFloatingDockContainer(CDockAreaWidget* DockArea) :
|
|||||||
CFloatingDockContainer(DockArea->dockManager())
|
CFloatingDockContainer(DockArea->dockManager())
|
||||||
{
|
{
|
||||||
d->DockContainer->addDockArea(DockArea);
|
d->DockContainer->addDockArea(DockArea);
|
||||||
if (!DockArea->features().testFlag(CDockWidget::DockWidgetClosable))
|
|
||||||
{
|
|
||||||
d->disableCloseButton();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -273,10 +258,6 @@ CFloatingDockContainer::CFloatingDockContainer(CDockWidget* DockWidget) :
|
|||||||
CFloatingDockContainer(DockWidget->dockManager())
|
CFloatingDockContainer(DockWidget->dockManager())
|
||||||
{
|
{
|
||||||
d->DockContainer->addDockWidget(CenterDockWidgetArea, DockWidget);
|
d->DockContainer->addDockWidget(CenterDockWidgetArea, DockWidget);
|
||||||
if (!DockWidget->features().testFlag(CDockWidget::DockWidgetClosable))
|
|
||||||
{
|
|
||||||
d->disableCloseButton();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
@ -499,9 +480,9 @@ bool CFloatingDockContainer::isClosable() const
|
|||||||
void CFloatingDockContainer::onDockAreasAddedOrRemoved()
|
void CFloatingDockContainer::onDockAreasAddedOrRemoved()
|
||||||
{
|
{
|
||||||
qDebug() << "CFloatingDockContainer::onDockAreasAddedOrRemoved()";
|
qDebug() << "CFloatingDockContainer::onDockAreasAddedOrRemoved()";
|
||||||
if (d->DockContainer->dockAreaCount() == 1)
|
if (d->DockContainer->visibleDockAreaCount() == 1)
|
||||||
{
|
{
|
||||||
d->SingleDockArea = d->DockContainer->dockArea(0);
|
d->SingleDockArea = topLevelDockWidget()->dockAreaWidget();
|
||||||
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)));
|
||||||
@ -534,10 +515,6 @@ bool CFloatingDockContainer::restoreState(QXmlStreamReader& Stream, bool Testing
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!d->DockContainer->features().testFlag(CDockWidget::DockWidgetClosable))
|
|
||||||
{
|
|
||||||
d->disableCloseButton();
|
|
||||||
}
|
|
||||||
onDockAreasAddedOrRemoved();
|
onDockAreasAddedOrRemoved();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user