mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-19 23:16:21 +00:00
Add theme option for time in a status bar
This commit is contained in:
committed by
Lukasz Marcinowski
parent
f1a5d12950
commit
91bc302acf
@@ -2224,6 +2224,7 @@ cons_theme_properties(void)
|
||||
_cons_theme_bar_prop(THEME_STATUS_BRACKET, "statusbar.brackets");
|
||||
_cons_theme_bar_prop(THEME_STATUS_ACTIVE, "statusbar.active");
|
||||
_cons_theme_bar_prop(THEME_STATUS_NEW, "statusbar.new");
|
||||
_cons_theme_bar_prop(THEME_STATUS_TIME, "statusbar.time");
|
||||
|
||||
_cons_theme_prop(THEME_TIME, "main.time");
|
||||
_cons_theme_prop(THEME_TEXT, "main.text");
|
||||
|
||||
@@ -459,6 +459,7 @@ _status_bar_draw(void)
|
||||
last_time = g_date_time_new_now(tz);
|
||||
|
||||
int bracket_attrs = theme_attrs(THEME_STATUS_BRACKET);
|
||||
int time_attrs = theme_attrs(THEME_STATUS_TIME);
|
||||
|
||||
char *time_pref = prefs_get_string(PREF_TIME_STATUSBAR);
|
||||
if (g_strcmp0(time_pref, "off") != 0) {
|
||||
@@ -468,7 +469,9 @@ _status_bar_draw(void)
|
||||
wattron(status_bar, bracket_attrs);
|
||||
mvwaddch(status_bar, 0, 1, '[');
|
||||
wattroff(status_bar, bracket_attrs);
|
||||
wattron(status_bar, time_attrs);
|
||||
mvwprintw(status_bar, 0, 2, date_fmt);
|
||||
wattroff(status_bar, time_attrs);
|
||||
wattron(status_bar, bracket_attrs);
|
||||
mvwaddch(status_bar, 0, 2 + len, ']');
|
||||
wattroff(status_bar, bracket_attrs);
|
||||
|
||||
Reference in New Issue
Block a user