From f3f03c0111729633e4026ce398ac60725e1bc1ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 4 Feb 2026 21:05:30 +0100 Subject: Show number of conversations with unread messages in CLI prompt Changelog: Show the number of conversations with unread messages in CLI prompt --- src/Erebos/TextFormat.hs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/Erebos/TextFormat.hs') diff --git a/src/Erebos/TextFormat.hs b/src/Erebos/TextFormat.hs index 20973d9..88fe0c2 100644 --- a/src/Erebos/TextFormat.hs +++ b/src/Erebos/TextFormat.hs @@ -2,6 +2,12 @@ module Erebos.TextFormat ( FormattedText, plainText, + TextStyle, + withStyle, noStyle, + + Color(..), + setForegroundColor, setBackgroundColor, + renderPlainText, formattedTextLength, ) where @@ -16,6 +22,19 @@ plainText :: Text -> FormattedText plainText = PlainText +withStyle :: TextStyle -> FormattedText -> FormattedText +withStyle = FormattedText + +noStyle :: TextStyle +noStyle = CustomTextColor Nothing Nothing + +setForegroundColor :: Color -> TextStyle -> TextStyle +setForegroundColor color (CustomTextColor _ bg) = CustomTextColor (Just color) bg + +setBackgroundColor :: Color -> TextStyle -> TextStyle +setBackgroundColor color (CustomTextColor fg _) = CustomTextColor fg (Just color) + + renderPlainText :: FormattedText -> Text renderPlainText = \case PlainText text -> text -- cgit v1.2.3