forked from AuroraMiddleware/gtk
dialog: Expose the content area as a separate GtkBox child
This way, the "vbox" internal child does not contain anything by default. It previously did contain "internal" widgetry like the action area.
This commit is contained in:
parent
3a13515777
commit
494e9d750a
@ -3283,7 +3283,7 @@ bad things might happen.</property>
|
||||
<property name="use-header-bar">1</property>
|
||||
<property name="title" translatable="yes">Zelda</property>
|
||||
<property name="hide-on-close">1</property>
|
||||
<child internal-child="vbox">
|
||||
<child internal-child="content_area">
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
@ -3322,7 +3322,7 @@ bad things might happen.</property>
|
||||
<property name="use-header-bar">1</property>
|
||||
<property name="title" translatable="yes">Settings</property>
|
||||
<property name="hide-on-close">1</property>
|
||||
<child internal-child="vbox">
|
||||
<child internal-child="content_area">
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
@ -3443,7 +3443,7 @@ bad things might happen.</property>
|
||||
<property name="use-header-bar">1</property>
|
||||
<property name="title" translatable="yes">Choose one</property>
|
||||
<property name="hide-on-close">1</property>
|
||||
<child internal-child="vbox">
|
||||
<child internal-child="content_area">
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkFlowBox" id="selection_flowbox">
|
||||
|
@ -133,8 +133,8 @@
|
||||
* # GtkDialog as GtkBuildable
|
||||
*
|
||||
* The GtkDialog implementation of the #GtkBuildable interface exposes the
|
||||
* @vbox and @action_area as internal children with the names “vbox” and
|
||||
* “action_area”.
|
||||
* @message_area and @action_area as internal children with the names
|
||||
* “action_area” and “action_area”.
|
||||
*
|
||||
* GtkDialog supports a custom <action-widgets> element, which can contain
|
||||
* multiple <action-widget> elements. The “response” attribute specifies a
|
||||
@ -170,9 +170,9 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *headerbar;
|
||||
GtkWidget *action_area;
|
||||
GtkWidget *content_area;
|
||||
GtkWidget *action_box;
|
||||
GtkSizeGroup *size_group;
|
||||
|
||||
@ -592,9 +592,9 @@ gtk_dialog_class_init (GtkDialogClass *class)
|
||||
/* Bind class to template
|
||||
*/
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/ui/gtkdialog.ui");
|
||||
gtk_widget_class_bind_template_child_internal_private (widget_class, GtkDialog, vbox);
|
||||
gtk_widget_class_bind_template_child_internal_private (widget_class, GtkDialog, headerbar);
|
||||
gtk_widget_class_bind_template_child_internal_private (widget_class, GtkDialog, action_area);
|
||||
gtk_widget_class_bind_template_child_internal_private (widget_class, GtkDialog, content_area);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkDialog, action_box);
|
||||
|
||||
gtk_widget_class_set_css_name (widget_class, I_("dialog"));
|
||||
@ -727,7 +727,7 @@ gtk_dialog_close (GtkDialog *dialog)
|
||||
* Creates a new dialog box.
|
||||
*
|
||||
* Widgets should not be packed into this #GtkWindow
|
||||
* directly, but into the @vbox and @action_area, as described above.
|
||||
* directly, but into the @content_area and @action_area, as described above.
|
||||
*
|
||||
* Returns: the new dialog as a #GtkWidget
|
||||
*/
|
||||
@ -1621,5 +1621,5 @@ gtk_dialog_get_content_area (GtkDialog *dialog)
|
||||
|
||||
g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL);
|
||||
|
||||
return priv->vbox;
|
||||
return priv->content_area;
|
||||
}
|
||||
|
@ -15,8 +15,8 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox1">
|
||||
<child internal-child="content_area">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<property name="margin">5</property>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<template class="GtkAppChooserDialog" parent="GtkDialog">
|
||||
<property name="title" translatable="yes">Select Application</property>
|
||||
<property name="type-hint">dialog</property>
|
||||
<child internal-child="vbox">
|
||||
<child internal-child="content_area">
|
||||
<object class="GtkBox" id="dialog-vbox1">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<property name="title" translatable="yes">Select a Color</property>
|
||||
<property name="type-hint">dialog</property>
|
||||
<property name="resizable">0</property>
|
||||
<child internal-child="vbox">
|
||||
<child internal-child="content_area">
|
||||
<object class="GtkBox" id="dialog-vbox1">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
|
@ -10,11 +10,19 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<style>
|
||||
<class name="dialog-vbox"/>
|
||||
</style>
|
||||
|
||||
<!-- This is empty here and just exists so we can expose it as
|
||||
GtkDialog API. -->
|
||||
<child>
|
||||
<object class="GtkBox" id="content_area">
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkBox" id="action_box">
|
||||
<style>
|
||||
|
@ -6,8 +6,8 @@
|
||||
<property name="type-hint">dialog</property>
|
||||
<property name="default-width">600</property>
|
||||
<signal name="response" handler="response_cb" swapped="no"/>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox1">
|
||||
<child internal-child="content_area">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox" id="dialog-action_area1">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<template class="GtkFontChooserDialog" parent="GtkDialog">
|
||||
<property name="title" translatable="yes">Select Font</property>
|
||||
<property name="type-hint">dialog</property>
|
||||
<child internal-child="vbox">
|
||||
<child internal-child="content_area">
|
||||
<object class="GtkBox" id="dialog-vbox1">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<child internal-child="headerbar">
|
||||
<object class="GtkHeaderBar" id="headerbar1"/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<child internal-child="content_area">
|
||||
<object class="GtkBox" id="dialog-vbox1">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">20</property>
|
||||
|
@ -27,7 +27,7 @@
|
||||
<property name="resizable">0</property>
|
||||
<property name="type-hint">dialog</property>
|
||||
<property name="title" translatable="yes">Page Setup</property>
|
||||
<child internal-child="vbox">
|
||||
<child internal-child="content_area">
|
||||
<object class="GtkBox" id="dialog-vbox1">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
|
@ -51,7 +51,7 @@
|
||||
<property name="type-hint">dialog</property>
|
||||
<signal name="notify::page-setup" handler="redraw_page_layout_preview" swapped="no"/>
|
||||
<signal name="response" handler="error_dialogs" swapped="no"/>
|
||||
<child internal-child="vbox">
|
||||
<child internal-child="content_area">
|
||||
<object class="GtkBox" id="dialog-vbox1">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
|
@ -918,7 +918,7 @@ test_children (void)
|
||||
"<interface>"
|
||||
" <object class=\"GtkDialog\" id=\"dialog1\">"
|
||||
" <property name=\"use_header_bar\">1</property>"
|
||||
" <child internal-child=\"vbox\">"
|
||||
" <child internal-child=\"content_area\">"
|
||||
" <object class=\"GtkBox\" id=\"dialog1-vbox\">"
|
||||
" <property name=\"orientation\">vertical</property>"
|
||||
" <child internal-child=\"action_area\">"
|
||||
@ -961,7 +961,6 @@ test_children (void)
|
||||
g_assert (vbox != NULL);
|
||||
g_assert (GTK_IS_BOX (vbox));
|
||||
g_assert (gtk_orientable_get_orientation (GTK_ORIENTABLE (vbox)) == GTK_ORIENTATION_VERTICAL);
|
||||
g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (gtk_widget_get_parent (GTK_WIDGET (vbox)))), "dialog1") == 0);
|
||||
g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (content_area)), "dialog1-vbox") == 0);
|
||||
|
||||
action_area = gtk_builder_get_object (builder, "dialog1-action_area");
|
||||
@ -1334,7 +1333,7 @@ test_dialog (void)
|
||||
const gchar buffer1[] =
|
||||
"<interface>"
|
||||
" <object class=\"GtkDialog\" id=\"dialog1\">"
|
||||
" <child internal-child=\"vbox\">"
|
||||
" <child internal-child=\"content_area\">"
|
||||
" <object class=\"GtkBox\" id=\"dialog1-vbox\">"
|
||||
" <property name=\"orientation\">vertical</property>"
|
||||
" <child internal-child=\"action_area\">"
|
||||
|
Loading…
Reference in New Issue
Block a user