diff options
author | Antti Kaijanmäki <antti.kaijanmaki@canonical.com> | 2012-08-30 14:27:42 +0800 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-07-03 11:29:20 +0200 |
commit | fff8de7a8afa69203d096d769d29ac57dc318955 (patch) | |
tree | f4a7e3385ba6dcb2a454abfeb59c7579fca9b003 | |
parent | 90d328a392a538675a8c538d7fa1b10dc4f229c0 (diff) | |
download | network-manager-applet-fff8de7a8afa69203d096d769d29ac57dc318955.tar.gz |
applet: always center dialogs on the screen
https://bugzilla.gnome.org/show_bug.cgi?id=783938
-rw-r--r-- | src/applet-dialogs.c | 4 | ||||
-rw-r--r-- | src/utils/utils.c | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/applet-dialogs.c b/src/applet-dialogs.c index 662da03e..31824304 100644 --- a/src/applet-dialogs.c +++ b/src/applet-dialogs.c @@ -39,6 +39,7 @@ info_dialog_show_error (const char *err) dialog = gtk_message_dialog_new_with_markup (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s", _("Error displaying connection information:"), err); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ALWAYS); gtk_window_present (GTK_WINDOW (dialog)); g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog); } @@ -973,6 +974,7 @@ applet_info_dialog_show (NMApplet *applet) g_signal_connect (dialog, "delete-event", G_CALLBACK (gtk_widget_hide_on_delete), dialog); g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_hide), dialog); gtk_widget_realize (dialog); + gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ALWAYS); gtk_window_present_with_time (GTK_WINDOW (dialog), gdk_x11_get_server_time (gtk_widget_get_window (dialog))); } @@ -1028,6 +1030,7 @@ applet_mobile_password_dialog_new (NMConnection *connection, dialog = GTK_DIALOG (gtk_dialog_new ()); gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ALWAYS); gtk_window_set_title (GTK_WINDOW (dialog), _("Mobile broadband network password")); gtk_dialog_add_button (dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT); @@ -1365,6 +1368,7 @@ applet_mobile_pin_dialog_new (const char *unlock_required, } else g_assert_not_reached (); + gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ALWAYS); gtk_window_set_title (GTK_WINDOW (dialog), title); widget = GTK_WIDGET (gtk_builder_get_object (builder, "header_label")); diff --git a/src/utils/utils.c b/src/utils/utils.c index 684987b8..c355be3b 100644 --- a/src/utils/utils.c +++ b/src/utils/utils.c @@ -202,6 +202,8 @@ utils_show_error_dialog (const char *title, "%s", text1); + gtk_window_set_position (GTK_WINDOW (err_dialog), GTK_WIN_POS_CENTER_ALWAYS); + if (text2) gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (err_dialog), "%s", text2); if (title) |