From 2aa0a9d42b71bfa23998f9e713f5b2042df05bbb Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Thu, 11 Jan 2024 15:21:22 +0000 Subject: [PATCH] themes: Prevent system theme leak on stacks and viewports If a system theme sets the background-image property for stacks, it recolors the main canvas when empty. It also adds a border to the toolbox Wilber area. Additionally, the Credits page of the GtkAboutDialog has odd colors due to general viewport grid styles overriding the GTK default. This patch fixes these problems, and adds a custom CSS class to the GimpAboutDialog for current and future work. --- app/dialogs/about-dialog.c | 3 +++ themes/Default/common.css | 21 +++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/app/dialogs/about-dialog.c b/app/dialogs/about-dialog.c index e7ff0a7b38..7a9f42aa7c 100644 --- a/app/dialogs/about-dialog.c +++ b/app/dialogs/about-dialog.c @@ -192,6 +192,9 @@ about_dialog_create (Gimp *gimp, g_list_free (children); } + gtk_style_context_add_class (gtk_widget_get_style_context (dialog.dialog), + "gimp-about-dialog"); + return dialog.dialog; } diff --git a/themes/Default/common.css b/themes/Default/common.css index 35cb82acee..5487a54fd0 100644 --- a/themes/Default/common.css +++ b/themes/Default/common.css @@ -75,6 +75,12 @@ GimpDisplayShell, GimpDock, .dialog-action-box, .dialog-vbox { color: @dimmed-fg-color; } +/* Prevent system theme leak that adds a border around + * the toolbox Wilber */ +GimpDock frame border { + background-image: none; +} + /* Foreground color for the big Wilber in the empty image window. * Again, background-color and background here are ignored. */ @@ -82,6 +88,12 @@ GimpDisplayShell, GimpDock, .dialog-action-box, .dialog-vbox { color: @dimmed-fg-color; } +/* Prevent system theme leak that affects the color of the + * main canvas and some widget containers */ +stack { + background-image: none; +} + /* GtkTextView */ textview text, textview { background-color: @extreme-bg-color; @@ -280,8 +292,13 @@ scrolledwindow /* Removes black border around scrolled windows */ scrolledwindow viewport grid, scrolledwindow viewport box { - border-radius: 1px; - border: 0px solid @bg-color; + border-radius: 1px; + border: 0px solid @bg-color; +} + +/* Defining background color for About Dialog credits box */ +.gimp-about-dialog box box stack scrolledwindow viewport grid { + background-color: @extreme-bg-color; } GimpRuler {