Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Berg <benjamin@sipsolutions.net>2010-01-10 14:14:27 (GMT)
committer Benjamin Berg <benjamin@sipsolutions.net>2010-01-10 14:14:27 (GMT)
commita5c453a6eb97af0342771e4d235a2bb84427796b (patch)
treed3ce5532536e3a61df55d22f50fcaeea8b783828
parent1c6b3ac70a0e4e69473d2d6a99bd2dcab05e32d5 (diff)
Implement transparent-bg-hint so that mozilla can draw entries properly.
-rw-r--r--gtk/engine/sugar-style.c14
-rw-r--r--gtk/theme/gtkrc.em5
2 files changed, 15 insertions, 4 deletions
diff --git a/gtk/engine/sugar-style.c b/gtk/engine/sugar-style.c
index 443a708..b81fe69 100644
--- a/gtk/engine/sugar-style.c
+++ b/gtk/engine/sugar-style.c
@@ -389,8 +389,12 @@ sugar_style_draw_box (GtkStyle *style,
SugarInfo info;
sugar_fill_generic_info (&info, style, state_type, shadow_type, widget, detail, x, y, width, height);
- /* Fill the background with bg_color. */
- sugar_fill_background (cr, &info);
+ /* Fill the background as it is initilized to base[NORMAL].
+ * Relevant GTK+ bug: http://bugzilla.gnome.org/show_bug.cgi?id=513471
+ * The fill only happens if no hint has been added by some application
+ * that is faking GTK+ widgets. */
+ if (!widget || !g_object_get_data(G_OBJECT (widget), "transparent-bg-hint"))
+ sugar_fill_background (cr, &info);
info.cont_edges = info.ltr ? EDGE_LEFT : EDGE_RIGHT;
sugar_remove_corners (&info.corners, info.cont_edges);
@@ -444,7 +448,8 @@ sugar_style_draw_box (GtkStyle *style,
info.state = GTK_STATE_INSENSITIVE;
/* Needed because the trough and bar are cached in a buffer inside GtkProgress. */
- sugar_fill_background (cr, &info);
+ if (!widget || !g_object_get_data(G_OBJECT (widget), "transparent-bg-hint"))
+ sugar_fill_background (cr, &info);
sugar_draw_progressbar_trough (cr, &info);
}
} else if (DETAIL ("bar")) {
@@ -641,7 +646,8 @@ sugar_style_draw_shadow (GtkStyle *style,
}
/* Fill the background with bg_color. */
- sugar_fill_background (cr, &info);
+ if (!widget || !g_object_get_data(G_OBJECT (widget), "transparent-bg-hint"))
+ sugar_fill_background (cr, &info);
sugar_draw_entry (cr, &info);
} else {
gdouble line_width;
diff --git a/gtk/theme/gtkrc.em b/gtk/theme/gtkrc.em
index 56770ea..69dccd9 100644
--- a/gtk/theme/gtkrc.em
+++ b/gtk/theme/gtkrc.em
@@ -149,6 +149,11 @@ style "default"
GtkButtonBox::child-internal-pad-x = 0
GtkButtonBox::child-internal-pad-y = 0
+ # The following line hints to gecko (and possibly other appliations)
+ # that the entry should be drawn transparently on the canvas.
+ # Without this, gecko will fill in the background of the entry.
+ GtkEntry::honors-transparent-bg-hint = 1
+
engine "sugar" {
line_width = $line_width
thick_line_width = $thick_line_width