[gnumeric] Cell comments: avoid using text view which sizes weirdly.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Cell comments: avoid using text view which sizes weirdly.
- Date: Sat, 20 Apr 2013 00:34:39 +0000 (UTC)
commit 5eb9a3153388f14a521a79fd3031c22da742c8ec
Author: Morten Welinder <terra gnome org>
Date: Fri Apr 19 20:34:07 2013 -0400
Cell comments: avoid using text view which sizes weirdly.
ChangeLog | 3 +++
NEWS | 1 +
src/sheet-control-gui.c | 44 +++++++++++++++++---------------------------
3 files changed, 21 insertions(+), 27 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 55fb549..55bfc2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2013-04-19 Morten Welinder <terra gnome org>
+ * src/sheet-control-gui.c (scg_comment_display): Abandon the text
+ view approach. Fixes #689283.
+
* src/wbc-gtk.c (wbc_gtk_init_borders): Show also in vertical
mode.
(wbc_gtk_init_color_fore): Ditto.
diff --git a/NEWS b/NEWS
index cc21b41..581169c 100644
--- a/NEWS
+++ b/NEWS
@@ -56,6 +56,7 @@ Morten:
* Fix criticals in insert-comment dialog.
* Improve vertical toolbars. [#590889]
* Merge long format toolbar into regular one.
+ * Work around gtk+ behaviour change. [#689283]
--------------------------------------------------------------------------
Gnumeric 1.12.1
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index ce5fed3..ee8167d 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -3025,34 +3025,28 @@ scg_comment_display (SheetControlGUI *scg, GnmComment *cc,
g_return_if_fail (IS_CELL_COMMENT (cc));
if (scg->comment.item == NULL) {
- GtkWidget *text, *frame;
- GtkTextBuffer *buffer;
- GtkWindow *toplevel = wbcg_toplevel (scg_wbcg (scg));
- GdkScreen *screen = gtk_window_get_screen (toplevel);
+ GtkWidget *label;
char *comment_text;
- char const *comment_author;
PangoAttrList *comment_markup;
+#if 0
+ char const *comment_author;
+#endif
- scg->comment.item = gtk_window_new (GTK_WINDOW_POPUP);
- gtk_window_set_screen (GTK_WINDOW (scg->comment.item), screen);
- gtk_window_move (GTK_WINDOW (scg->comment.item), x+10, y+10);
+ g_object_get (G_OBJECT (cc),
+ "text", &comment_text,
+ "markup", &comment_markup,
+ NULL);
+ label = gtk_label_new (comment_text);
+ gtk_label_set_attributes (GTK_LABEL (label), comment_markup);
+ g_free (comment_text);
- text = gtk_text_view_new ();
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text), GTK_WRAP_NONE);
- gtk_text_view_set_editable (GTK_TEXT_VIEW (text), FALSE);
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
- go_create_std_tags_for_buffer (buffer);
+ gnumeric_convert_to_tooltip (GTK_WIDGET (scg->grid), label);
- g_object_get (G_OBJECT (cc), "text", &comment_text,
- "markup", &comment_markup, NULL);
-
- if (comment_text != NULL) {
- gtk_text_buffer_set_text (buffer, comment_text, -1);
- gnm_load_pango_attributes_into_buffer
- (comment_markup, buffer, comment_text);
- g_free (comment_text);
- }
+ scg->comment.item = gtk_widget_get_toplevel (label);
+ gtk_window_move (GTK_WINDOW (scg->comment.item),
+ x + 10, y + 10);
+#if 0
comment_author = cell_comment_author_get (cc);
if (comment_author != NULL) {
GtkTextIter iter;
@@ -3063,12 +3057,8 @@ scg_comment_display (SheetControlGUI *scg, GnmComment *cc,
gtk_text_buffer_insert_with_tags_by_name
(buffer, &iter, ":\n", -1, "PANGO_WEIGHT_BOLD", NULL);
}
+#endif
- frame = gtk_frame_new (NULL);
- gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
-
- gtk_container_add (GTK_CONTAINER (scg->comment.item), frame);
- gtk_container_add (GTK_CONTAINER (frame), text);
gtk_widget_show_all (scg->comment.item);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]