]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Bug with shown scroll buttons in main menu is corrected
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 10 Apr 2014 11:56:23 +0000 (15:56 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 10 Apr 2014 11:56:23 +0000 (15:56 +0400)
src/XGUI/XGUI_Workbench.cpp
src/XGUI/XGUI_Workbench.h

index b3a1aee2b98d5db5c01e5ada92be46433ad7ec30..996d5a7aeffe9df3245cb776321c6d244a430dd2 100644 (file)
@@ -50,6 +50,7 @@ XGUI_Workbench::XGUI_Workbench(QWidget *theParent)
 
   myCommandsArea = new CommandsArea(this);
   aMainLayout->addWidget(myCommandsArea);
+  myCommandsArea->viewport()->installEventFilter(this);
 
   myChildWidget = new QWidget(myCommandsArea);
   myCommandsArea->setWidget(myChildWidget);
@@ -159,3 +160,14 @@ bool XGUI_Workbench::isExceedsRight()
   int aWgtWidth = myChildWidget->childrenRect().width();
   return ((aVPWidth - aPos.x()) < aWgtWidth);
 }
+
+bool XGUI_Workbench::eventFilter(QObject *theObj, QEvent *theEvent)
+{
+  if (theObj == myCommandsArea->viewport()) {
+    if (theEvent->type() == QEvent::Resize) {
+      myLeftButton->setVisible(isExceedsLeft());
+      myRightButton->setVisible(isExceedsRight());
+    }
+  }
+  return QWidget::eventFilter(theObj, theEvent);
+}
\ No newline at end of file
index cc362db2b10f9e6cc0e08240bc157079cf5c794f..57b17d3bea7a58a963685c8737058d4508b7078a 100644 (file)
@@ -27,6 +27,7 @@ private slots:
 
 protected:
   virtual void resizeEvent(QResizeEvent * theEvent);
+  virtual bool eventFilter(QObject *theObj, QEvent *theEvent);
 
 private:
   void addSeparator();