1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-30 22:16:44 +02:00

Some UI improvements

- Bottom tab now only shows indices of active chat windows unless focused
- Always focus Home screen on startup instead of the last loaded conference
- Conference tab names are no longer prefixed with the conference number
- Home and Contact tab names are now capitalized
This commit is contained in:
jfreegman
2020-11-19 01:30:30 -05:00
parent 41be04a142
commit 53a7530e8a
6 changed files with 17 additions and 13 deletions

View File

@ -494,7 +494,7 @@ void on_window_resize(void)
}
}
static void draw_window_tab(ToxWindow *toxwin)
static void draw_window_tab(ToxWindow *toxwin, bool active_window)
{
pthread_mutex_lock(&Winthread.lock);
@ -505,7 +505,12 @@ static void draw_window_tab(ToxWindow *toxwin)
pthread_mutex_unlock(&Winthread.lock);
clrtoeol();
printw(" [%s]", toxwin->name);
if (active_window || toxwin->index <= 1) {
printw(" [%s]", toxwin->name);
} else {
printw(" [%u]", toxwin->index - 1);
}
pthread_mutex_lock(&Winthread.lock);
@ -540,7 +545,9 @@ static void draw_bar(void)
continue;
}
if (i == active_window_index) {
bool active_window = i == active_window_index;
if (active_window) {
#ifdef URXVT_FIX
attron(A_BOLD | COLOR_PAIR(GREEN));
@ -550,9 +557,9 @@ static void draw_bar(void)
attron(A_BOLD);
}
draw_window_tab(windows[i]);
draw_window_tab(windows[i], active_window);
if (i == active_window_index) {
if (active_window) {
#ifdef URXVT_FIX
attroff(A_BOLD | COLOR_PAIR(GREEN));