From 41d95f50c2d8d11fdf10085cb2d7a42d8bc0b728 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 17 May 2021 23:22:10 +0300 Subject: [PATCH 54/55] gtk3.22/gtk4: 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 | 7 ++++++- client/gui-gtk-4.0/gui_stuff.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/client/gui-gtk-3.22/gui_stuff.c b/client/gui-gtk-3.22/gui_stuff.c index 71b04cda96..52484a4baf 100644 --- a/client/gui-gtk-3.22/gui_stuff.c +++ b/client/gui-gtk-3.22/gui_stuff.c @@ -436,6 +436,8 @@ static void gui_dialog_switch_page_handler(GtkNotebook *notebook, if (n == num) { gtk_style_context_remove_class(gtk_widget_get_style_context(dlg->v.tab.label), "alert"); + gtk_style_context_remove_class(gtk_widget_get_style_context(dlg->v.tab.label), + "notice"); } } @@ -846,7 +848,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; @@ -1146,6 +1148,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); } diff --git a/client/gui-gtk-4.0/gui_stuff.c b/client/gui-gtk-4.0/gui_stuff.c index 142be0e901..d32f252e94 100644 --- a/client/gui-gtk-4.0/gui_stuff.c +++ b/client/gui-gtk-4.0/gui_stuff.c @@ -429,6 +429,8 @@ static void gui_dialog_switch_page_handler(GtkNotebook *notebook, if (n == num) { gtk_style_context_remove_class(gtk_widget_get_style_context(dlg->v.tab.label), "alert"); + gtk_style_context_remove_class(gtk_widget_get_style_context(dlg->v.tab.label), + "notice"); } } @@ -815,7 +817,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; @@ -1115,6 +1117,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); } -- 2.30.2