mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-12 20:00:09 +00:00
Drop deprecated gtk_dialog_get_action_area
Add an internal version for the few places where we still need it, and drop it from everywhere else.
This commit is contained in:
parent
b0303c539c
commit
b404ecf294
@ -686,28 +686,27 @@ apply_use_header_bar (GtkAboutDialog *about)
|
||||
g_object_get (about, "use-header-bar", &use_header_bar, NULL);
|
||||
if (!use_header_bar)
|
||||
{
|
||||
GtkWidget *action_area;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
action_area = gtk_dialog_get_action_area (GTK_DIALOG (about));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
priv->credits_button = gtk_toggle_button_new_with_mnemonic (_("C_redits"));
|
||||
g_object_bind_property (priv->credits_page, "visible",
|
||||
priv->credits_button, "visible", G_BINDING_SYNC_CREATE);
|
||||
g_signal_connect (priv->credits_button, "toggled", G_CALLBACK (toggle_credits), about);
|
||||
gtk_container_add_with_properties (GTK_CONTAINER (action_area), priv->credits_button,
|
||||
"secondary", TRUE,
|
||||
NULL);
|
||||
|
||||
gtk_dialog_add_action_widget (GTK_DIALOG (about), priv->credits_button, GTK_RESPONSE_NONE);
|
||||
gtk_container_child_set (GTK_CONTAINER (gtk_widget_get_parent (priv->credits_button)),
|
||||
priv->credits_button,
|
||||
"secondary", TRUE,
|
||||
NULL);
|
||||
|
||||
priv->license_button = gtk_toggle_button_new_with_mnemonic (_("_License"));
|
||||
g_object_bind_property (priv->license_page, "visible",
|
||||
priv->license_button, "visible", G_BINDING_SYNC_CREATE);
|
||||
g_signal_connect (priv->license_button, "toggled", G_CALLBACK (toggle_license), about);
|
||||
gtk_container_add_with_properties (GTK_CONTAINER (action_area), priv->license_button,
|
||||
"secondary", TRUE,
|
||||
NULL);
|
||||
|
||||
gtk_dialog_add_action_widget (GTK_DIALOG (about), priv->license_button, GTK_RESPONSE_NONE);
|
||||
gtk_container_child_set (GTK_CONTAINER (gtk_widget_get_parent (priv->license_button)),
|
||||
priv->license_button,
|
||||
"secondary", TRUE,
|
||||
NULL);
|
||||
|
||||
gtk_dialog_add_button (GTK_DIALOG (about), _("_Close"), GTK_RESPONSE_DELETE_EVENT);
|
||||
}
|
||||
|
@ -69,10 +69,6 @@
|
||||
* recommended; it allows you to set the dialog title, some convenient
|
||||
* flags, and add simple buttons.
|
||||
*
|
||||
* If “dialog” is a newly created dialog, the two primary areas of the
|
||||
* window can be accessed through gtk_dialog_get_content_area() and
|
||||
* gtk_dialog_get_action_area(), as can be seen from the example below.
|
||||
*
|
||||
* A “modal” dialog (that is, one which freezes the rest of the application
|
||||
* from user input), can be created by calling gtk_window_set_modal() on the
|
||||
* dialog. Use the GTK_WINDOW() macro to cast the widget returned from
|
||||
@ -1604,19 +1600,6 @@ gtk_dialog_buildable_add_child (GtkBuildable *buildable,
|
||||
GTK_BUILDER_WARN_INVALID_CHILD_TYPE (buildable, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_dialog_get_action_area:
|
||||
* @dialog: a #GtkDialog
|
||||
*
|
||||
* Returns the action area of @dialog.
|
||||
*
|
||||
* Returns: (transfer none): the action area
|
||||
*
|
||||
* Since: 2.14
|
||||
*
|
||||
* Deprecated:3.12: Direct access to the action area
|
||||
* is discouraged; use gtk_dialog_add_button(), etc.
|
||||
*/
|
||||
GtkWidget *
|
||||
gtk_dialog_get_action_area (GtkDialog *dialog)
|
||||
{
|
||||
|
@ -188,8 +188,6 @@ void gtk_dialog_response (GtkDialog *dialog,
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gint gtk_dialog_run (GtkDialog *dialog);
|
||||
|
||||
GDK_DEPRECATED_IN_3_10
|
||||
GtkWidget * gtk_dialog_get_action_area (GtkDialog *dialog);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkWidget * gtk_dialog_get_content_area (GtkDialog *dialog);
|
||||
GDK_AVAILABLE_IN_3_12
|
||||
|
@ -30,6 +30,7 @@
|
||||
G_BEGIN_DECLS
|
||||
|
||||
void gtk_dialog_set_use_header_bar_from_setting (GtkDialog *dialog);
|
||||
GtkWidget *gtk_dialog_get_action_area (GtkDialog *dialog);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "gtkmessagedialog.h"
|
||||
#include "gtkdialogprivate.h"
|
||||
#include "gtkaccessible.h"
|
||||
#include "gtkbuildable.h"
|
||||
#include "gtklabel.h"
|
||||
@ -293,9 +294,7 @@ gtk_message_dialog_init (GtkMessageDialog *dialog)
|
||||
priv->message_type = GTK_MESSAGE_OTHER;
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (dialog));
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (action_area), GTK_BUTTONBOX_EXPAND);
|
||||
|
||||
settings = gtk_widget_get_settings (GTK_WIDGET (dialog));
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "gtkmain.h"
|
||||
#include "gtksettings.h"
|
||||
#include "gtkstylecontextprivate.h"
|
||||
#include "gtkdialogprivate.h"
|
||||
|
||||
#include <glib/gprintf.h>
|
||||
|
||||
@ -527,9 +528,7 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
|
||||
priv->dialog = dialog;
|
||||
|
||||
content_area = gtk_dialog_get_content_area (dialog);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
action_area = gtk_dialog_get_action_area (dialog);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
/* Set the dialog up with HIG properties */
|
||||
gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
|
||||
|
@ -155,9 +155,7 @@ gtk_recent_chooser_item_activated_cb (GtkRecentChooser *chooser,
|
||||
if (gtk_window_activate_default (GTK_WINDOW (dialog)))
|
||||
return;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
action_area = gtk_dialog_get_action_area (rc_dialog);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
children = gtk_container_get_children (GTK_CONTAINER (action_area));
|
||||
|
||||
for (l = children; l; l = l->next)
|
||||
|
@ -876,7 +876,7 @@ static void
|
||||
test_children (void)
|
||||
{
|
||||
GtkBuilder * builder;
|
||||
GtkWidget *content_area, *dialog_action_area;
|
||||
GtkWidget *content_area;
|
||||
GList *children;
|
||||
const gchar buffer1[] =
|
||||
"<interface>"
|
||||
@ -939,16 +939,11 @@ test_children (void)
|
||||
g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (content_area)), "dialog1-vbox") == 0);
|
||||
|
||||
action_area = gtk_builder_get_object (builder, "dialog1-action_area");
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
dialog_action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
g_assert (action_area != NULL);
|
||||
g_assert (GTK_IS_BUTTON_BOX (action_area));
|
||||
g_assert (gtk_orientable_get_orientation (GTK_ORIENTABLE (action_area)) == GTK_ORIENTATION_HORIZONTAL);
|
||||
g_assert (gtk_widget_get_parent (GTK_WIDGET (action_area)) != NULL);
|
||||
g_assert (dialog_action_area != NULL);
|
||||
g_assert (gtk_buildable_get_name (GTK_BUILDABLE (action_area)) != NULL);
|
||||
g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (dialog_action_area)), "dialog1-action_area") == 0);
|
||||
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
@ -37,9 +37,6 @@ test_dialog_basic (void)
|
||||
|
||||
dialog = gtk_dialog_new();
|
||||
g_assert (GTK_IS_DIALOG (dialog));
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
g_assert (gtk_dialog_get_action_area (GTK_DIALOG (dialog)) != NULL);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
g_assert (gtk_dialog_get_content_area (GTK_DIALOG (dialog)) != NULL);
|
||||
|
||||
gtk_widget_destroy (dialog);
|
||||
|
Loading…
Reference in New Issue
Block a user