[gnome-font-viewer] font-widget: update from latest Sushi
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-font-viewer] font-widget: update from latest Sushi
- Date: Tue, 5 Mar 2013 02:48:40 +0000 (UTC)
commit b998c9a041383cb8b7de20b9fdf54e01e6153e5c
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Mar 4 18:20:22 2013 -0500
font-widget: update from latest Sushi
src/sushi-font-widget.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/sushi-font-widget.c b/src/sushi-font-widget.c
index 2d6f237..76634fc 100644
--- a/src/sushi-font-widget.c
+++ b/src/sushi-font-widget.c
@@ -474,13 +474,20 @@ sushi_font_widget_draw (GtkWidget *drawing_area,
GdkRGBA color;
GtkBorder padding;
GtkStateFlags state;
- gint allocated_height;
+ gint allocated_width, allocated_height;
if (face == NULL)
goto end;
context = gtk_widget_get_style_context (drawing_area);
state = gtk_style_context_get_state (context);
+
+ allocated_width = gtk_widget_get_allocated_width (drawing_area);
+ allocated_height = gtk_widget_get_allocated_height (drawing_area);
+
+ gtk_render_background (context, cr,
+ 0, 0, allocated_width, allocated_height);
+
gtk_style_context_get_color (context, state, &color);
gtk_style_context_get_padding (context, state, &padding);
@@ -492,8 +499,6 @@ sushi_font_widget_draw (GtkWidget *drawing_area,
cairo_set_font_face (cr, font);
cairo_font_face_destroy (font);
- allocated_height = gtk_widget_get_allocated_height (drawing_area);
-
/* draw text */
if (self->priv->font_name != NULL) {
@@ -596,6 +601,9 @@ sushi_font_widget_init (SushiFontWidget *self)
if (err != FT_Err_Ok)
g_error ("Unable to initialize FreeType");
+
+ gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (self)),
+ GTK_STYLE_CLASS_VIEW);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]