Merge pull request #1195 from quite/statusbarcurrent
Add coloring of statusbar.current tab in view
This commit is contained in:
@@ -99,6 +99,7 @@ theme_init(const char *const theme_name)
|
|||||||
g_hash_table_insert(defaults, strdup("statusbar.text"), strdup("white"));
|
g_hash_table_insert(defaults, strdup("statusbar.text"), strdup("white"));
|
||||||
g_hash_table_insert(defaults, strdup("statusbar.brackets"), strdup("cyan"));
|
g_hash_table_insert(defaults, strdup("statusbar.brackets"), strdup("cyan"));
|
||||||
g_hash_table_insert(defaults, strdup("statusbar.active"), strdup("cyan"));
|
g_hash_table_insert(defaults, strdup("statusbar.active"), strdup("cyan"));
|
||||||
|
g_hash_table_insert(defaults, strdup("statusbar.current"), strdup("cyan"));
|
||||||
g_hash_table_insert(defaults, strdup("statusbar.new"), strdup("white"));
|
g_hash_table_insert(defaults, strdup("statusbar.new"), strdup("white"));
|
||||||
g_hash_table_insert(defaults, strdup("statusbar.time"), strdup("white"));
|
g_hash_table_insert(defaults, strdup("statusbar.time"), strdup("white"));
|
||||||
g_hash_table_insert(defaults, strdup("me"), strdup("yellow"));
|
g_hash_table_insert(defaults, strdup("me"), strdup("yellow"));
|
||||||
@@ -704,6 +705,7 @@ theme_attrs(theme_item_t attrs)
|
|||||||
case THEME_STATUS_TEXT: _theme_prep_fgnd("statusbar.text", lookup_str, &bold); break;
|
case THEME_STATUS_TEXT: _theme_prep_fgnd("statusbar.text", lookup_str, &bold); break;
|
||||||
case THEME_STATUS_BRACKET: _theme_prep_fgnd("statusbar.brackets", lookup_str, &bold); break;
|
case THEME_STATUS_BRACKET: _theme_prep_fgnd("statusbar.brackets", lookup_str, &bold); break;
|
||||||
case THEME_STATUS_ACTIVE: _theme_prep_fgnd("statusbar.active", lookup_str, &bold); break;
|
case THEME_STATUS_ACTIVE: _theme_prep_fgnd("statusbar.active", lookup_str, &bold); break;
|
||||||
|
case THEME_STATUS_CURRENT: _theme_prep_fgnd("statusbar.current", lookup_str, &bold); break;
|
||||||
case THEME_STATUS_NEW: _theme_prep_fgnd("statusbar.new", lookup_str, &bold); break;
|
case THEME_STATUS_NEW: _theme_prep_fgnd("statusbar.new", lookup_str, &bold); break;
|
||||||
case THEME_STATUS_TIME: _theme_prep_fgnd("statusbar.time", lookup_str, &bold); break;
|
case THEME_STATUS_TIME: _theme_prep_fgnd("statusbar.time", lookup_str, &bold); break;
|
||||||
case THEME_ME: _theme_prep_fgnd("me", lookup_str, &bold); break;
|
case THEME_ME: _theme_prep_fgnd("me", lookup_str, &bold); break;
|
||||||
@@ -794,6 +796,7 @@ theme_attrs(theme_item_t attrs)
|
|||||||
case THEME_STATUS_TEXT:
|
case THEME_STATUS_TEXT:
|
||||||
case THEME_STATUS_BRACKET:
|
case THEME_STATUS_BRACKET:
|
||||||
case THEME_STATUS_ACTIVE:
|
case THEME_STATUS_ACTIVE:
|
||||||
|
case THEME_STATUS_CURRENT:
|
||||||
case THEME_STATUS_NEW:
|
case THEME_STATUS_NEW:
|
||||||
case THEME_STATUS_TIME:
|
case THEME_STATUS_TIME:
|
||||||
_theme_prep_bgnd("statusbar", "blue", lookup_str);
|
_theme_prep_bgnd("statusbar", "blue", lookup_str);
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ typedef enum {
|
|||||||
THEME_STATUS_TEXT,
|
THEME_STATUS_TEXT,
|
||||||
THEME_STATUS_BRACKET,
|
THEME_STATUS_BRACKET,
|
||||||
THEME_STATUS_ACTIVE,
|
THEME_STATUS_ACTIVE,
|
||||||
|
THEME_STATUS_CURRENT,
|
||||||
THEME_STATUS_NEW,
|
THEME_STATUS_NEW,
|
||||||
THEME_STATUS_TIME,
|
THEME_STATUS_TIME,
|
||||||
THEME_ME,
|
THEME_ME,
|
||||||
|
|||||||
@@ -2313,6 +2313,7 @@ cons_theme_properties(void)
|
|||||||
_cons_theme_bar_prop(THEME_STATUS_TEXT, "statusbar.text");
|
_cons_theme_bar_prop(THEME_STATUS_TEXT, "statusbar.text");
|
||||||
_cons_theme_bar_prop(THEME_STATUS_BRACKET, "statusbar.brackets");
|
_cons_theme_bar_prop(THEME_STATUS_BRACKET, "statusbar.brackets");
|
||||||
_cons_theme_bar_prop(THEME_STATUS_ACTIVE, "statusbar.active");
|
_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_NEW, "statusbar.new");
|
||||||
_cons_theme_bar_prop(THEME_STATUS_TIME, "statusbar.time");
|
_cons_theme_bar_prop(THEME_STATUS_TIME, "statusbar.time");
|
||||||
|
|
||||||
|
|||||||
@@ -336,9 +336,13 @@ _status_bar_draw_extended_tabs(int pos)
|
|||||||
|
|
||||||
pos = _status_bar_draw_bracket(is_current, pos, "[");
|
pos = _status_bar_draw_bracket(is_current, pos, "[");
|
||||||
|
|
||||||
int status_attrs = theme_attrs(THEME_STATUS_ACTIVE);
|
int status_attrs;
|
||||||
if (_extended_new()) {
|
if (is_current) {
|
||||||
|
status_attrs = theme_attrs(THEME_STATUS_CURRENT);
|
||||||
|
} else if (_extended_new()) {
|
||||||
status_attrs = theme_attrs(THEME_STATUS_NEW);
|
status_attrs = theme_attrs(THEME_STATUS_NEW);
|
||||||
|
} else {
|
||||||
|
status_attrs = theme_attrs(THEME_STATUS_ACTIVE);
|
||||||
}
|
}
|
||||||
wattron(statusbar_win, status_attrs);
|
wattron(statusbar_win, status_attrs);
|
||||||
mvwprintw(statusbar_win, 0, pos, ">");
|
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, "[");
|
pos = _status_bar_draw_bracket(is_current, pos, "[");
|
||||||
|
|
||||||
int status_attrs = 0;
|
int status_attrs;
|
||||||
if (tab->highlight) {
|
if (is_current) {
|
||||||
|
status_attrs = theme_attrs(THEME_STATUS_CURRENT);
|
||||||
|
} else if (tab->highlight) {
|
||||||
status_attrs = theme_attrs(THEME_STATUS_NEW);
|
status_attrs = theme_attrs(THEME_STATUS_NEW);
|
||||||
} else {
|
} else {
|
||||||
status_attrs = theme_attrs(THEME_STATUS_ACTIVE);
|
status_attrs = theme_attrs(THEME_STATUS_ACTIVE);
|
||||||
|
|||||||
Reference in New Issue
Block a user