X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkdialog.c;h=b88ca5f5ba5d637f51e1ade6beafebf6d0a07540;hb=e1edc998a2e9c557030d207533932b3120e13fe5;hp=6a1d51f147d323dc44244434c27aaf5a960951e8;hpb=3f0d330a6525cecca12569719adf210969e05fdf;p=~andy%2Fgtk diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index 6a1d51f14..b88ca5f5b 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -12,9 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ /* @@ -31,15 +29,17 @@ #include "gtkbutton.h" #include "gtkdialog.h" -#include "gtkhbbox.h" +#include "gtkbbox.h" #include "gtklabel.h" #include "gtkmarshalers.h" -#include "gtkvbox.h" +#include "gtkbox.h" +#include "gtkboxprivate.h" #include "gtkmain.h" #include "gtkintl.h" #include "gtkbindings.h" #include "gtkprivate.h" #include "gtkbuildable.h" +#include "gtksettings.h" /** * SECTION:gtkdialog @@ -56,7 +56,7 @@ * be packed. The bottom area is known as the * action_area. This is generally used for * packing buttons into the dialog which may perform functions such as - * cancel, ok, or apply. The two areas are separated by a #GtkHSeparator. + * cancel, ok, or apply. * * #GtkDialog boxes are created with a call to gtk_dialog_new() or * gtk_dialog_new_with_buttons(). gtk_dialog_new_with_buttons() is @@ -241,6 +241,8 @@ gtk_dialog_class_init (GtkDialogClass *class) widget_class->map = gtk_dialog_map; widget_class->style_updated = gtk_dialog_style_updated; + gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_DIALOG); + class->close = gtk_dialog_close; g_type_class_add_private (gobject_class, sizeof (GtkDialogPrivate)); @@ -349,6 +351,7 @@ update_spacings (GtkDialog *dialog) "action-area-border", &action_area_border, NULL); + gtk_container_set_border_width (GTK_CONTAINER (priv->vbox), content_area_border); if (!_gtk_box_get_spacing_set (GTK_BOX (priv->vbox))) @@ -397,6 +400,8 @@ gtk_dialog_init (GtkDialog *dialog) gtk_window_set_type_hint (GTK_WINDOW (dialog), GDK_WINDOW_TYPE_HINT_DIALOG); gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ON_PARENT); + + update_spacings (dialog); } static GtkBuildableIface *parent_buildable_iface; @@ -508,6 +513,8 @@ gtk_dialog_map (GtkWidget *widget) static void gtk_dialog_style_updated (GtkWidget *widget) { + GTK_WIDGET_CLASS (gtk_dialog_parent_class)->style_updated (widget); + update_spacings (GTK_DIALOG (widget)); } @@ -600,7 +607,7 @@ gtk_dialog_new_empty (const gchar *title, * @parent: (allow-none): Transient parent of the dialog, or %NULL * @flags: from #GtkDialogFlags * @first_button_text: (allow-none): stock ID or text to go in first button, or %NULL - * @Varargs: response ID for first button, then additional buttons, ending with %NULL + * @...: response ID for first button, then additional buttons, ending with %NULL * * Creates a new #GtkDialog with title @title (or %NULL for the default * title; see gtk_window_set_title()) and transient parent @parent (or @@ -634,7 +641,7 @@ gtk_dialog_new_empty (const gchar *title, * ]| * * Return value: a new #GtkDialog - **/ + */ GtkWidget* gtk_dialog_new_with_buttons (const gchar *title, GtkWindow *parent, @@ -765,7 +772,7 @@ gtk_dialog_add_action_widget (GtkDialog *dialog, * appended to the end of the dialog's action area. The button widget is * returned, but usually you don't need it. * - * Return value: (transfer none): the button widget that was added + * Return value: (transfer none): the #GtkButton widget that was added **/ GtkWidget* gtk_dialog_add_button (GtkDialog *dialog, @@ -821,13 +828,13 @@ gtk_dialog_add_buttons_valist (GtkDialog *dialog, * gtk_dialog_add_buttons: * @dialog: a #GtkDialog * @first_button_text: button text or stock ID - * @Varargs: response ID for first button, then more text-response_id pairs + * @...: response ID for first button, then more text-response_id pairs * * Adds more buttons, same as calling gtk_dialog_add_button() * repeatedly. The variable argument list should be %NULL-terminated * as with gtk_dialog_new_with_buttons(). Each button must have both * text and response ID. - **/ + */ void gtk_dialog_add_buttons (GtkDialog *dialog, const gchar *first_button_text, @@ -1099,9 +1106,9 @@ gtk_dialog_run (GtkDialog *dialog) ri.loop = g_main_loop_new (NULL, FALSE); - GDK_THREADS_LEAVE (); + gdk_threads_leave (); g_main_loop_run (ri.loop); - GDK_THREADS_ENTER (); + gdk_threads_enter (); g_main_loop_unref (ri.loop); @@ -1258,7 +1265,7 @@ gtk_dialog_set_alternative_button_order_valist (GtkDialog *dialog, * gtk_dialog_set_alternative_button_order: * @dialog: a #GtkDialog * @first_response_id: a response id used by one @dialog's buttons - * @Varargs: a list of more response ids of @dialog's buttons, terminated by -1 + * @...: a list of more response ids of @dialog's buttons, terminated by -1 * * Sets an alternative button order. If the * #GtkSettings:gtk-alternative-button-order setting is set to %TRUE, @@ -1323,7 +1330,8 @@ gtk_dialog_set_alternative_button_order (GtkDialog *dialog, * gtk_dialog_set_alternative_button_order_from_array: * @dialog: a #GtkDialog * @n_params: the number of response ids in @new_order - * @new_order: an array of response ids of @dialog's buttons + * @new_order: (array length=n_params): an array of response ids of + * @dialog's buttons * * Sets an alternative button order. If the * #GtkSettings:gtk-alternative-button-order setting is set to %TRUE,