[gnome-bluetooth/meego] meego: don't hide the visible label, but fix its size (BMC#1179, #7373)



commit 4b936b764df235ca0433055ae4cdc5864baccc01
Author: Ross Burton <ross linux intel com>
Date:   Tue Oct 12 15:20:23 2010 +0100

    meego: don't hide the visible label, but fix its size (BMC#1179, #7373)
    
    Previously we wrapped at a hardcoded newline but that doesn't work to well when
    translated.  Now we fix the width of the label at 200px, never hide it (only set
    it to "") to ensure that the width of the column never changes (#1179), and
    remove the hardcoded newline (#7373).

 moblin/moblin-panel.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/moblin/moblin-panel.c b/moblin/moblin-panel.c
index 1b6c0c0..374e7c0 100644
--- a/moblin/moblin-panel.c
+++ b/moblin/moblin-panel.c
@@ -218,10 +218,9 @@ update_visible (gpointer data)
 
 	if (priv->visible_countdown > 0) {
 		gtk_widget_hide (priv->visible_button);
-		gtk_widget_show (priv->visible_label);
 
 		time = totem_time_to_string_text (priv->visible_countdown * 1000);
-		label = g_strdup_printf (_("Your computer is visible on\n"
+		label = g_strdup_printf (_("Your computer is visible on "
 					   "Bluetooth for %s."), time);
 		gtk_label_set_text (GTK_LABEL (priv->visible_label), label);
 		g_free (label);
@@ -234,7 +233,8 @@ update_visible (gpointer data)
 		bluetooth_client_set_discoverable (priv->client, FALSE, 0);
 
 		gtk_widget_show (priv->visible_button);
-		gtk_widget_hide (priv->visible_label);
+
+		gtk_label_set_text (GTK_LABEL (priv->visible_label), "");
 
 		return FALSE;
 	}
@@ -1647,9 +1647,10 @@ create_devices_page (MoblinPanel *self)
 	gtk_box_pack_start (GTK_BOX (hbox), priv->power_switch, FALSE, FALSE, 4);
 
 	priv->visible_label = gtk_label_new (NULL);
+	gtk_widget_set_size_request (priv->visible_label, 200, -1);
 	gtk_misc_set_alignment (GTK_MISC (priv->visible_label), 0.0, 0.5);
 	gtk_label_set_line_wrap (GTK_LABEL (priv->visible_label), TRUE);
-	gtk_label_set_width_chars (GTK_LABEL (priv->visible_label), 30);
+	gtk_widget_show (priv->visible_label);
 	gtk_box_pack_start (GTK_BOX (vbox2), priv->visible_label, FALSE, FALSE, 4);
 
 	priv->visible_button = gtk_button_new_with_label (_("Make visible on Bluetooth"));



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