[Commits] [SCM] claws branch, gtk3, updated. 3.16.0-616-g04cf766
ticho at claws-mail.org
ticho at claws-mail.org
Thu Mar 21 18:55:59 CET 2019
The branch, gtk3 has been updated
via 04cf7661877b6573ad7062cf06fccaf178a55d5c (commit)
from 5ae1141fe8fa4a53fb57f160f9f00c89678e1a60 (commit)
Summary of changes:
src/folder_item_prefs.c | 4 ++++
src/prefs_gtk.c | 12 ++++++++----
2 files changed, 12 insertions(+), 4 deletions(-)
- Log -----------------------------------------------------------------
commit 04cf7661877b6573ad7062cf06fccaf178a55d5c
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Thu Mar 21 18:55:02 2019 +0100
Make sure that P_COLOR prefs are correctly initialized
Defaults to black, with alpha value set to 1.
diff --git a/src/folder_item_prefs.c b/src/folder_item_prefs.c
index d62f56b..9b8d554 100644
--- a/src/folder_item_prefs.c
+++ b/src/folder_item_prefs.c
@@ -214,6 +214,10 @@ static FolderItemPrefs *folder_item_prefs_clear(FolderItemPrefs *prefs)
prefs->enable_processing = FALSE;
prefs->enable_processing_when_opening = FALSE;
prefs->processing = NULL;
+ prefs->color.red = 0;
+ prefs->color.green = 0;
+ prefs->color.blue = 0;
+ prefs->color.alpha = 1;
prefs->newmailcheck = TRUE;
prefs->offlinesync = FALSE;
diff --git a/src/prefs_gtk.c b/src/prefs_gtk.c
index 4efdc58..aaf0dab 100644
--- a/src/prefs_gtk.c
+++ b/src/prefs_gtk.c
@@ -53,7 +53,8 @@
#define INTCOLOR_TO_GDKRGBA(intcolor, rgba) \
rgba.red = (gdouble)(((intcolor >> 16UL) & 0xFFUL) << 8UL) / 65535; \
rgba.green = (gdouble)(((intcolor >> 8UL) & 0xFFUL) << 8UL) / 65535; \
- rgba.blue = (gdouble)(((intcolor ) & 0xFFUL) << 8UL) / 65535;
+ rgba.blue = (gdouble)(((intcolor ) & 0xFFUL) << 8UL) / 65535; \
+ rgba.alpha = 1;
typedef enum
@@ -463,14 +464,17 @@ void prefs_set_default(PrefParam *param)
*((gushort *)param[i].data) = 0;
break;
case P_COLOR:
- if (param[i].defval != NULL && gdk_rgba_parse(&color, param[i].defval))
+ if (param[i].defval != NULL && gdk_rgba_parse(&color, param[i].defval)) {
+ color.alpha = 1;
*((GdkRGBA *)param[i].data) = color;
- else if (param[i].defval) {
+ } else if (param[i].defval) {
/* be compatible and accept ints */
INTCOLOR_TO_GDKRGBA(strtoul(param[i].defval, 0, 10), color);
*((GdkRGBA *)param[i].data) = color;
} else {
- color.red = color.green = color.blue = 0; color.alpha = 1;
+ /* set to black as fallback */
+ color.red = color.green = color.blue = 0;
+ color.alpha = 1;
*((GdkRGBA *)param[i].data) = color;
}
break;
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list