From 929d7b296adc11fdf7746ea271f99da19e0d3006 Mon Sep 17 00:00:00 2001 From: Jonathan Daugherty Date: Mon, 31 Jan 2022 09:27:10 -0800 Subject: [PATCH] overrideAttr: imrove docs --- src/Brick/Widgets/Core.hs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Brick/Widgets/Core.hs b/src/Brick/Widgets/Core.hs index c558af1..384030b 100644 --- a/src/Brick/Widgets/Core.hs +++ b/src/Brick/Widgets/Core.hs @@ -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)