Commit da225ba4 authored by Steffen Michels's avatar Steffen Michels

Merge branch...

Merge branch '165-one-ok-button-too-many-in-palindrome-no-disabled-ok-button-when-it-is-not-a-palindrome-two-ok-buttons-when-it-is-a-palindrome' into 'master'

Fix disabledness of actions, Closes #165

Closes #165 and #164

See merge request !85
parents 97745aad e79ee5c2
......@@ -6,6 +6,7 @@ import iTasks.UI.Definition
import Text.JSON
import GenEq
from Data.Func import $
from StdFunc import id, o, const
import StdList, StdBool, StdArray, StdTuple, Data.Tuple, Data.Functor
import Data.List
......@@ -102,22 +103,28 @@ finalizeStep = sequenceAllLayouts
//If there are no actions, unwrap
,layoutSubUIs (ContainsNoChildOfType UIAction) (sequenceAllLayouts [copySubUIAttributes SelectAll [] [0], unwrapUI,finalizeUI])
//If the previous rule did not eliminate the UIStep
,layoutSubUIs RootIsStep
(sequenceAllLayouts [layoutSubUIs (SelectByPath [0]) finalizeUI, actionsToButtonBar,setUIType UIPanel])
,layoutSubUIs RootIsStep
$ sequenceAllLayouts
[layoutSubUIs (SelectByPath [0]) finalizeUI
,setUIType UIPanel]
removeDisabledActionsOfNestedSteps //Select all children of type UIstep
= layoutSubUIs (ContainsChildOfType UIStep)
[removeDisabledActions //Remove disabled actions
,layoutSubUIs (SelectAND SelectChildren (SelectByType UIStep)) removeDisabledActions //Recursively apply to the UIStep child
// Nested steps are steps having steps under them
= layoutSubUIs
(SelectAND // (Nested)
(SelectByType UIStep) // Steps (are steps)
$ SelectByContains // having
$ SelectAND
(SelectByType UIStep) // steps
SelectDescendents) // under them
= removeSubUIs (SelectAND SelectChildren (SelectAND (SelectByType UIAction) (SelectByAttribute "enabled" (JSONBool False))))
ContainsChildOfType type =SelectAND (SelectByPath []) (SelectByContains (SelectAND SelectChildren (SelectByType type)))
ContainsNoChildOfType type =SelectAND (SelectByPath []) (SelectNOT (SelectByContains (SelectAND SelectChildren (SelectByType type))))
ContainsNoChildOfType type = SelectAND (SelectByPath []) (SelectNOT (SelectByContains (SelectAND SelectChildren (SelectByType type))))
RootIsStep = SelectAND (SelectByPath []) (SelectByType UIStep)
finalizeParallel :: Layout
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment