From: asl Date: Tue, 18 Aug 2015 07:11:00 +0000 (+0300) Subject: Issue #810: hide "Edit" menu after undo/redo X-Git-Tag: V_1.4.0_beta4~364^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0d7b2fdd8c1656f38cb18741d7445cc529526035;p=modules%2Fshaper.git Issue #810: hide "Edit" menu after undo/redo --- diff --git a/src/XGUI/XGUI_HistoryMenu.cpp b/src/XGUI/XGUI_HistoryMenu.cpp index bfdae5390..5f1ee6fa8 100644 --- a/src/XGUI/XGUI_HistoryMenu.cpp +++ b/src/XGUI/XGUI_HistoryMenu.cpp @@ -82,9 +82,23 @@ void XGUI_HistoryMenu::setStackSelectedTo(QListWidgetItem * theItem) myHistoryList->repaint(); } +void hideUpToMenuBar( QMenu* theMenu ) +{ + theMenu->hide(); + foreach( QWidget* aWidget, theMenu->menuAction()->associatedWidgets() ) + { + QMenu* aMenu = qobject_cast( aWidget ); + if( aMenu ) + { + aMenu->hide(); + hideUpToMenuBar( aMenu ); + } + } +} + void XGUI_HistoryMenu::onItemPressed(QListWidgetItem * theItem) { int selectedSize = myHistoryList->row(theItem) + 1; emit actionSelected(selectedSize); - hide(); + hideUpToMenuBar( this ); }