st: Remove StBin's align properties

They are now completely unused, so remove them and stop the confusing
shadowing of ClutterActor's own x/y-align properties.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/803
This commit is contained in:
Florian Müllner
2019-10-17 23:27:27 +02:00
parent f2bd39b20c
commit 2c62e45168
12 changed files with 45 additions and 169 deletions

View File

@ -43,9 +43,6 @@ struct _StBinPrivate
{
ClutterActor *child;
StAlign x_align;
StAlign y_align;
guint x_fill : 1;
guint y_fill : 1;
};
@ -55,8 +52,6 @@ enum
PROP_0,
PROP_CHILD,
PROP_X_ALIGN,
PROP_Y_ALIGN,
PROP_X_FILL,
PROP_Y_FILL,
@ -273,18 +268,6 @@ st_bin_set_property (GObject *gobject,
st_bin_set_child (bin, g_value_get_object (value));
break;
case PROP_X_ALIGN:
st_bin_set_alignment (bin,
g_value_get_enum (value),
priv->y_align);
break;
case PROP_Y_ALIGN:
st_bin_set_alignment (bin,
priv->x_align,
g_value_get_enum (value));
break;
case PROP_X_FILL:
st_bin_set_fill (bin,
g_value_get_boolean (value),
@ -324,14 +307,6 @@ st_bin_get_property (GObject *gobject,
g_value_set_boolean (value, priv->y_fill);
break;
case PROP_X_ALIGN:
g_value_set_enum (value, priv->x_align);
break;
case PROP_Y_ALIGN:
g_value_set_enum (value, priv->y_align);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
}
@ -367,32 +342,6 @@ st_bin_class_init (StBinClass *klass)
CLUTTER_TYPE_ACTOR,
ST_PARAM_READWRITE);
/**
* StBin:x-align:
*
* The horizontal alignment of the #StBin child.
*/
props[PROP_X_ALIGN] =
g_param_spec_enum ("x-align",
"X Align",
"The horizontal alignment",
ST_TYPE_ALIGN,
ST_ALIGN_MIDDLE,
ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
/**
* StBin:y-align:
*
* The vertical alignment of the #StBin child.
*/
props[PROP_Y_ALIGN] =
g_param_spec_enum ("y-align",
"Y Align",
"The vertical alignment",
ST_TYPE_ALIGN,
ST_ALIGN_MIDDLE,
ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
/**
* StBin:x-fill:
*
@ -425,10 +374,6 @@ st_bin_class_init (StBinClass *klass)
static void
st_bin_init (StBin *bin)
{
StBinPrivate *priv = st_bin_get_instance_private (bin);
priv->x_align = ST_ALIGN_MIDDLE;
priv->y_align = ST_ALIGN_MIDDLE;
}
/**
@ -499,70 +444,6 @@ st_bin_get_child (StBin *bin)
return ((StBinPrivate *)st_bin_get_instance_private (bin))->child;
}
/**
* st_bin_set_alignment:
* @bin: a #StBin
* @x_align: horizontal alignment
* @y_align: vertical alignment
*
* Sets the horizontal and vertical alignment of the child
* inside a #StBin.
*/
void
st_bin_set_alignment (StBin *bin,
StAlign x_align,
StAlign y_align)
{
StBinPrivate *priv;
g_return_if_fail (ST_IS_BIN (bin));
priv = st_bin_get_instance_private (bin);
g_object_freeze_notify (G_OBJECT (bin));
if (priv->x_align != x_align)
{
priv->x_align = x_align;
g_object_notify_by_pspec (G_OBJECT (bin), props[PROP_X_ALIGN]);
}
if (priv->y_align != y_align)
{
priv->y_align = y_align;
g_object_notify_by_pspec (G_OBJECT (bin), props[PROP_Y_ALIGN]);
}
g_object_thaw_notify (G_OBJECT (bin));
}
/**
* st_bin_get_alignment:
* @bin: a #StBin
* @x_align: return location for the horizontal alignment, or %NULL
* @y_align: return location for the vertical alignment, or %NULL
*
* Retrieves the horizontal and vertical alignment of the child
* inside a #StBin, as set by st_bin_set_alignment().
*/
void
st_bin_get_alignment (StBin *bin,
StAlign *x_align,
StAlign *y_align)
{
StBinPrivate *priv;
g_return_if_fail (ST_IS_BIN (bin));
priv = st_bin_get_instance_private (bin);
if (x_align)
*x_align = priv->x_align;
if (y_align)
*y_align = priv->y_align;
}
/**
* st_bin_set_fill:
* @bin: a #StBin

View File

@ -47,12 +47,6 @@ StWidget * st_bin_new (void);
void st_bin_set_child (StBin *bin,
ClutterActor *child);
ClutterActor *st_bin_get_child (StBin *bin);
void st_bin_set_alignment (StBin *bin,
StAlign x_align,
StAlign y_align);
void st_bin_get_alignment (StBin *bin,
StAlign *x_align,
StAlign *y_align);
void st_bin_set_fill (StBin *bin,
gboolean x_fill,
gboolean y_fill);