Drop the expand property

The hexpand and vexpand properties are sufficient.
This commit is contained in:
Matthias Clasen 2020-02-25 18:25:52 -05:00
parent 2d4e1e248d
commit a9c05193a7
23 changed files with 55 additions and 59 deletions

View File

@ -167,7 +167,8 @@
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="shadow-type">in</property>
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<object class="GtkTreeView" id="treeview1">
<property name="model">liststore1</property>

View File

@ -103,7 +103,8 @@
<property name="scrollable">1</property>
<property name="enable-popup">1</property>
<property name="show-border">0</property>
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<object class="GtkNotebookPage">
<property name="tab-expand">1</property>

View File

@ -77,7 +77,8 @@
</child>
<child>
<object class="GtkScrolledWindow" id="sw">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="hscrollbar-policy">never</property>
<child>
<object class="GtkIconView" id="list">

View File

@ -133,7 +133,8 @@
<child>
<object class="GtkScrolledWindow">
<property name="hscrollbar-policy">never</property>
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<object class="GtkTextView" id="text_view">
<property name="wrap-mode">word</property>
@ -156,7 +157,8 @@
<object class="GtkBox">
<child>
<object class="GtkScrolledWindow">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="min-content-height">100</property>
<property name="min-content-width">100</property>
<child>

View File

@ -1909,10 +1909,12 @@ microphone-sensitivity-medium-symbolic</property>
<child>
<object class="GtkBox">
<property name="spacing">10</property>
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<object class="GtkFrame" id="panedframe1">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<object class="GtkPaned">
<style>
@ -1934,7 +1936,8 @@ microphone-sensitivity-medium-symbolic</property>
</child>
<child>
<object class="GtkFrame" id="panedframe2">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<object class="GtkPaned">
<property name="orientation">vertical</property>

View File

@ -905,7 +905,8 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
GTK_WIDGET (self));
priv->stack = g_object_new (GTK_TYPE_STACK,
"expand", TRUE,
"hexpand", TRUE,
"vexpand", TRUE,
"homogeneous", TRUE,
"transition-type", GTK_STACK_TRANSITION_TYPE_CROSSFADE,
NULL);

View File

