From ab8c7643296b191f8f83f30a1974ae7376370c01 Mon Sep 17 00:00:00 2001 From: Joscha Date: Thu, 27 Feb 2020 15:06:03 +0000 Subject: [PATCH] [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. --- src/Forest/Client/UiState.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Forest/Client/UiState.hs b/src/Forest/Client/UiState.hs index 7991a17..29f2b23 100644 --- a/src/Forest/Client/UiState.hs +++ b/src/Forest/Client/UiState.hs @@ -268,7 +268,7 @@ renderNode focused node = decorateFlags (nodeFlags node) $ decorateFocus focused $ 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 s path node maybeChildren = case uiEditor s of