diff options
author | Alexander Larsson <alexl@redhat.com> | 2012-06-28 21:30:24 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2012-06-28 21:48:14 +0200 |
commit | 10423726709539724be0ea19bed76ba4331af774 (patch) | |
tree | 862663f4d5e66bc7fad1881b1839866351cce549 /gtk/deprecated | |
parent | e307f08ec29e2c17b37446a60a5aa2e889a3ce09 (diff) | |
download | gtk+-10423726709539724be0ea19bed76ba4331af774.tar.gz |
Handle transparent colors better in GtkStyle emulation
We can't expose colors with alpha in the GtkStyle colors, since
GdkColor has no alpha. Currently we throw away alpha completely,
which fails very badly for completely transparent backgrounds,
which now is the default for most widgets, as it typically
end up with black-on-black.
We handle this by falling back on the default/previous colors for
transparent colors. This is is simple and avoids complete failure.
https://bugzilla.gnome.org/show_bug.cgi?id=671437
Diffstat (limited to 'gtk/deprecated')
-rw-r--r-- | gtk/deprecated/gtkstyle.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk/deprecated/gtkstyle.c b/gtk/deprecated/gtkstyle.c index 526636890c..16e3ce4542 100644 --- a/gtk/deprecated/gtkstyle.c +++ b/gtk/deprecated/gtkstyle.c @@ -673,7 +673,7 @@ set_color (GtkStyle *style, break; } - if (color) + if (color && color->alpha > 0.01) { dest->pixel = 0; dest->red = CLAMP ((guint) (color->red * 65535), 0, 65535); |