about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorDaniel Lublin <daniel@lublin.se>2019-09-20 10:40:54 +0200
committerDaniel Lublin <daniel@lublin.se>2019-09-24 10:35:30 +0200
commit641410f6bd507408749a87ade2f5d6ae05ebaa0b (patch)
tree31176ed527faceb79cb8675b3d69fe7bf871fd60 /src/ui
parent8e76283f9743c390bf27c883ef58da79cc4bd2c3 (diff)
downloadprofani-tty-641410f6bd507408749a87ade2f5d6ae05ebaa0b.tar.gz
Add coloring of statusbar.current tab in view
This theme color applies to the tab title text of the statusbar tab that
is currently shown.

The (somewhat confusingly named) `statusbar.active` theme color now
applies to all other tabs (before, it applied to all tabs).

Coloring of a tab that is highlighted/has new messages is done as before
using the `statusbar.new` theme color.

The default color is set to `cyan`, and thus causes no visible change
for users -- until modified.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/console.c1
-rw-r--r--src/ui/statusbar.c14
2 files changed, 11 insertions, 4 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index 4874d1e1..94fbba33 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -2313,6 +2313,7 @@ cons_theme_properties(void)
     _cons_theme_bar_prop(THEME_STATUS_TEXT, "statusbar.text");
     _cons_theme_bar_prop(THEME_STATUS_BRACKET, "statusbar.brackets");
     _cons_theme_bar_prop(THEME_STATUS_ACTIVE, "statusbar.active");
+    _cons_theme_bar_prop(THEME_STATUS_CURRENT, "statusbar.current");
     _cons_theme_bar_prop(THEME_STATUS_NEW, "statusbar.new");
     _cons_theme_bar_prop(THEME_STATUS_TIME, "statusbar.time");
 
diff --git a/src/ui/statusbar.c b/src/ui/statusbar.c
index 4ad1e373..03ab718d 100644
--- a/src/ui/statusbar.c
+++ b/src/ui/statusbar.c
@@ -336,9 +336,13 @@ _status_bar_draw_extended_tabs(int pos)
 
         pos = _status_bar_draw_bracket(is_current, pos, "[");
 
-        int status_attrs = theme_attrs(THEME_STATUS_ACTIVE);
-        if (_extended_new()) {
+        int status_attrs;
+        if (is_current) {
+            status_attrs = theme_attrs(THEME_STATUS_CURRENT);
+        } else if (_extended_new()) {
             status_attrs = theme_attrs(THEME_STATUS_NEW);
+        } else {
+            status_attrs = theme_attrs(THEME_STATUS_ACTIVE);
         }
         wattron(statusbar_win, status_attrs);
         mvwprintw(statusbar_win, 0, pos, ">");
@@ -362,8 +366,10 @@ _status_bar_draw_tab(StatusBarTab *tab, int pos, int num)
 
     pos = _status_bar_draw_bracket(is_current, pos, "[");
 
-    int status_attrs = 0;
-    if (tab->highlight) {
+    int status_attrs;
+    if (is_current) {
+        status_attrs = theme_attrs(THEME_STATUS_CURRENT);
+    } else if (tab->highlight) {
         status_attrs = theme_attrs(THEME_STATUS_NEW);
     } else {
         status_attrs = theme_attrs(THEME_STATUS_ACTIVE);