diff --git a/src/AutoHideDockContainer.cpp b/src/AutoHideDockContainer.cpp index 41f5c2e..ac7da00 100644 --- a/src/AutoHideDockContainer.cpp +++ b/src/AutoHideDockContainer.cpp @@ -314,7 +314,6 @@ void CAutoHideDockContainer::addDockWidget(CDockWidget* DockWidget) } d->DockArea->addDockWidget(DockWidget); d->DockWidget->sideTabWidget()->updateOrientationAndSpacing(d->SideTabBarArea); - qDebug() << "DockWidget->size(): " << DockWidget->size(); // The initial size should be a little bit bigger than the original dock // area size to prevent that the resize handle of this auto hid dock area // is near of the splitter of the old dock area. @@ -454,7 +453,7 @@ void CAutoHideDockContainer::collapseView(bool Enable) qApp->installEventFilter(this); } - qDebug() << "CAutoHideDockContainer::collapseView " << Enable; + ADS_PRINT("CAutoHideDockContainer::collapseView " << Enable); d->DockWidget->sideTabWidget()->updateStyle(); } diff --git a/src/DockContainerWidget.cpp b/src/DockContainerWidget.cpp index 52f28a9..27ac1ce 100644 --- a/src/DockContainerWidget.cpp +++ b/src/DockContainerWidget.cpp @@ -2098,29 +2098,27 @@ void CDockContainerWidget::createRootSplitter() void CDockContainerWidget::createSideTabBarWidgets() { { - auto leftLayout = new QVBoxLayout(); - d->SideTabBarWidgets[CDockWidgetSideTab::Left] = new CSideTabBar(this, Qt::Vertical); - leftLayout->addWidget(d->SideTabBarWidgets[CDockWidgetSideTab::Left]); - leftLayout->addStretch(1); - d->Layout->addLayout(leftLayout, 1, 0); + auto Area = CDockWidgetSideTab::Left; + d->SideTabBarWidgets[Area] = new CSideTabBar(this, Area); + d->Layout->addWidget(d->SideTabBarWidgets[Area], 1, 0); } { - auto rightLayout = new QVBoxLayout(); - d->SideTabBarWidgets[CDockWidgetSideTab::Right] = new CSideTabBar(this, Qt::Vertical); - rightLayout->addWidget(d->SideTabBarWidgets[CDockWidgetSideTab::Right]); - rightLayout->addStretch(1); - d->Layout->addLayout(rightLayout, 1, 2); + auto Area = CDockWidgetSideTab::Right; + d->SideTabBarWidgets[Area] = new CSideTabBar(this, Area); + d->Layout->addWidget(d->SideTabBarWidgets[Area], 1, 2); } { - d->SideTabBarWidgets[CDockWidgetSideTab::Bottom] = new CSideTabBar(this, Qt::Horizontal); - d->Layout->addWidget(d->SideTabBarWidgets[CDockWidgetSideTab::Bottom], 2, 1); + auto Area = CDockWidgetSideTab::Bottom; + d->SideTabBarWidgets[Area] = new CSideTabBar(this, Area); + d->Layout->addWidget(d->SideTabBarWidgets[Area], 2, 1); } { - d->SideTabBarWidgets[CDockWidgetSideTab::Top] = new CSideTabBar(this, Qt::Horizontal); - d->Layout->addWidget(d->SideTabBarWidgets[CDockWidgetSideTab::Top], 0, 1); + auto Area = CDockWidgetSideTab::Top; + d->SideTabBarWidgets[Area] = new CSideTabBar(this, Area); + d->Layout->addWidget(d->SideTabBarWidgets[Area], 0, 1); } } diff --git a/src/DockWidgetSideTab.cpp b/src/DockWidgetSideTab.cpp index ddea195..41000e0 100644 --- a/src/DockWidgetSideTab.cpp +++ b/src/DockWidgetSideTab.cpp @@ -122,16 +122,24 @@ CDockWidgetSideTab::SideTabBarArea CDockWidgetSideTab::sideTabBarArea() const return Left; } + //============================================================================ void CDockWidgetSideTab::setOrientation(Qt::Orientation Orientation) { d->Orientation = Orientation; - CPushButton::setOrientation((Qt::Horizontal == Orientation) + CPushButton::setButtonOrientation((Qt::Horizontal == Orientation) ? CPushButton::Horizontal : CPushButton::VerticalTopToBottom); updateStyle(); } +//============================================================================ +Qt::Orientation CDockWidgetSideTab::orientation() const +{ + return d->Orientation; +} + + //============================================================================ void CDockWidgetSideTab::updateOrientationAndSpacing(SideTabBarArea area) { diff --git a/src/DockWidgetSideTab.h b/src/DockWidgetSideTab.h index f307f37..6668ff4 100644 --- a/src/DockWidgetSideTab.h +++ b/src/DockWidgetSideTab.h @@ -51,6 +51,7 @@ class ADS_EXPORT CDockWidgetSideTab : public CPushButton Q_OBJECT Q_PROPERTY(SideTabBarArea sideTabBarArea READ sideTabBarArea) + Q_PROPERTY(Qt::Orientation orientation READ orientation) Q_PROPERTY(bool activeTab READ isActiveTab) private: @@ -109,6 +110,11 @@ public: */ void setOrientation(Qt::Orientation Orientation); + /** + * Returns the current orientation + */ + Qt::Orientation orientation() const; + /** * Update the orientation, visibility and spacing based on the area and the config */ diff --git a/src/PushButton.cpp b/src/PushButton.cpp index e88a500..9d6faa5 100644 --- a/src/PushButton.cpp +++ b/src/PushButton.cpp @@ -54,12 +54,12 @@ void CPushButton::paintEvent(QPaintEvent *event) painter.drawControl(QStyle::CE_PushButton, option); } -CPushButton::Orientation CPushButton::orientation() const +CPushButton::Orientation CPushButton::buttonOrientation() const { return m_Orientation; } -void CPushButton::setOrientation(Orientation orientation) +void CPushButton::setButtonOrientation(Orientation orientation) { m_Orientation = orientation; } diff --git a/src/PushButton.h b/src/PushButton.h index e375d20..5c4ac7e 100644 --- a/src/PushButton.h +++ b/src/PushButton.h @@ -37,12 +37,12 @@ public: /** * Returns the current orientation */ - Orientation orientation() const; + Orientation buttonOrientation() const; /** * Set the orientation of this button */ - void setOrientation(Orientation orientation); + void setButtonOrientation(Orientation orientation); protected: virtual void paintEvent(QPaintEvent *event) override;