[gnumeric] Sheet Objects: get style info from gtk.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Sheet Objects: get style info from gtk.
- Date: Fri, 24 Sep 2010 23:35:57 +0000 (UTC)
commit cf0cd46a35a9ace2d02a383f3c343906ef0e084b
Author: Morten Welinder <terra gnome org>
Date: Fri Sep 24 19:35:34 2010 -0400
Sheet Objects: get style info from gtk.
ChangeLog | 9 +++++++--
src/sheet-object-widget.c | 13 ++++++-------
2 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 59749e4..dc21dcb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-09-24 Morten Welinder <terra gnome org>
+
+ * src/sheet-object-widget.c (sheet_widget_checkbox_draw_cairo):
+ Get font info from GtkStyle.
+
2010-09-24 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/sheet-object-widget.c ( sheet_widget_checkbox_draw_cairo):
@@ -5,14 +10,14 @@
2010-09-24 Andreas J. Guelzow <aguelzow pyrshep ca>
- * src/sheet-object-widget.c (SOW_MAKE_TYPE): add fn_draw_cairo and
+ * src/sheet-object-widget.c (SOW_MAKE_TYPE): add fn_draw_cairo and
change all usages using sheet_widget_draw_cairo as default
(sheet_widget_checkbox_draw_cairo): new
(sheet_widget_radio_button_draw_cairo): new
2010-09-22 Andreas J. Guelzow <aguelzow pyrshep ca>
- * src/sheet-object-widget.c (sheet_widget_draw_cairo): avoid
+ * src/sheet-object-widget.c (sheet_widget_draw_cairo): avoid
dereferencing NULL pointer
2010-09-21 Morten Welinder <terra gnome org>
diff --git a/src/sheet-object-widget.c b/src/sheet-object-widget.c
index 7665063..8ee217d 100644
--- a/src/sheet-object-widget.c
+++ b/src/sheet-object-widget.c
@@ -2234,9 +2234,9 @@ sheet_widget_checkbox_draw_cairo (SheetObject const *so, cairo_t *cr,
SheetWidgetCheckbox const *swc = SHEET_WIDGET_CHECKBOX (so);
double halfheight = height/2;
PangoLayout *layout = pango_cairo_create_layout (cr);
- PangoFontDescription *desc;
double const scale_h = 72. / gnm_app_display_dpi_get (TRUE);
double const scale_v = 72. / gnm_app_display_dpi_get (FALSE);
+ GtkStyle *style = gtk_style_new ();
cairo_save (cr);
cairo_set_line_width (cr, 0.5);
@@ -2265,16 +2265,15 @@ sheet_widget_checkbox_draw_cairo (SheetObject const *so, cairo_t *cr,
cairo_stroke (cr);
}
- cairo_move_to (cr, 4. + 8. + 4, halfheight - 5.5);
- desc = pango_font_description_from_string ("sans 10");
- pango_context_set_font_description
- (pango_layout_get_context (layout), desc);
+ pango_layout_set_font_description (layout, style->font_desc);
pango_layout_set_single_paragraph_mode (layout, TRUE);
pango_layout_set_text (layout, swc->label, -1);
+
+ cairo_move_to (cr, 4. + 8. + 4, halfheight - 5.5);
cairo_scale (cr, scale_h, scale_v);
pango_cairo_show_layout (cr, layout);
- g_object_unref (G_OBJECT (layout));
- pango_font_description_free (desc);
+ g_object_unref (layout);
+ g_object_unref (style);
cairo_new_path (cr);
cairo_restore (cr);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]