From: nds Date: Sat, 26 Dec 2015 16:54:01 +0000 (+0300) Subject: #1189 Tab - Cancel - Enter validate not cancel: In case of disabled Apply button... X-Git-Tag: V_2.1.0~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=33fd24909f846d17557ec18aebdc6ac4d34f45f8;p=modules%2Fshaper.git #1189 Tab - Cancel - Enter validate not cancel: In case of disabled Apply button, set focus to the Cancel --- diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index 2902755d4..e298bd030 100755 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -247,9 +247,6 @@ void findDirectChildren(QWidget* theParent, QList& 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(PROP_PANEL_OK); - aNewFocusWidget = anOkBtn; + if (anOkBtn->isEnabled()) + aNewFocusWidget = anOkBtn; + else { + QToolButton* aCancelBtn = findChild(PROP_PANEL_CANCEL); + if (aCancelBtn->isEnabled()) + aNewFocusWidget = aCancelBtn; + } } else { aNewFocusWidget = aChildren[aFocusWidgetIndex+1];