[client] Align node permissions to the right

The previous layout depended on txtWrap being greedy, but not taking up all
available horizontal space. That behaviour is incorrect according to the
definition of greedy widgets, which have to take up all available horizontal
space.

In brick 0.52, this behaviour has been partially fixed. The padRight function
added in this commit emulates the correct txtWrap behaviour even for cases where
txtWrap has not been fixed yet. If txtWrap is fixed entirely, the padRight can
be removed again.
This commit is contained in:
Joscha 2020-02-27 15:06:03 +00:00
parent 22974d96a7
commit ab8c764329

View file

@ -268,7 +268,7 @@ renderNode focused node =
decorateFlags (nodeFlags node) $ decorateFlags (nodeFlags node) $
decorateFocus focused $ decorateFocus focused $
decorateExpand (not $ OMap.null $ nodeChildren node) $ decorateExpand (not $ OMap.null $ nodeChildren node) $
txtWrap $ nodeText node padRight Max $ txtWrap $ nodeText node
nodeToTree :: (Ord n, Show n) => UiState n -> Path -> Node -> Maybe [WidgetTree n] -> WidgetTree n nodeToTree :: (Ord n, Show n) => UiState n -> Path -> Node -> Maybe [WidgetTree n] -> WidgetTree n
nodeToTree s path node maybeChildren = case uiEditor s of nodeToTree s path node maybeChildren = case uiEditor s of