]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
#1189 Tab - Cancel - Enter validate not cancel: In case of disabled Apply button...
authornds <nds@opencascade.com>
Sat, 26 Dec 2015 16:54:01 +0000 (19:54 +0300)
committernds <nds@opencascade.com>
Sat, 26 Dec 2015 16:54:01 +0000 (19:54 +0300)
src/XGUI/XGUI_PropertyPanel.cpp

index 2902755d4ef9dd9e2d2f3160474aa3fcf9524dd7..e298bd0308d8ef87649ce877809adfc968beeb49 100755 (executable)
@@ -247,9 +247,6 @@ void findDirectChildren(QWidget* theParent, QList<QWidget*>& theWidgets, const b
 
 bool XGUI_PropertyPanel::focusNextPrevChild(bool theIsNext)
 {
-  //bool isChangedFocus = ModuleBase_IPropertyPanel::focusNextPrevChild(theIsNext);
-  //return true;//isChangedFocus;
-
   // it wraps the Tabs clicking to follow in the chain:
   // controls, last control, Apply, Cancel, first control, controls
   bool isChangedFocus = false;
@@ -273,7 +270,13 @@ bool XGUI_PropertyPanel::focusNextPrevChild(bool theIsNext)
         if (aFocusWidgetIndex == aChildrenCount-1) {
           // after the last widget focus should be set to "Apply"
           QToolButton* anOkBtn = findChild<QToolButton*>(PROP_PANEL_OK);
-          aNewFocusWidget = anOkBtn;
+          if (anOkBtn->isEnabled())
+            aNewFocusWidget = anOkBtn;
+          else {
+            QToolButton* aCancelBtn = findChild<QToolButton*>(PROP_PANEL_CANCEL);
+            if (aCancelBtn->isEnabled())
+              aNewFocusWidget = aCancelBtn;
+          }
         }
         else {
           aNewFocusWidget = aChildren[aFocusWidgetIndex+1];