From 86da12d844a4749a0334cf129ded53140b5cc351 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 12 Aug 2021 14:28:44 -0700 Subject: [PATCH] Use RGB instead of RGBA for color set for color --- gnucash/gnome-utils/dialog-options.cpp | 15 ++++++++++----- libgnucash/app-utils/options.scm | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gnucash/gnome-utils/dialog-options.cpp b/gnucash/gnome-utils/dialog-options.cpp index b5275c46e2..23c0ff7e35 100644 --- a/gnucash/gnome-utils/dialog-options.cpp +++ b/gnucash/gnome-utils/dialog-options.cpp @@ -261,12 +261,12 @@ dialog_changed_internal (GtkWidget *widget, bool sensitive) _("_Close")); } g_list_free (children); - break; // Found the button-box, no need to continue. + break; // Found the button-box, no need to continue. + } } - } g_list_free (children); - break; // Found the box, no need to continue. - } + break; // Found the box, no need to continue. + } } g_list_free (children); } @@ -2157,7 +2157,12 @@ public: (uint8_t)(color.green * 255), (uint8_t)(color.blue * 255), (uint8_t)(color.alpha * 255)); - option.set_value(std::string{rgba_str}); + auto rgb_str = g_strdup_printf("%2x%2x%2x", + (uint8_t)(color.red * 255), + (uint8_t)(color.green * 255), + (uint8_t)(color.blue * 255)); +// Hello World uses an old HTML4 attribute that doesn't understand alpha. + option.set_value(std::string{rgb_str}); g_free(rgba_str); } }; diff --git a/libgnucash/app-utils/options.scm b/libgnucash/app-utils/options.scm index e3707ff399..1dd35f963f 100644 --- a/libgnucash/app-utils/options.scm +++ b/libgnucash/app-utils/options.scm @@ -157,7 +157,7 @@ (gnc-make-string-option section name key docstring default (GncOptionUIType-FONT))) (define-public (gnc:make-color-option section name key docstring colors range use-alpha) (issue-deprecation-warning "gnc:make-color-option is deprecated. Make and register the option in one command with gnc-register-color-option.") - (let ((color-str (if use-alpha + (let ((color-str (if use-alpha ;; It's always false... (format #f "~x~x~x~x" (car colors) (cadr colors) (caddr colors) (cadddr colors)) (format #f "~x~x~x" (car colors) (cadr colors) (caddr colors))))) (gnc-make-string-option section name key docstring color-str (GncOptionUIType-COLOR))))