Skip to content

Commit

Permalink
themes/ui: Add styling for different notification types.
Browse files Browse the repository at this point in the history
This commit:
 * adds styles for various notification categories (inverted color
   backgrounds).
 * removes the default 'footer' style & use neutral style instead.

The categories with associated styles and footer used as of now:
 * success (task:success) - on successful completion of a task
 * warning (task:warning) - providing heads-up for a certain task
 * failure (task:failure) - on failure of a task
 * neutral (footer:neutral) - default notification style
  • Loading branch information
Ezio-Sarthak committed Apr 17, 2021
1 parent 306f237 commit 6f89e19
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
35 changes: 28 additions & 7 deletions zulipterminal/config/themes.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
'msg_code': 'bold',
'msg_bold': 'bold',
'msg_time': 'bold',
'footer': 'standout',
'starred': 'bold',
'popup_category': 'bold',
'unread_count': 'bold',
Expand All @@ -49,6 +48,10 @@
'area:msg': 'standout',
'area:stream': 'standout',
'area:error': 'standout',
'footer:neutral': 'standout',
'task:success': 'standout',
'task:failure': 'standout',
'task:warning': 'standout',
}


Expand Down Expand Up @@ -155,8 +158,6 @@
None, DEF['white:bold'], DEF['black']),
('msg_time', 'black', 'white',
None, DEF['black'], DEF['white']),
('footer', 'white', 'dark red',
None, DEF['white'], DEF['dark_red']),
('starred', 'light red, bold', 'black',
None, DEF['light_red:bold'], DEF['black']),
('popup_category', 'light blue, bold', 'black',
Expand Down Expand Up @@ -189,6 +190,14 @@
None, DEF['white'], DEF['dark_cyan']),
('area:error', 'white', 'dark red',
None, DEF['white'], DEF['dark_red']),
('footer:neutral', 'black', 'light gray',
None, DEF['black'], DEF['light_gray']),
('task:success', 'white', 'dark green',
None, DEF['white'], DEF['dark_green']),
('task:failure', 'white', 'dark red',
None, DEF['white'], DEF['dark_red']),
('task:warning', 'white', 'brown',
None, DEF['white'], DEF['brown']),
],
'gruvbox_dark': [
# default colorscheme on 16 colors, gruvbox colorscheme
Expand Down Expand Up @@ -247,8 +256,6 @@
None, WHITEBOLD, BLACK),
('msg_time', 'black', 'white',
None, BLACK, WHITE),
('footer', 'white', 'dark red',
None, WHITE, DARKRED),
('starred', 'light red, bold', 'black',
None, LIGHTREDBOLD, BLACK),
('popup_category', 'light blue, bold', 'black',
Expand Down Expand Up @@ -281,6 +288,14 @@
None, BLACK, LIGHTBLUE),
('area:error', 'white', 'dark red',
None, WHITE, DARKRED),
('footer:neutral', 'black', 'light gray',
None, BLACK, GRAY),
('task:success', 'black', 'light green',
None, BLACK, LIGHTGREEN),
('task:failure', 'white', 'dark red',
None, WHITE, DARKRED),
('task:warning', 'black', 'light red',
None, BLACK, LIGHTRED),
],
'zt_light': [
(None, 'black', 'white'),
Expand Down Expand Up @@ -310,7 +325,6 @@
('msg_code', 'black', 'light gray'),
('msg_bold', 'white, bold', 'dark gray'),
('msg_time', 'white', 'dark gray'),
('footer', 'white', 'dark red'),
('starred', 'light red, bold', 'white'),
('popup_category', 'dark gray, bold', 'light gray'),
('unread_count', 'dark blue, bold', 'white'),
Expand All @@ -327,6 +341,10 @@
('area:stream', 'black', 'light blue'),
('area:msg', 'black', 'yellow'),
('area:error', 'black', 'light red'),
('footer:neutral', 'white', 'dark gray'),
('task:success', 'black', 'dark green'),
('task:failure', 'white', 'dark red'),
('task:warning', 'black', 'yellow'),
],
'zt_blue': [
(None, 'black', 'light blue'),
Expand Down Expand Up @@ -356,7 +374,6 @@
('msg_code', 'dark blue', 'white'),
('msg_bold', 'white, bold', 'dark blue'),
('msg_time', 'dark blue', 'white'),
('footer', 'white', 'dark red'),
('starred', 'light red, bold', 'light blue'),
('popup_category', 'light gray, bold', 'light blue'),
('unread_count', 'yellow', 'light blue'),
Expand All @@ -373,6 +390,10 @@
('area:stream', 'white', 'dark cyan'),
('area:msg', 'white', 'brown'),
('area:error', 'white', 'dark red'),
('footer:neutral', 'white', 'dark gray'),
('task:success', 'white', 'dark green'),
('task:failure', 'white', 'dark red'),
('task:warning', 'white', 'brown'),
]
}

Expand Down
2 changes: 1 addition & 1 deletion zulipterminal/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def set_typeahead_footer(self, suggestions: List[str],

def footer_view(self) -> Any:
text_header = self.get_random_help()
return urwid.AttrWrap(urwid.Text(text_header), 'footer')
return urwid.AttrWrap(urwid.Text(text_header), 'footer:neutral')

def main_window(self) -> Any:
self.left_panel = self.left_column_view()
Expand Down

0 comments on commit 6f89e19

Please sign in to comment.