[gnumeric] fixed a couple of canvas issues
- From: Jean Bréfort <jbrefort src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnumeric] fixed a couple of canvas issues
- Date: Thu, 3 Sep 2009 12:27:30 +0000 (UTC)
commit 2ac3bd88071fe6b9e32492112a7cb13d002acf57
Author: Jean Brefort <jean brefort normalesup org>
Date: Thu Sep 3 14:19:40 2009 +0200
fixed a couple of canvas issues
ChangeLog | 5 +++++
src/dialogs/ChangeLog | 5 +++++
src/dialogs/dialog-printer-setup.c | 4 +++-
src/item-edit.c | 9 ++-------
4 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1c0f26d..5cdc49c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-03 Jean Brefort <jean brefort normalesup org>
+
+ * src/item-edit.c (item_edit_draw): make item edit use the same font size
+ than the sheet cell.
+
2009-09-02 Jean Brefort <jean brefort normalesup org>
* src/item-bar.c (item_bar_motion): don't grab the item from there.
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 9013c1d..c7cb8de 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-03 Jean Brefort <jean brefort normalesup org>
+
+ * dialog-printer-setup.c (margin_preview_page_destroy),
+ (margin_preview_page_create): fixed canvas update.
+
2009-09-01 Jean Brefort <jean brefort normalesup org>
* dialog-autoformat.c (previews_load): renamed GOColor macros.
diff --git a/src/dialogs/dialog-printer-setup.c b/src/dialogs/dialog-printer-setup.c
index 9db330c..e7d19dc 100644
--- a/src/dialogs/dialog-printer-setup.c
+++ b/src/dialogs/dialog-printer-setup.c
@@ -226,7 +226,7 @@ static void
margin_preview_page_destroy (PrinterSetupState *state)
{
if (state->preview.group) {
- gtk_object_destroy (GTK_OBJECT (state->preview.group));
+ g_object_unref (G_OBJECT (state->preview.group));
state->preview.group = NULL;
}
}
@@ -448,6 +448,8 @@ margin_preview_page_create (PrinterSetupState *state)
style->line.color = GO_RGBA_BLACK;
style->line.width = 1.;
+ goc_item_invalidate (pi->group);
+
draw_margins (state, x1, y1, x2, y2);
}
diff --git a/src/item-edit.c b/src/item-edit.c
index dec44b3..b148f82 100644
--- a/src/item-edit.c
+++ b/src/item-edit.c
@@ -93,7 +93,6 @@ item_edit_draw (GocItem const *item, cairo_t *cr)
{
ItemEdit const *ie = ITEM_EDIT (item);
int top, left;
- PangoLayout *layout;
GOColor color;
int x0, y0, x1, y1; /* in widget coordinates */
@@ -113,15 +112,12 @@ item_edit_draw (GocItem const *item, cairo_t *cr)
color = GO_GDK_TO_UINT (gtk_widget_get_style (GTK_WIDGET (item->canvas))->black);
cairo_set_source_rgba (cr, GO_COLOR_TO_CAIRO (color));
cairo_move_to (cr, left, top);
- layout = pango_cairo_create_layout (cr);
- pango_layout_set_text (layout, pango_layout_get_text (ie->layout), -1);
- pango_layout_set_attributes (layout, pango_layout_get_attributes (ie->layout));
- pango_cairo_show_layout (cr, layout);
+ pango_cairo_show_layout (cr, ie->layout);
if (ie->cursor_visible) {
PangoRectangle pos;
char const *text = gtk_entry_get_text (ie->entry);
int cursor_pos = gtk_editable_get_position (GTK_EDITABLE (ie->entry));
- pango_layout_index_to_pos (layout,
+ pango_layout_index_to_pos (ie->layout,
g_utf8_offset_to_pointer (text, cursor_pos) - text, &pos);
cairo_set_line_width (cr, 1.);
cairo_set_dash (cr, NULL, 0, 0.);
@@ -132,7 +128,6 @@ item_edit_draw (GocItem const *item, cairo_t *cr)
cairo_line_to (cr, left + PANGO_PIXELS (pos.x) + .5, top + PANGO_PIXELS (pos.y + pos.height) - 1);
cairo_stroke (cr);
}
- g_object_unref (layout);
}
static double
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]