From ac85470a7856ac6a9ec64123518fefdeba164461 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 24 May 2021 03:33:13 +0300 Subject: [PATCH 16/28] gtk3.22: Make tab notice color different from alert color Reported by pjlsergeant See osdn #42295 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.22/gui_stuff.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/client/gui-gtk-3.22/gui_stuff.c b/client/gui-gtk-3.22/gui_stuff.c index 758d170717..8db0d51c78 100644 --- a/client/gui-gtk-3.22/gui_stuff.c +++ b/client/gui-gtk-3.22/gui_stuff.c @@ -431,8 +431,10 @@ static void gui_dialog_switch_page_handler(GtkNotebook *notebook, n = gtk_notebook_page_num(GTK_NOTEBOOK(dlg->v.tab.notebook), dlg->vbox); if (n == num) { - gtk_style_context_remove_class(gtk_widget_get_style_context(dlg->v.tab.label), - "alert"); + GtkStyleContext *context = gtk_widget_get_style_context(dlg->v.tab.label); + + gtk_style_context_remove_class(context, "alert"); + gtk_style_context_remove_class(context, "notice"); } } @@ -843,7 +845,7 @@ void gui_dialog_present(struct gui_dialog *dlg) GtkWidget *label = dlg->v.tab.label; gtk_style_context_add_class(gtk_widget_get_style_context(label), - "alert"); + "notice"); } } break; @@ -893,9 +895,11 @@ void gui_dialog_alert(struct gui_dialog *dlg) if (current != n) { GtkWidget *label = dlg->v.tab.label; + GtkStyleContext *context = gtk_widget_get_style_context(label); - gtk_style_context_add_class(gtk_widget_get_style_context(label), - "alert"); + /* Have only alert - remove notice if it exist. */ + gtk_style_context_remove_class(context, "notice"); + gtk_style_context_add_class(context, "alert"); } } break; @@ -1143,6 +1147,9 @@ void dlg_tab_provider_prepare(void) gtk_css_provider_load_from_data(dlg_tab_provider, ".alert {\n" "color: rgba(255, 0, 0, 255);\n" + "}\n" + ".notice {\n" + "color: rgba(0, 0, 255, 255);\n" "}\n", -1, NULL); } -- 2.30.2