[gedit] Sync tip text on tab state change



commit f8825609e338d0cb8c0bbd54f95ca314726d9818
Author: Paolo Borelli <pborelli gnome org>
Date:   Mon Jan 18 00:31:24 2010 +0100

    Sync tip text on tab state change

 gedit/gedit-tab-label.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/gedit/gedit-tab-label.c b/gedit/gedit-tab-label.c
index 1203ac0..7ccb129 100644
--- a/gedit/gedit-tab-label.c
+++ b/gedit/gedit-tab-label.c
@@ -93,6 +93,18 @@ close_button_clicked_cb (GtkWidget     *widget,
 }
 
 static void
+sync_tip (GeditTab *tab, GeditTabLabel *tab_label)
+{
+	gchar *str;
+
+	str = _gedit_tab_get_tooltips (tab);
+	g_return_if_fail (str != NULL);
+
+	gtk_widget_set_tooltip_markup (tab_label->priv->ebox, str);
+	g_free (str);
+}
+
+static void
 sync_name (GeditTab *tab, GParamSpec *pspec, GeditTabLabel *tab_label)
 {
 	gchar *str;
@@ -105,11 +117,7 @@ sync_name (GeditTab *tab, GParamSpec *pspec, GeditTabLabel *tab_label)
 	gtk_label_set_text (GTK_LABEL (tab_label->priv->label), str);
 	g_free (str);
 
-	str = _gedit_tab_get_tooltips (tab);
-	g_return_if_fail (str != NULL);
-
-	gtk_widget_set_tooltip_markup (tab_label->priv->ebox, str);
-	g_free (str);
+	sync_tip (tab, tab_label);
 }
 
 static void
@@ -160,6 +168,9 @@ sync_state (GeditTab *tab, GParamSpec *pspec, GeditTabLabel *tab_label)
 		gtk_spinner_stop (GTK_SPINNER (tab_label->priv->spinner));
 #endif
 	}
+
+	/* sync tip since encoding is known only after load/save end */
+	sync_tip (tab, tab_label);
 }
 
 static void



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