emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105046: Better fix that keeps corret


From: Jan D.
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105046: Better fix that keeps corret margins in tooltip.
Date: Fri, 08 Jul 2011 19:57:55 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105046
fixes bug(s): http://debbugs.gnu.org/8591
committer: Jan D. <address@hidden>
branch nick: trunk
timestamp: Fri 2011-07-08 19:57:55 +0200
message:
  Better fix that keeps corret margins in tooltip.
  
  * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
  (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
  wrong.
modified:
  src/ChangeLog
  src/gtkutil.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-07-08 17:25:17 +0000
+++ b/src/ChangeLog     2011-07-08 17:57:55 +0000
@@ -1,5 +1,11 @@
 2011-07-08  Jan Djärv  <address@hidden>
 
+       * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
+       (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
+       wrong (Bug#8591).
+
+2011-07-08  Jan Djärv  <address@hidden>
+
        * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
        Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
        (xg_hide_tooltip): Fix comment.

=== modified file 'src/gtkutil.c'
--- a/src/gtkutil.c     2011-07-08 17:25:17 +0000
+++ b/src/gtkutil.c     2011-07-08 17:57:55 +0000
@@ -633,6 +633,9 @@
   struct x_output *x = f->output_data.x;
   if (x->ttip_widget == NULL)
     {
+      GtkWidget *p;
+      GList *list, *iter;
+
       g_object_set (G_OBJECT (widget), "has-tooltip", FALSE, NULL);
       x->ttip_widget = tooltip;
       g_object_ref (G_OBJECT (tooltip));
@@ -640,6 +643,19 @@
       g_object_ref (G_OBJECT (x->ttip_lbl));
       gtk_tooltip_set_custom (tooltip, x->ttip_lbl);
       x->ttip_window = GTK_WINDOW (gtk_widget_get_toplevel (x->ttip_lbl));
+
+      /* Change stupid Gtk+ default line wrapping.  */
+      p = gtk_widget_get_parent (x->ttip_lbl);
+      list = gtk_container_get_children (GTK_CONTAINER (p));
+      iter;
+      for (iter = list; iter; iter = g_list_next (iter))
+        {
+          GtkWidget *w = GTK_WIDGET (iter->data);
+          if (GTK_IS_LABEL (w))
+            gtk_label_set_line_wrap (GTK_LABEL (w), FALSE);
+        }
+      g_list_free (list);
+
       /* ATK needs an empty title for some reason.  */
       gtk_window_set_title (x->ttip_window, "");
       /* Realize so we can safely get screen later on.  */
@@ -700,9 +716,7 @@
   /* Put our dummy widget in so we can get callbacks for unrealize and
      hierarchy-changed.  */
   gtk_tooltip_set_custom (x->ttip_widget, widget);
-
-  gtk_tooltip_set_text (x->ttip_widget, "");
-  gtk_label_set_text (GTK_LABEL (x->ttip_lbl), SSDATA (encoded_string));
+  gtk_tooltip_set_text (x->ttip_widget, SSDATA (encoded_string));
   gtk_widget_get_preferred_size (GTK_WIDGET (x->ttip_window), NULL, &req);
   if (width) *width = req.width;
   if (height) *height = req.height;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]