Commit 7f2cc85d authored by Javier Jardón's avatar Javier Jardón

Use accessor functions to access GtkDialog

parent 80df961e
...@@ -229,6 +229,7 @@ static void ...@@ -229,6 +229,7 @@ static void
open_display_cb (GtkWidget *button, open_display_cb (GtkWidget *button,
ChangeDisplayInfo *info) ChangeDisplayInfo *info)
{ {
GtkWidget *content_area;
GtkWidget *dialog; GtkWidget *dialog;
GtkWidget *display_entry; GtkWidget *display_entry;
GtkWidget *dialog_label; GtkWidget *dialog_label;
...@@ -248,8 +249,10 @@ open_display_cb (GtkWidget *button, ...@@ -248,8 +249,10 @@ open_display_cb (GtkWidget *button,
dialog_label = dialog_label =
gtk_label_new ("Please enter the name of\nthe new display\n"); gtk_label_new ("Please enter the name of\nthe new display\n");
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog_label); content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), display_entry);
gtk_container_add (GTK_CONTAINER (content_area), dialog_label);
gtk_container_add (GTK_CONTAINER (content_area), display_entry);
gtk_widget_grab_focus (display_entry); gtk_widget_grab_focus (display_entry);
gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (dialog))); gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (dialog)));
...@@ -599,6 +602,7 @@ do_changedisplay (GtkWidget *do_widget) ...@@ -599,6 +602,7 @@ do_changedisplay (GtkWidget *do_widget)
if (!info) if (!info)
{ {
GtkWidget *content_area;
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *frame; GtkWidget *frame;
...@@ -618,11 +622,11 @@ do_changedisplay (GtkWidget *do_widget) ...@@ -618,11 +622,11 @@ do_changedisplay (GtkWidget *do_widget)
g_signal_connect (info->window, "destroy", g_signal_connect (info->window, "destroy",
G_CALLBACK (destroy_cb), &info); G_CALLBACK (destroy_cb), &info);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (info->window));
vbox = gtk_vbox_new (FALSE, 5); vbox = gtk_vbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (info->window)->vbox), vbox,
TRUE, TRUE, 0);
frame = create_display_frame (info); frame = create_display_frame (info);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
......
...@@ -33,6 +33,7 @@ static void ...@@ -33,6 +33,7 @@ static void
interactive_dialog_clicked (GtkButton *button, interactive_dialog_clicked (GtkButton *button,
gpointer user_data) gpointer user_data)
{ {
GtkWidget *content_area;
GtkWidget *dialog; GtkWidget *dialog;
GtkWidget *hbox; GtkWidget *hbox;
GtkWidget *stock; GtkWidget *stock;
...@@ -51,9 +52,11 @@ interactive_dialog_clicked (GtkButton *button, ...@@ -51,9 +52,11 @@ interactive_dialog_clicked (GtkButton *button,
GTK_RESPONSE_CANCEL, GTK_RESPONSE_CANCEL,
NULL); NULL);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
hbox = gtk_hbox_new (FALSE, 8); hbox = gtk_hbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 8); gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE, 0);
stock = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG); stock = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG);
gtk_box_pack_start (GTK_BOX (hbox), stock, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), stock, FALSE, FALSE, 0);
......
...@@ -11,6 +11,7 @@ static GtkWidget *window = NULL; ...@@ -11,6 +11,7 @@ static GtkWidget *window = NULL;
GtkWidget * GtkWidget *
do_entry_buffer (GtkWidget *do_widget) do_entry_buffer (GtkWidget *do_widget)
{ {
GtkWidget *content_area;
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *label; GtkWidget *label;
GtkWidget *entry; GtkWidget *entry;
...@@ -31,8 +32,10 @@ do_entry_buffer (GtkWidget *do_widget) ...@@ -31,8 +32,10 @@ do_entry_buffer (GtkWidget *do_widget)
g_signal_connect (window, "destroy", g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window); G_CALLBACK (gtk_widget_destroyed), &window);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
vbox = gtk_vbox_new (FALSE, 5); vbox = gtk_vbox_new (FALSE, 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new (NULL); label = gtk_label_new (NULL);
......
...@@ -37,6 +37,7 @@ create_completion_model (void) ...@@ -37,6 +37,7 @@ create_completion_model (void)
GtkWidget * GtkWidget *
do_entry_completion (GtkWidget *do_widget) do_entry_completion (GtkWidget *do_widget)
{ {
GtkWidget *content_area;
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *label; GtkWidget *label;
GtkWidget *entry; GtkWidget *entry;
...@@ -58,8 +59,10 @@ do_entry_completion (GtkWidget *do_widget) ...@@ -58,8 +59,10 @@ do_entry_completion (GtkWidget *do_widget)
g_signal_connect (window, "destroy", g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window); G_CALLBACK (gtk_widget_destroyed), &window);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
vbox = gtk_vbox_new (FALSE, 5); vbox = gtk_vbox_new (FALSE, 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new (NULL); label = gtk_label_new (NULL);
......
...@@ -13,6 +13,7 @@ static GtkWidget *window = NULL; ...@@ -13,6 +13,7 @@ static GtkWidget *window = NULL;
GtkWidget * GtkWidget *
do_expander (GtkWidget *do_widget) do_expander (GtkWidget *do_widget)
{ {
GtkWidget *content_area;
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *label; GtkWidget *label;
GtkWidget *expander; GtkWidget *expander;
...@@ -32,8 +33,10 @@ do_expander (GtkWidget *do_widget) ...@@ -32,8 +33,10 @@ do_expander (GtkWidget *do_widget)
g_signal_connect (window, "destroy", g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window); G_CALLBACK (gtk_widget_destroyed), &window);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
vbox = gtk_vbox_new (FALSE, 5); vbox = gtk_vbox_new (FALSE, 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("Expander demo. Click on the triangle for details."); label = gtk_label_new ("Expander demo. Click on the triangle for details.");
......
...@@ -241,6 +241,7 @@ entry_populate_popup (GtkEntry *entry, ...@@ -241,6 +241,7 @@ entry_populate_popup (GtkEntry *entry,
GtkWidget * GtkWidget *
do_search_entry (GtkWidget *do_widget) do_search_entry (GtkWidget *do_widget)
{ {
GtkWidget *content_area;
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *hbox; GtkWidget *hbox;
GtkWidget *label; GtkWidget *label;
...@@ -263,8 +264,10 @@ do_search_entry (GtkWidget *do_widget) ...@@ -263,8 +264,10 @@ do_search_entry (GtkWidget *do_widget)
g_signal_connect (window, "destroy", g_signal_connect (window, "destroy",
G_CALLBACK (search_entry_destroyed), &window); G_CALLBACK (search_entry_destroyed), &window);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
vbox = gtk_vbox_new (FALSE, 5); vbox = gtk_vbox_new (FALSE, 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new (NULL); label = gtk_label_new (NULL);
......
...@@ -82,6 +82,7 @@ toggle_grouping (GtkToggleButton *check_button, ...@@ -82,6 +82,7 @@ toggle_grouping (GtkToggleButton *check_button,
GtkWidget * GtkWidget *
do_sizegroup (GtkWidget *do_widget) do_sizegroup (GtkWidget *do_widget)
{ {
GtkWidget *content_area;
GtkWidget *table; GtkWidget *table;
GtkWidget *frame; GtkWidget *frame;
GtkWidget *vbox; GtkWidget *vbox;
...@@ -115,8 +116,10 @@ do_sizegroup (GtkWidget *do_widget) ...@@ -115,8 +116,10 @@ do_sizegroup (GtkWidget *do_widget)
g_signal_connect (window, "destroy", g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window); G_CALLBACK (gtk_widget_destroyed), &window);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
vbox = gtk_vbox_new (FALSE, 5); vbox = gtk_vbox_new (FALSE, 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
......
...@@ -27,6 +27,7 @@ on_stop_clicked (GtkButton *button, gpointer user_data) ...@@ -27,6 +27,7 @@ on_stop_clicked (GtkButton *button, gpointer user_data)
GtkWidget * GtkWidget *
do_spinner (GtkWidget *do_widget) do_spinner (GtkWidget *do_widget)
{ {
GtkWidget *content_area;
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *hbox; GtkWidget *hbox;
GtkWidget *button; GtkWidget *button;
...@@ -47,8 +48,10 @@ do_spinner (GtkWidget *do_widget) ...@@ -47,8 +48,10 @@ do_spinner (GtkWidget *do_widget)
g_signal_connect (window, "destroy", g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window); G_CALLBACK (gtk_widget_destroyed), &window);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
vbox = gtk_vbox_new (FALSE, 5); vbox = gtk_vbox_new (FALSE, 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
/* Sensitive */ /* Sensitive */
......
...@@ -141,23 +141,27 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag) ...@@ -141,23 +141,27 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
{ {
GtkColorSelectionDialogPriv *priv; GtkColorSelectionDialogPriv *priv;
GtkDialog *dialog = GTK_DIALOG (colorseldiag); GtkDialog *dialog = GTK_DIALOG (colorseldiag);
GtkWidget *action_area, *content_area;
colorseldiag->priv = G_TYPE_INSTANCE_GET_PRIVATE (colorseldiag, colorseldiag->priv = G_TYPE_INSTANCE_GET_PRIVATE (colorseldiag,
GTK_TYPE_COLOR_SELECTION_DIALOG, GTK_TYPE_COLOR_SELECTION_DIALOG,
GtkColorSelectionDialogPriv); GtkColorSelectionDialogPriv);
priv = colorseldiag->priv; priv = colorseldiag->priv;
content_area = gtk_dialog_get_content_area (dialog);
action_area = gtk_dialog_get_action_area (dialog);
gtk_dialog_set_has_separator (dialog, FALSE); gtk_dialog_set_has_separator (dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5); gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6); gtk_box_set_spacing (GTK_BOX (action_area), 6);
priv->colorsel = gtk_color_selection_new (); priv->colorsel = gtk_color_selection_new ();
gtk_container_set_border_width (GTK_CONTAINER (priv->colorsel), 5); gtk_container_set_border_width (GTK_CONTAINER (priv->colorsel), 5);
gtk_color_selection_set_has_palette (GTK_COLOR_SELECTION (priv->colorsel), FALSE); gtk_color_selection_set_has_palette (GTK_COLOR_SELECTION (priv->colorsel), FALSE);
gtk_color_selection_set_has_opacity_control (GTK_COLOR_SELECTION (priv->colorsel), FALSE); gtk_color_selection_set_has_opacity_control (GTK_COLOR_SELECTION (priv->colorsel), FALSE);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (colorseldiag)->vbox), priv->colorsel); gtk_container_add (GTK_CONTAINER (content_area), priv->colorsel);
gtk_widget_show (priv->colorsel); gtk_widget_show (priv->colorsel);
priv->cancel_button = gtk_dialog_add_button (dialog, priv->cancel_button = gtk_dialog_add_button (dialog,
......
...@@ -963,6 +963,8 @@ static void ...@@ -963,6 +963,8 @@ static void
populate_dialog (GtkCustomPaperUnixDialog *dialog) populate_dialog (GtkCustomPaperUnixDialog *dialog)
{ {
GtkCustomPaperUnixDialogPrivate *priv = dialog->priv; GtkCustomPaperUnixDialogPrivate *priv = dialog->priv;
GtkDialog *cpu_dialog = GTK_DIALOG (dialog);
GtkWidget *action_area, *content_area;
GtkWidget *image, *table, *label, *widget, *frame, *combo; GtkWidget *image, *table, *label, *widget, *frame, *combo;
GtkWidget *hbox, *vbox, *treeview, *scrolled, *button_box, *button; GtkWidget *hbox, *vbox, *treeview, *scrolled, *button_box, *button;
GtkCellRenderer *cell; GtkCellRenderer *cell;
...@@ -971,15 +973,18 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog) ...@@ -971,15 +973,18 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog)
GtkTreeSelection *selection; GtkTreeSelection *selection;
GtkUnit user_units; GtkUnit user_units;
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); content_area = gtk_dialog_get_content_area (cpu_dialog);
action_area = gtk_dialog_get_action_area (cpu_dialog);
gtk_dialog_set_has_separator (cpu_dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2); /* 2 * 5 + 2 = 12 */ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5); gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6); gtk_box_set_spacing (GTK_BOX (action_area), 6);
hbox = gtk_hbox_new (FALSE, 18); hbox = gtk_hbox_new (FALSE, 18);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox); gtk_widget_show (hbox);
vbox = gtk_vbox_new (FALSE, 6); vbox = gtk_vbox_new (FALSE, 6);
......
...@@ -80,6 +80,7 @@ gtk_file_chooser_dialog_class_init (GtkFileChooserDialogClass *class) ...@@ -80,6 +80,7 @@ gtk_file_chooser_dialog_class_init (GtkFileChooserDialogClass *class)
static void static void
gtk_file_chooser_dialog_init (GtkFileChooserDialog *dialog) gtk_file_chooser_dialog_init (GtkFileChooserDialog *dialog)
{ {
GtkWidget *action_area, *content_area;
GtkFileChooserDialogPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog, GtkFileChooserDialogPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog,
GTK_TYPE_FILE_CHOOSER_DIALOG, GTK_TYPE_FILE_CHOOSER_DIALOG,
GtkFileChooserDialogPrivate); GtkFileChooserDialogPrivate);
...@@ -88,10 +89,13 @@ gtk_file_chooser_dialog_init (GtkFileChooserDialog *dialog) ...@@ -88,10 +89,13 @@ gtk_file_chooser_dialog_init (GtkFileChooserDialog *dialog)
dialog->priv = priv; dialog->priv = priv;
dialog->priv->response_requested = FALSE; dialog->priv->response_requested = FALSE;
content_area = gtk_dialog_get_content_area (fc_dialog);
action_area = gtk_dialog_get_action_area (fc_dialog);
gtk_dialog_set_has_separator (fc_dialog, FALSE); gtk_dialog_set_has_separator (fc_dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (fc_dialog), 5); gtk_container_set_border_width (GTK_CONTAINER (fc_dialog), 5);
gtk_box_set_spacing (GTK_BOX (fc_dialog->vbox), 2); /* 2 * 5 + 2 = 12 */ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (fc_dialog->action_area), 5); gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
/* We do a signal connection here rather than overriding the method in /* We do a signal connection here rather than overriding the method in
* class_init because GtkDialog::response is a RUN_LAST signal. We want *our* * class_init because GtkDialog::response is a RUN_LAST signal. We want *our*
...@@ -126,6 +130,8 @@ static void ...@@ -126,6 +130,8 @@ static void
file_chooser_widget_file_activated (GtkFileChooser *chooser, file_chooser_widget_file_activated (GtkFileChooser *chooser,
GtkFileChooserDialog *dialog) GtkFileChooserDialog *dialog)
{ {
GtkDialog *fc_dialog = GTK_DIALOG (dialog);
GtkWidget *action_area;
GList *children, *l; GList *children, *l;
if (gtk_window_activate_default (GTK_WINDOW (dialog))) if (gtk_window_activate_default (GTK_WINDOW (dialog)))
...@@ -134,8 +140,8 @@ file_chooser_widget_file_activated (GtkFileChooser *chooser, ...@@ -134,8 +140,8 @@ file_chooser_widget_file_activated (GtkFileChooser *chooser,
/* There probably isn't a default widget, so make things easier for the /* There probably isn't a default widget, so make things easier for the
* programmer by looking for a reasonable button on our own. * programmer by looking for a reasonable button on our own.
*/ */
action_area = gtk_dialog_get_action_area (fc_dialog);
children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area)); children = gtk_container_get_children (GTK_CONTAINER (action_area));
for (l = children; l; l = l->next) for (l = children; l; l = l->next)
{ {
...@@ -143,7 +149,7 @@ file_chooser_widget_file_activated (GtkFileChooser *chooser, ...@@ -143,7 +149,7 @@ file_chooser_widget_file_activated (GtkFileChooser *chooser,
int response_id; int response_id;
widget = GTK_WIDGET (l->data); widget = GTK_WIDGET (l->data);
response_id = gtk_dialog_get_response_for_widget (GTK_DIALOG (dialog), widget); response_id = gtk_dialog_get_response_for_widget (fc_dialog, widget);
if (is_stock_accept_response_id (response_id)) if (is_stock_accept_response_id (response_id))
{ {
gtk_widget_activate (widget); /* Should we gtk_dialog_response (dialog, response_id) instead? */ gtk_widget_activate (widget); /* Should we gtk_dialog_response (dialog, response_id) instead? */
...@@ -221,6 +227,8 @@ static void ...@@ -221,6 +227,8 @@ static void
file_chooser_widget_response_requested (GtkWidget *widget, file_chooser_widget_response_requested (GtkWidget *widget,
GtkFileChooserDialog *dialog) GtkFileChooserDialog *dialog)
{ {
GtkDialog *fc_dialog = GTK_DIALOG (dialog);
GtkWidget *action_area;
GList *children, *l; GList *children, *l;
dialog->priv->response_requested = TRUE; dialog->priv->response_requested = TRUE;
...@@ -231,8 +239,8 @@ file_chooser_widget_response_requested (GtkWidget *widget, ...@@ -231,8 +239,8 @@ file_chooser_widget_response_requested (GtkWidget *widget,
/* There probably isn't a default widget, so make things easier for the /* There probably isn't a default widget, so make things easier for the
* programmer by looking for a reasonable button on our own. * programmer by looking for a reasonable button on our own.
*/ */
action_area = gtk_dialog_get_action_area (fc_dialog);
children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area)); children = gtk_container_get_children (GTK_CONTAINER (action_area));
for (l = children; l; l = l->next) for (l = children; l; l = l->next)
{ {
...@@ -240,7 +248,7 @@ file_chooser_widget_response_requested (GtkWidget *widget, ...@@ -240,7 +248,7 @@ file_chooser_widget_response_requested (GtkWidget *widget,
int response_id; int response_id;
widget = GTK_WIDGET (l->data); widget = GTK_WIDGET (l->data);
response_id = gtk_dialog_get_response_for_widget (GTK_DIALOG (dialog), widget); response_id = gtk_dialog_get_response_for_widget (fc_dialog, widget);
if (is_stock_accept_response_id (response_id)) if (is_stock_accept_response_id (response_id))
{ {
gtk_widget_activate (widget); /* Should we gtk_dialog_response (dialog, response_id) instead? */ gtk_widget_activate (widget); /* Should we gtk_dialog_response (dialog, response_id) instead? */
...@@ -260,6 +268,7 @@ gtk_file_chooser_dialog_constructor (GType type, ...@@ -260,6 +268,7 @@ gtk_file_chooser_dialog_constructor (GType type,
GObjectConstructParam *construct_params) GObjectConstructParam *construct_params)
{ {
GtkFileChooserDialogPrivate *priv; GtkFileChooserDialogPrivate *priv;
GtkWidget *content_area;
GObject *object; GObject *object;
object = G_OBJECT_CLASS (gtk_file_chooser_dialog_parent_class)->constructor (type, object = G_OBJECT_CLASS (gtk_file_chooser_dialog_parent_class)->constructor (type,
...@@ -282,8 +291,10 @@ gtk_file_chooser_dialog_constructor (GType type, ...@@ -282,8 +291,10 @@ gtk_file_chooser_dialog_constructor (GType type,
g_signal_connect (priv->widget, "response-requested", g_signal_connect (priv->widget, "response-requested",
G_CALLBACK (file_chooser_widget_response_requested), object); G_CALLBACK (file_chooser_widget_response_requested), object);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (object));
gtk_container_set_border_width (GTK_CONTAINER (priv->widget), 5); gtk_container_set_border_width (GTK_CONTAINER (priv->widget), 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (object)->vbox), priv->widget, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (content_area), priv->widget, TRUE, TRUE, 0);
gtk_widget_show (priv->widget); gtk_widget_show (priv->widget);
...@@ -338,7 +349,10 @@ foreach_ensure_default_response_cb (GtkWidget *widget, ...@@ -338,7 +349,10 @@ foreach_ensure_default_response_cb (GtkWidget *widget,
static void static void
ensure_default_response (GtkFileChooserDialog *dialog) ensure_default_response (GtkFileChooserDialog *dialog)
{ {
gtk_container_foreach (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), GtkWidget *action_area;
action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
gtk_container_foreach (GTK_CONTAINER (action_area),
foreach_ensure_default_response_cb, foreach_ensure_default_response_cb,
dialog); dialog);
} }
......
...@@ -1552,18 +1552,22 @@ static void ...@@ -1552,18 +1552,22 @@ static void
gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag) gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag)
{ {
GtkDialog *dialog = GTK_DIALOG (fontseldiag); GtkDialog *dialog = GTK_DIALOG (fontseldiag);
GtkWidget *action_area, *content_area;
content_area = gtk_dialog_get_content_area (dialog);
action_area = gtk_dialog_get_action_area (dialog);
gtk_dialog_set_has_separator (dialog, FALSE); gtk_dialog_set_has_separator (dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5); gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6); gtk_box_set_spacing (GTK_BOX (action_area), 6);
gtk_widget_push_composite_child (); gtk_widget_push_composite_child ();
gtk_window_set_resizable (GTK_WINDOW (fontseldiag), TRUE); gtk_window_set_resizable (GTK_WINDOW (fontseldiag), TRUE);
fontseldiag->main_vbox = dialog->vbox; fontseldiag->main_vbox = content_area;
fontseldiag->fontsel = gtk_font_selection_new (); fontseldiag->fontsel = gtk_font_selection_new ();
gtk_container_set_border_width (GTK_CONTAINER (fontseldiag->fontsel), 5); gtk_container_set_border_width (GTK_CONTAINER (fontseldiag->fontsel), 5);
...@@ -1572,7 +1576,7 @@ gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag) ...@@ -1572,7 +1576,7 @@ gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag)
fontseldiag->fontsel, TRUE, TRUE, 0); fontseldiag->fontsel, TRUE, TRUE, 0);
/* Create the action area */ /* Create the action area */
fontseldiag->action_area = dialog->action_area; fontseldiag->action_area = action_area;
fontseldiag->cancel_button = gtk_dialog_add_button (dialog, fontseldiag->cancel_button = gtk_dialog_add_button (dialog,
GTK_STOCK_CANCEL, GTK_STOCK_CANCEL,
......
...@@ -329,10 +329,15 @@ static void ...@@ -329,10 +329,15 @@ static void
gtk_message_dialog_init (GtkMessageDialog *dialog) gtk_message_dialog_init (GtkMessageDialog *dialog)
{ {
GtkWidget *hbox; GtkWidget *hbox;
GtkDialog *message_dialog = GTK_DIALOG (dialog);
GtkWidget *action_area, *content_area;
GtkMessageDialogPrivate *priv; GtkMessageDialogPrivate *priv;
priv = GTK_MESSAGE_DIALOG_GET_PRIVATE (dialog); priv = GTK_MESSAGE_DIALOG_GET_PRIVATE (dialog);
content_area = gtk_dialog_get_content_area (message_dialog);
action_area = gtk_dialog_get_action_area (message_dialog);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_window_set_title (GTK_WINDOW (dialog), ""); gtk_window_set_title (GTK_WINDOW (dialog), "");
gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), TRUE); gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), TRUE);
...@@ -369,15 +374,15 @@ gtk_message_dialog_init (GtkMessageDialog *dialog) ...@@ -369,15 +374,15 @@ gtk_message_dialog_init (GtkMessageDialog *dialog)
gtk_box_pack_start (GTK_BOX (hbox), priv->message_area, gtk_box_pack_start (GTK_BOX (hbox), priv->message_area,
TRUE, TRUE, 0); TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), gtk_box_pack_start (GTK_BOX (content_area),
hbox, hbox,
FALSE, FALSE, 0); FALSE, FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14); /* 14 + 2 * 5 = 24 */ gtk_box_set_spacing (GTK_BOX (content_area), 14); /* 14 + 2 * 5 = 24 */
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5); gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6); gtk_box_set_spacing (GTK_BOX (action_area), 6);
gtk_widget_show_all (hbox); gtk_widget_show_all (hbox);
......
...@@ -457,6 +457,7 @@ gtk_mount_operation_ask_password (GMountOperation *mount_op, ...@@ -457,6 +457,7 @@ gtk_mount_operation_ask_password (GMountOperation *mount_op,
GtkWidget *hbox, *main_vbox, *vbox, *icon; GtkWidget *hbox, *main_vbox, *vbox, *icon;
GtkWidget *table; GtkWidget *table;
GtkWidget *message_label; GtkWidget *message_label;
GtkWidget *content_area, *action_area;
gboolean can_anonymous; gboolean can_anonymous;
guint rows; guint rows;
const gchar *secondary; const gchar *secondary;
...@@ -472,12 +473,15 @@ gtk_mount_operation_ask_password (GMountOperation *mount_op, ...@@ -472,12 +473,15 @@ gtk_mount_operation_ask_password (GMountOperation *mount_op,
priv->dialog = dialog; priv->dialog = dialog;
content_area = gtk_dialog_get_content_area (dialog);
action_area = gtk_dialog_get_action_area (dialog);
/* Set the dialog up with HIG properties */ /* Set the dialog up with HIG properties */
gtk_dialog_set_has_separator (dialog, FALSE); gtk_dialog_set_has_separator (dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5); gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6); gtk_box_set_spacing (GTK_BOX (action_area), 6);
gtk_window_set_resizable (window, FALSE); gtk_window_set_resizable (window, FALSE);
gtk_window_set_title (window, ""); gtk_window_set_title (window, "");
...@@ -497,7 +501,7 @@ gtk_mount_operation_ask_password (GMountOperation *mount_op, ...@@ -497,7 +501,7 @@ gtk_mount_operation_ask_password (GMountOperation *mount_op,
/* Build contents */ /* Build contents */
hbox = gtk_hbox_new (FALSE, 12); hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (dialog->vbox), hbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0);
icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION, icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION,
GTK_ICON_SIZE_DIALOG); GTK_ICON_SIZE_DIALOG);
......
...@@ -887,21 +887,25 @@ populate_dialog (GtkPageSetupUnixDialog *ps_dialog) ...@@ -887,21 +887,25 @@ populate_dialog (GtkPageSetupUnixDialog *ps_dialog)
GtkPageSetupUnixDialogPrivate *priv = ps_dialog->priv; GtkPageSetupUnixDialogPrivate *priv = ps_dialog->priv;
GtkDialog *dialog = GTK_DIALOG (ps_dialog); GtkDialog *dialog = GTK_DIALOG (ps_dialog);
GtkWidget *table, *label, *combo, *radio_button; GtkWidget *table, *label, *combo, *radio_button;
GtkWidget *action_area, *content_area;
GtkCellRenderer *cell; GtkCellRenderer *cell;
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
content_area = gtk_dialog_get_content_area (dialog);
action_area = gtk_dialog_get_action_area (dialog);
gtk_dialog_set_has_separator (dialog, FALSE); gtk_dialog_set_has_separator (dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5); gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);