[network-manager-applet/aleksander/mm1-applet: 4/13] applet: resize PIN/PUK dialog after hiding the error message



commit 3f0f7b8f120ad9a8871a37c5410df8177355e4ad
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Tue Dec 18 19:51:41 2012 +0100

    applet: resize PIN/PUK dialog after hiding the error message
    
    The dialog will show an error string in the progress message dialog when some
    error happens, and once the user does something (e.g. start to re-type the error
    string) we would be clearing that error message.
    
    But, instead of just clearing the error message leaving the label widget with
    no text, better completely hide the label and resize the widget accordingly.

 src/applet-dialogs.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/applet-dialogs.c b/src/applet-dialogs.c
index e36ea8e..aae2aba 100644
--- a/src/applet-dialogs.c
+++ b/src/applet-dialogs.c
@@ -1069,9 +1069,12 @@ mpd_entry_changed (GtkWidget *widget, gpointer user_data)
 	valid = TRUE;
 
 done:
-	/* Clear any error text in the progress label now that the user has changed something */
+	/* User changed something, so hide the progress label completely and resize
+	 * the dialog so that it fits the minimum vertical space */
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "progress_label"));
 	gtk_label_set_text (GTK_LABEL (widget), "");
+	gtk_widget_hide (widget);
+	gtk_window_resize (GTK_WINDOW (dialog), 1, 1);
 
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "unlock_button"));
 	g_warn_if_fail (widget != NULL);



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