overrideAttr: imrove docs

This commit is contained in:
Jonathan Daugherty 2022-01-31 09:27:10 -08:00
parent 3fd091b5ac
commit 929d7b296a

View File

@ -912,10 +912,17 @@ forceAttr an p =
c <- getContext
withReaderT (ctxAttrMapL .~ (forceAttrMap (attrMapLookup an (c^.ctxAttrMapL)))) (render p)
-- | Override the lookup of 'targetName' to return the attribute value
-- associated with 'fromName' when rendering the specified widget.
-- See also 'mapAttrName'.
overrideAttr :: AttrName -> AttrName -> Widget n -> Widget n
-- | Override the lookup of a target attribute to return the attribute
-- value associated with another attribute when rendering the specified
-- widget. See also 'mapAttrName'.
overrideAttr :: AttrName
-- ^ Target attribute to remap
-> AttrName
-- ^ Name of attribute whose value should be use to remap
-- the target attribute
-> Widget n
-- ^ Widget in which the remapping should take effect
-> Widget n
overrideAttr targetName fromName =
updateAttrMap (mapAttrName fromName targetName)