From: vsv Date: Mon, 27 May 2019 15:01:03 +0000 (+0300) Subject: Prevent resizing of property panel on an operation launch. X-Git-Tag: VEDF2019Lot4~101^2~61 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=67d68923b05fa281c6a3b2e74439cc6270807981;p=modules%2Fshaper.git Prevent resizing of property panel on an operation launch. --- diff --git a/src/XGUI/XGUI_ObjectsBrowser.cpp b/src/XGUI/XGUI_ObjectsBrowser.cpp index 913d35eef..44858157f 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.cpp +++ b/src/XGUI/XGUI_ObjectsBrowser.cpp @@ -727,3 +727,10 @@ void XGUI_ObjectsBrowser::setFoldersState(const QMap& theStates myTreeView->setExpanded(aIdx, aIt.value()); } } + + +void XGUI_ObjectsBrowser::resizeEvent(QResizeEvent* theEvent) +{ + QWidget::resizeEvent(theEvent); + emit sizeChanged(); +} diff --git a/src/XGUI/XGUI_ObjectsBrowser.h b/src/XGUI/XGUI_ObjectsBrowser.h index 1f43c899c..6be4b39da 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.h +++ b/src/XGUI/XGUI_ObjectsBrowser.h @@ -237,6 +237,15 @@ signals: //! Segnal is emitted when user cliks by mouse in header label of object browser void headerMouseDblClicked(const QModelIndex&); + //! An signal emitted on resize of the Object Browser + void sizeChanged(); + + +protected: + //! redefinition of a virtual method + void resizeEvent(QResizeEvent* theEvent); + + private slots: /// Show context menu /// \param theEvent a context menu event diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index b4a0eb3b1..d54412c59 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1394,8 +1394,7 @@ QDockWidget* XGUI_Workshop::createObjectBrowser(QWidget* theParent) { QDockWidget* aObjDock = new QDockWidget(theParent); aObjDock->setAllowedAreas(Qt::LeftDockWidgetArea | - Qt::RightDockWidgetArea | - Qt::BottomDockWidgetArea); + Qt::RightDockWidgetArea); aObjDock->setWindowTitle(tr("Object browser")); aObjDock->setStyleSheet( "::title { position: relative; padding-left: 5px; text-align: left center }"); @@ -1404,6 +1403,8 @@ QDockWidget* XGUI_Workshop::createObjectBrowser(QWidget* theParent) myModule->customizeObjectBrowser(myObjectBrowser); aObjDock->setWidget(myObjectBrowser); + connect(myObjectBrowser, SIGNAL(sizeChanged()), SLOT(onDockSizeChanged())); + myContextMenuMgr->connectObjectBrowser(); return aObjDock; } @@ -1423,9 +1424,9 @@ void XGUI_Workshop::createDockWidgets() myPropertyPanel->setupActions(myActionsMgr); myPropertyPanel->setAllowedAreas(Qt::LeftDockWidgetArea | - Qt::RightDockWidgetArea | - Qt::BottomDockWidgetArea); + Qt::RightDockWidgetArea); aDesktop->addDockWidget(Qt::LeftDockWidgetArea, myPropertyPanel); + hidePanel(myPropertyPanel); ///(myObjectBrowser->parentWidget()); + int aObWidth = aDockWgt->size().width(); + if (myPropertyPanel->width() != aObWidth) { + QList aWgtList; + aWgtList << myPropertyPanel << aDockWgt; + QList aSizeList; + aSizeList << aObWidth << aObWidth; + desktop()->resizeDocks(aWgtList, aSizeList, Qt::Horizontal); + disconnect(myObjectBrowser, SIGNAL(sizeChanged()), this, SLOT(onDockSizeChanged())); + } +} diff --git a/src/XGUI/XGUI_Workshop.h b/src/XGUI/XGUI_Workshop.h index 01c75a373..e7da8532d 100644 --- a/src/XGUI/XGUI_Workshop.h +++ b/src/XGUI/XGUI_Workshop.h @@ -477,6 +477,9 @@ private: /// Called on help button clicked in the property panel. void onHelpActionClicked(); + //! The slot is called only once on resizing of Object Browser + void onDockSizeChanged(); + private: /// Init menu void initMenu();