@ -555,7 +555,6 @@ enum {
PROP_VEXPAND,
PROP_HEXPAND_SET,
PROP_VEXPAND_SET,
PROP_EXPAND,
PROP_SCALE_FACTOR,
PROP_CSS_NAME,
PROP_CSS_CLASSES,
@ -1254,18 +1253,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
FALSE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWidget:expand:
*
* Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand
*/
widget_props[PROP_EXPAND] =
g_param_spec_boolean ("expand",
P_("Expand Both"),
P_("Whether widget wants to expand in both directions"),
FALSE,
GTK_PARAM_READWRITE);
/**
* GtkWidget:opacity:
*
@ -1878,12 +1865,6 @@ gtk_widget_set_property (GObject *object,
case PROP_VEXPAND_SET:
gtk_widget_set_vexpand_set (widget, g_value_get_boolean (value));
break;
case PROP_EXPAND:
g_object_freeze_notify (G_OBJECT (widget));
gtk_widget_set_hexpand (widget, g_value_get_boolean (value));
gtk_widget_set_vexpand (widget, g_value_get_boolean (value));
g_object_thaw_notify (G_OBJECT (widget));
break;
case PROP_OPACITY:
gtk_widget_set_opacity (widget, g_value_get_double (value));
break;
@ -2026,11 +2007,6 @@ gtk_widget_get_property (GObject *object,
case PROP_VEXPAND_SET:
g_value_set_boolean (value, gtk_widget_get_vexpand_set (widget));
break;
case PROP_EXPAND:
g_value_set_boolean (value,
gtk_widget_get_hexpand (widget) &&
gtk_widget_get_vexpand (widget));
break;
case PROP_OPACITY:
g_value_set_double (value, gtk_widget_get_opacity (widget));
break;
@ -8442,14 +8418,11 @@ gtk_widget_set_expand (GtkWidget *widget,
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
gint expand_prop;
gint expand_set_prop;
gboolean was_both;
g_return_if_fail (GTK_IS_WIDGET (widget));
expand = expand != FALSE;
was_both = priv->hexpand && priv->vexpand;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
if (priv->hexpand_set &&
@ -8480,8 +8453,6 @@ gtk_widget_set_expand (GtkWidget *widget,
g_object_freeze_notify (G_OBJECT (widget));
g_object_notify_by_pspec (G_OBJECT (widget), widget_props[expand_prop]);
g_object_notify_by_pspec (G_OBJECT (widget), widget_props[expand_set_prop]);
if (was_both != (priv->hexpand && priv->vexpand))
g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_EXPAND]);
g_object_thaw_notify (G_OBJECT (widget));
}

View File

@ -54,7 +54,8 @@
</child>
<child>
<object class="GtkScrolledWindow">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="hscrollbar-policy">never</property>
<child>
<object class="GtkListBox" id="list">

View File

@ -45,7 +45,8 @@
<child>
<object class="GtkScrolledWindow">
<property name="hscrollbar-policy">never</property>
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<object class="GtkTextView" id="view">
<property name="buffer">text</property>

View File

@ -15,7 +15,8 @@
<property name="position">400</property>
<child>
<object class="GtkScrolledWindow">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="min-content-height">100</property>
<child>
<object class="GtkTreeView" id="node_tree">

View File

@ -23,7 +23,8 @@
</child>
<child>
<object class="GtkScrolledWindow">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="vscrollbar-policy">always</property>
<child>
<object class="GtkTreeView" id="view"/>

View File

@ -3,7 +3,8 @@
<property name="orientation">vertical</property>
<child>
<object class="GtkScrolledWindow">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<object class="GtkMagnifier" id="magnifier">
<property name="visible">True</property>

View File

@ -12,7 +12,8 @@
<property name="orientation">vertical</property>
<child>
<object class="GtkScrolledWindow">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="vscrollbar-policy">always</property>
<child>
<object class="GtkTreeView">

View File

@ -37,7 +37,8 @@
<child>
<object class="GtkScrolledWindow">
<property name="hscrollbar-policy">never</property>
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<object class="GtkListBox" id="list">
<signal name="row-activated" handler="on_row_activated"/>

View File

@ -950,7 +950,8 @@ property_editor (GObject *object,
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (popover), sw);
g_object_set (sw,
"expand", TRUE,
"hexpand", TRUE,
"vexpand", TRUE,
"hscrollbar-policy", GTK_POLICY_NEVER,
"vscrollbar-policy", GTK_POLICY_NEVER,
NULL);
@ -1017,7 +1018,8 @@ property_editor (GObject *object,
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (popover), sw);
g_object_set (sw,
"expand", TRUE,
"hexpand", TRUE,
"vexpand", TRUE,
"hscrollbar-policy", GTK_POLICY_NEVER,
"vscrollbar-policy", GTK_POLICY_NEVER,
NULL);

View File

@ -80,7 +80,8 @@
</child>
<child>
<object class="GtkScrolledWindow">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="hscrollbar-policy">never</property>
<child>
<object class="GtkListBox" id="list2">

View File

@ -137,7 +137,8 @@
</child>
<child>
<object class="GtkPicture" id="render_node_view">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
</object>
</child>
</object>

View File

@ -50,7 +50,8 @@
</child>
<child>
<object class="GtkScrolledWindow">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="hscrollbar-policy">never</property>
<child>
<object class="GtkTreeView" id="tree">
@ -198,7 +199,8 @@
<property name="name">text</property>
<property name="child">
<object class="GtkScrolledWindow">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="shadow-type">in</property>
<style>
<class name="view"/>
@ -218,7 +220,8 @@
<property name="name">image</property>
<property name="child">
<object class="GtkScrolledWindow">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="shadow-type">in</property>
<style>
<class name="view"/>

View File

@ -33,7 +33,8 @@
</child>
<child>
<object class="GtkScrolledWindow">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="vscrollbar-policy">always</property>
<child>
<object class="GtkTreeView" id="view">

View File

@ -13,7 +13,8 @@
<object class="GtkColorChooserWidget" id="chooser">
<property name="margin">5</property>
<property name="rgba">rgb(255,255,255)</property>
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<signal name="color-activated" handler="color_activated_cb" swapped="no"/>
<signal name="notify::rgba" handler="propagate_notify" swapped="no"/>
<signal name="notify::show-editor" handler="propagate_notify" swapped="no"/>

View File

@ -16,7 +16,8 @@
</child>
<child>
<object class="GtkFileChooserWidget" id="widget">
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<signal name="file-activated" handler="file_chooser_widget_file_activated" swapped="no"/>
<signal name="response-requested" handler="file_chooser_widget_response_requested" swapped="no"/>
<signal name="selection-changed" handler="file_chooser_widget_selection_changed" swapped="no"/>

View File

@ -115,7 +115,8 @@
<child>
<object class="GtkStack" id="browse_files_stack">
<property name="transition-type">crossfade</property>
<property name="expand">1</property>
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<style>
<class name="view"/>
</style>

View File

@ -497,9 +497,7 @@ test_type (gconstpointer data)
g_str_equal (pspec->name, "is-focus") ||
g_str_equal (pspec->name, "margin") ||
g_str_equal (pspec->name, "hexpand") ||
g_str_equal (pspec->name, "vexpand") ||
g_str_equal (pspec->name, "expand")
))
g_str_equal (pspec->name, "vexpand")))
continue;
if (pspec->owner_type == GTK_TYPE_ENTRY &&