/** * \brief Handle the resize event * @param event as the resize event */ void UBDockPalette::resizeEvent(QResizeEvent *event) { Q_UNUSED(event); updateMaxWidth(); if(parentWidget()) { setMinimumHeight(parentWidget()->height()); } // Set the position QPoint origin; switch(mOrientation) { case eUBDockOrientation_Right: origin.setX(parentWidget()->width() - this->width()); origin.setY(0); break; case eUBDockOrientation_Bottom: // Not supported yet case eUBDockOrientation_Top: // Not supported yet case eUBDockOrientation_Left: default: origin.setX(0); origin.setY(0); break; } move(origin.x(), origin.y()); moveTabs(); }
/** * \brief Show the given widget * @param widgetName as the given widget name */ void UBDockPalette::onShowTabWidget(UBDockPaletteWidget* widget) { if (mRegisteredWidgets.contains(widget)) { widget->setVisibleState(true); addTab(widget); moveTabs(); } }
/** * \brief Update the tab position regarding the toolbar position (up or down) */ void UBDockPalette::onToolbarPosUpdated() { // Get the position of the tab if(UBSettings::settings()->appToolBarPositionedAtTop->get().toBool()) { setTabsOrientation(eUBDockTabOrientation_Up); } else { setTabsOrientation(eUBDockTabOrientation_Down); } moveTabs(); update(); }