mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 07:31:33 +08:00
Added DockAreaHasTabsMenuButton and DockAreaHasUndockButton to CDockManager config (#108)
* Added DockAreaHasUndockButton and DockAreaHasTabsMenuButton configuration flag
This commit is contained in:
parent
1dbd3f3f06
commit
1d68e27558
@ -418,12 +418,19 @@ CMainWindow::CMainWindow(QWidget *parent) :
|
|||||||
// comment the following line if you want to use opaque undocking and
|
// comment the following line if you want to use opaque undocking and
|
||||||
// opaque splitter resizing
|
// opaque splitter resizing
|
||||||
CDockManager::setConfigFlags(CDockManager::DefaultNonOpaqueConfig);
|
CDockManager::setConfigFlags(CDockManager::DefaultNonOpaqueConfig);
|
||||||
//CDockManager::setConfigFlag(CDockManager::DockAreaHasCloseButton, false);
|
|
||||||
|
|
||||||
// uncomment the following line if you want a fixed tab width that does
|
// uncomment the following line if you want a fixed tab width that does
|
||||||
// not change if the visibility of the close button changes
|
// not change if the visibility of the close button changes
|
||||||
//CDockManager::setConfigFlag(CDockManager::RetainTabSizeWhenCloseButtonHidden, true);
|
//CDockManager::setConfigFlag(CDockManager::RetainTabSizeWhenCloseButtonHidden, true);
|
||||||
|
|
||||||
|
// uncomment the following line if you don't want close button on DockArea's title bar
|
||||||
|
//CDockManager::setConfigFlag(CDockManager::DockAreaHasCloseButton, false);
|
||||||
|
|
||||||
|
// uncomment the following line if you don't want undock button on DockArea's title bar
|
||||||
|
//CDockManager::setConfigFlag(CDockManager::DockAreaHasUndockButton, false);
|
||||||
|
|
||||||
|
// uncomment the following line if you don't want tabs menu button on DockArea's title bar
|
||||||
|
//CDockManager::setConfigFlag(CDockManager::DockAreaHasTabsMenuButton, false);
|
||||||
|
|
||||||
// Now create the dock manager and its content
|
// Now create the dock manager and its content
|
||||||
d->DockManager = new CDockManager(this);
|
d->DockManager = new CDockManager(this);
|
||||||
|
@ -167,6 +167,9 @@ DockAreaTitleBarPrivate::DockAreaTitleBarPrivate(CDockAreaTitleBar* _public) :
|
|||||||
void DockAreaTitleBarPrivate::createButtons()
|
void DockAreaTitleBarPrivate::createButtons()
|
||||||
{
|
{
|
||||||
QSizePolicy ButtonSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
|
QSizePolicy ButtonSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
|
||||||
|
|
||||||
|
if (testConfigFlag(CDockManager::DockAreaHasTabsMenuButton))
|
||||||
|
{
|
||||||
// Tabs menu button
|
// Tabs menu button
|
||||||
TabsMenuButton = new tTitleBarButton();
|
TabsMenuButton = new tTitleBarButton();
|
||||||
TabsMenuButton->setObjectName("tabsMenuButton");
|
TabsMenuButton->setObjectName("tabsMenuButton");
|
||||||
@ -186,8 +189,15 @@ void DockAreaTitleBarPrivate::createButtons()
|
|||||||
TopLayout->addWidget(TabsMenuButton, 0);
|
TopLayout->addWidget(TabsMenuButton, 0);
|
||||||
_this->connect(TabsMenuButton->menu(), SIGNAL(triggered(QAction*)),
|
_this->connect(TabsMenuButton->menu(), SIGNAL(triggered(QAction*)),
|
||||||
SLOT(onTabsMenuActionTriggered(QAction*)));
|
SLOT(onTabsMenuActionTriggered(QAction*)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TabsMenuButton = new CInvisibleButton();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (testConfigFlag(CDockManager::DockAreaHasUndockButton))
|
||||||
|
{
|
||||||
// Undock button
|
// Undock button
|
||||||
UndockButton = new tTitleBarButton();
|
UndockButton = new tTitleBarButton();
|
||||||
UndockButton->setObjectName("undockButton");
|
UndockButton->setObjectName("undockButton");
|
||||||
@ -199,6 +209,11 @@ void DockAreaTitleBarPrivate::createButtons()
|
|||||||
UndockButton->setSizePolicy(ButtonSizePolicy);
|
UndockButton->setSizePolicy(ButtonSizePolicy);
|
||||||
TopLayout->addWidget(UndockButton, 0);
|
TopLayout->addWidget(UndockButton, 0);
|
||||||
_this->connect(UndockButton, SIGNAL(clicked()), SLOT(onUndockButtonClicked()));
|
_this->connect(UndockButton, SIGNAL(clicked()), SLOT(onUndockButtonClicked()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UndockButton = new CInvisibleButton();
|
||||||
|
}
|
||||||
|
|
||||||
if (testConfigFlag(CDockManager::DockAreaHasCloseButton))
|
if (testConfigFlag(CDockManager::DockAreaHasCloseButton))
|
||||||
{
|
{
|
||||||
|
@ -157,17 +157,25 @@ public:
|
|||||||
DragPreviewShowsContentPixmap = 0x0800,///< If opaque undocking is disabled, the created drag preview window shows a copy of the content of the dock widget / dock are that is dragged
|
DragPreviewShowsContentPixmap = 0x0800,///< If opaque undocking is disabled, the created drag preview window shows a copy of the content of the dock widget / dock are that is dragged
|
||||||
DragPreviewHasWindowFrame = 0x1000,///< If opaque undocking is disabled, then this flag configures if the drag preview is frameless or looks like a real window
|
DragPreviewHasWindowFrame = 0x1000,///< If opaque undocking is disabled, then this flag configures if the drag preview is frameless or looks like a real window
|
||||||
AlwaysShowTabs = 0x2000,///< If this option is enabled, the tab of a dock widget is always displayed - even if it is the only visible dock widget in a floating widget.
|
AlwaysShowTabs = 0x2000,///< If this option is enabled, the tab of a dock widget is always displayed - even if it is the only visible dock widget in a floating widget.
|
||||||
|
DockAreaHasUndockButton = 0x4000, //!< If the flag is set each dock area has an undock button
|
||||||
|
DockAreaHasTabsMenuButton = 0x8000, //!< If the flag is set each dock area has a tabs menu button
|
||||||
DefaultConfig = ActiveTabHasCloseButton
|
DefaultConfig = ActiveTabHasCloseButton
|
||||||
| DockAreaHasCloseButton
|
| DockAreaHasCloseButton
|
||||||
|
| DockAreaHasUndockButton
|
||||||
|
| DockAreaHasTabsMenuButton
|
||||||
| OpaqueSplitterResize
|
| OpaqueSplitterResize
|
||||||
| XmlCompressionEnabled
|
| XmlCompressionEnabled
|
||||||
| OpaqueUndocking, ///< the default configuration
|
| OpaqueUndocking, ///< the default configuration
|
||||||
DefaultNonOpaqueConfig = ActiveTabHasCloseButton
|
DefaultNonOpaqueConfig = ActiveTabHasCloseButton
|
||||||
| DockAreaHasCloseButton
|
| DockAreaHasCloseButton
|
||||||
|
| DockAreaHasUndockButton
|
||||||
|
| DockAreaHasTabsMenuButton
|
||||||
| XmlCompressionEnabled
|
| XmlCompressionEnabled
|
||||||
| DragPreviewShowsContentPixmap, ///< the default configuration for non opaque operations
|
| DragPreviewShowsContentPixmap, ///< the default configuration for non opaque operations
|
||||||
NonOpaqueWithWindowFrame = ActiveTabHasCloseButton
|
NonOpaqueWithWindowFrame = ActiveTabHasCloseButton
|
||||||
| DockAreaHasCloseButton
|
| DockAreaHasCloseButton
|
||||||
|
| DockAreaHasUndockButton
|
||||||
|
| DockAreaHasTabsMenuButton
|
||||||
| XmlCompressionEnabled
|
| XmlCompressionEnabled
|
||||||
| DragPreviewShowsContentPixmap
|
| DragPreviewShowsContentPixmap
|
||||||
| DragPreviewHasWindowFrame ///< the default configuration for non opaque operations that show a real window with frame
|
| DragPreviewHasWindowFrame ///< the default configuration for non opaque operations that show a real window with frame
|
||||||
|
Loading…
Reference in New Issue
Block a user