diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2022-04-11 21:54:33 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2022-04-21 20:23:35 -0300 |
commit | 5f137d2c81878c41aa3b893fb56b1116bc27bc78 (patch) | |
tree | 2d6eadb2474e2d7b234b3dda9efd7559335adce7 /src/fe-gtk/maingui.c | |
parent | e2cfba040e26927b94a4e311a0a61365a81a41b1 (diff) | |
parent | 133f62806441a5db1156653aa1f077d2e8deeb34 (diff) |
Merge upstream changes
Diffstat (limited to 'src/fe-gtk/maingui.c')
-rw-r--r-- | src/fe-gtk/maingui.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 4e5baaa0..61f59856 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -175,20 +175,26 @@ fe_flash_window (session *sess) /* set a tab plain, red, light-red, or blue */ void -fe_set_tab_color (struct session *sess, int col) +fe_set_tab_color (struct session *sess, tabcolor col) { struct session *server_sess = sess->server->server_session; + int col_noflags = (col & ~FE_COLOR_ALLFLAGS); + int col_shouldoverride = !(col & FE_COLOR_FLAG_NOOVERRIDE); + if (sess->res->tab && sess->gui->is_tab && (col == 0 || sess != current_tab)) { - switch (col) + switch (col_noflags) { case 0: /* no particular color (theme default) */ sess->tab_state = TAB_STATE_NONE; chan_set_color (sess->res->tab, plain_list); break; case 1: /* new data has been displayed (dark red) */ - sess->tab_state = TAB_STATE_NEW_DATA; - chan_set_color (sess->res->tab, newdata_list); + if (col_shouldoverride || !((sess->tab_state & TAB_STATE_NEW_MSG) + || (sess->tab_state & TAB_STATE_NEW_HILIGHT))) { + sess->tab_state = TAB_STATE_NEW_DATA; + chan_set_color (sess->res->tab, newdata_list); + } if (chan_is_collapsed (sess->res->tab) && !((server_sess->tab_state & TAB_STATE_NEW_MSG) @@ -201,8 +207,10 @@ fe_set_tab_color (struct session *sess, int col) break; case 2: /* new message arrived in channel (light red) */ - sess->tab_state = TAB_STATE_NEW_MSG; - chan_set_color (sess->res->tab, newmsg_list); + if (col_shouldoverride || !(sess->tab_state & TAB_STATE_NEW_HILIGHT)) { + sess->tab_state = TAB_STATE_NEW_MSG; + chan_set_color (sess->res->tab, newmsg_list); + } if (chan_is_collapsed (sess->res->tab) && !(server_sess->tab_state & TAB_STATE_NEW_HILIGHT) @@ -540,7 +548,7 @@ mg_focus (session *sess) /* when called via mg_changui_new, is_tab might be true, but sess->res->tab is still NULL. */ if (sess->res->tab) - fe_set_tab_color (sess, 0); + fe_set_tab_color (sess, FE_COLOR_NONE); } static int @@ -1394,6 +1402,8 @@ mg_color_insert (GtkWidget *item, gpointer userdata) text = "\037"; break; case 102: text = "\035"; break; + case 103: + text = "\036"; break; default: text = "\017"; break; } @@ -1447,7 +1457,8 @@ mg_create_color_menu (GtkWidget *menu, session *sess) mg_markup_item (submenu, _("<b>Bold</b>"), 100); mg_markup_item (submenu, _("<u>Underline</u>"), 101); mg_markup_item (submenu, _("<i>Italic</i>"), 102); - mg_markup_item (submenu, _("Normal"), 103); + mg_markup_item (submenu, _("<s>Strikethrough</s>"), 103); + mg_markup_item (submenu, _("Normal"), 999); subsubmenu = mg_submenu (submenu, _("Colors 0-7")); |