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:
parent
f2bd39b20c
commit
2c62e45168
@ -162,9 +162,9 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
can_focus: true,
|
can_focus: true,
|
||||||
label: _("Cancel"),
|
label: _("Cancel"),
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
|
x_align: Clutter.ActorAlign.START,
|
||||||
|
y_align: Clutter.ActorAlign.END,
|
||||||
});
|
});
|
||||||
this.cancelButton.set_x_align(Clutter.ActorAlign.START);
|
|
||||||
this.cancelButton.set_y_align(Clutter.ActorAlign.END);
|
|
||||||
this.cancelButton.connect('clicked', () => this.cancel());
|
this.cancelButton.connect('clicked', () => this.cancel());
|
||||||
this._buttonBox.add_child(this.cancelButton);
|
this._buttonBox.add_child(this.cancelButton);
|
||||||
|
|
||||||
@ -175,9 +175,9 @@ var AuthPrompt = GObject.registerClass({
|
|||||||
reactive: true,
|
reactive: true,
|
||||||
can_focus: true,
|
can_focus: true,
|
||||||
label: _("Next"),
|
label: _("Next"),
|
||||||
|
x_align: Clutter.ActorAlign.END,
|
||||||
|
y_align: Clutter.ActorAlign.END,
|
||||||
});
|
});
|
||||||
this.nextButton.set_x_align(Clutter.ActorAlign.END);
|
|
||||||
this.nextButton.set_y_align(Clutter.ActorAlign.END);
|
|
||||||
this.nextButton.connect('clicked', () => this.emit('next'));
|
this.nextButton.connect('clicked', () => this.emit('next'));
|
||||||
this.nextButton.add_style_pseudo_class('default');
|
this.nextButton.add_style_pseudo_class('default');
|
||||||
this._buttonBox.add_child(this.nextButton);
|
this._buttonBox.add_child(this.nextButton);
|
||||||
|
@ -346,19 +346,13 @@ function insertSorted(array, val, cmp) {
|
|||||||
var CloseButton = GObject.registerClass(
|
var CloseButton = GObject.registerClass(
|
||||||
class CloseButton extends St.Button {
|
class CloseButton extends St.Button {
|
||||||
_init(boxpointer) {
|
_init(boxpointer) {
|
||||||
super._init({ style_class: 'notification-close' });
|
super._init({
|
||||||
|
style_class: 'notification-close',
|
||||||
// This is a bit tricky. St.Bin has its own x-align/y-align properties
|
x_expand: true,
|
||||||
// that compete with Clutter's properties. This should be fixed for
|
y_expand: true,
|
||||||
// Clutter 2.0. Since St.Bin doesn't define its own setters, the
|
x_align: Clutter.ActorAlign.END,
|
||||||
// setters are a workaround to get Clutter's version.
|
y_align: Clutter.ActorAlign.START,
|
||||||
this.set_x_align(Clutter.ActorAlign.END);
|
});
|
||||||
this.set_y_align(Clutter.ActorAlign.START);
|
|
||||||
|
|
||||||
// XXX Clutter 2.0 workaround: ClutterBinLayout needs expand
|
|
||||||
// to respect the alignments.
|
|
||||||
this.set_x_expand(true);
|
|
||||||
this.set_y_expand(true);
|
|
||||||
|
|
||||||
this._boxPointer = boxpointer;
|
this._boxPointer = boxpointer;
|
||||||
if (boxpointer)
|
if (boxpointer)
|
||||||
|
@ -1082,10 +1082,12 @@ class CalendarMessageList extends St.Widget {
|
|||||||
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
|
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
|
||||||
box.add_actor(this._scrollView);
|
box.add_actor(this._scrollView);
|
||||||
|
|
||||||
this._clearButton = new St.Button({ style_class: 'message-list-clear-button button',
|
this._clearButton = new St.Button({
|
||||||
label: _("Clear"),
|
style_class: 'message-list-clear-button button',
|
||||||
can_focus: true });
|
label: _('Clear'),
|
||||||
this._clearButton.set_x_align(Clutter.ActorAlign.END);
|
can_focus: true,
|
||||||
|
x_align: Clutter.ActorAlign.END,
|
||||||
|
});
|
||||||
this._clearButton.connect('clicked', () => {
|
this._clearButton.connect('clicked', () => {
|
||||||
this._sectionList.get_children().forEach(s => s.clear());
|
this._sectionList.get_children().forEach(s => s.clear());
|
||||||
});
|
});
|
||||||
|
@ -16,8 +16,8 @@ class CheckBox extends St.Button {
|
|||||||
this._box = new St.Bin({
|
this._box = new St.Bin({
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
y_expand: true,
|
y_expand: true,
|
||||||
|
y_align: Clutter.ActorAlign.START,
|
||||||
});
|
});
|
||||||
this._box.set_y_align(Clutter.ActorAlign.START);
|
|
||||||
container.add_actor(this._box);
|
container.add_actor(this._box);
|
||||||
|
|
||||||
this._label = new St.Label();
|
this._label = new St.Label();
|
||||||
|
@ -272,8 +272,8 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
|
|||||||
|
|
||||||
this._iconBin = new St.Bin({
|
this._iconBin = new St.Bin({
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
|
x_align: Clutter.ActorAlign.END,
|
||||||
});
|
});
|
||||||
this._iconBin.set_x_align(Clutter.ActorAlign.END);
|
|
||||||
mainContentLayout.add_child(this._iconBin);
|
mainContentLayout.add_child(this._iconBin);
|
||||||
|
|
||||||
let messageLayout = new St.BoxLayout({ vertical: true,
|
let messageLayout = new St.BoxLayout({ vertical: true,
|
||||||
|
@ -265,8 +265,8 @@ class ObjLink extends St.Button {
|
|||||||
track_hover: true,
|
track_hover: true,
|
||||||
style_class: 'shell-link',
|
style_class: 'shell-link',
|
||||||
label: text,
|
label: text,
|
||||||
|
x_align: Clutter.ActorAlign.START,
|
||||||
});
|
});
|
||||||
this.set_x_align(Clutter.ActorAlign.START);
|
|
||||||
this.get_child().single_line_mode = true;
|
this.get_child().single_line_mode = true;
|
||||||
|
|
||||||
this._obj = o;
|
this._obj = o;
|
||||||
|
@ -735,10 +735,12 @@ var PadOsd = GObject.registerClass({
|
|||||||
x_align: Clutter.ActorAlign.CENTER,
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
y_align: Clutter.ActorAlign.CENTER });
|
y_align: Clutter.ActorAlign.CENTER });
|
||||||
this.add_actor(buttonBox);
|
this.add_actor(buttonBox);
|
||||||
this._editButton = new St.Button({ label: _("Edit…"),
|
this._editButton = new St.Button({
|
||||||
style_class: 'button',
|
label: _('Edit…'),
|
||||||
can_focus: true });
|
style_class: 'button',
|
||||||
this._editButton.set_x_align(Clutter.ActorAlign.CENTER);
|
can_focus: true,
|
||||||
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
|
});
|
||||||
this._editButton.connect('clicked', () => {
|
this._editButton.connect('clicked', () => {
|
||||||
this.setEditionMode(true);
|
this.setEditionMode(true);
|
||||||
});
|
});
|
||||||
|
@ -340,9 +340,9 @@ var PopupSwitchMenuItem = GObject.registerClass({
|
|||||||
this.add_child(this.label);
|
this.add_child(this.label);
|
||||||
|
|
||||||
this._statusBin = new St.Bin({
|
this._statusBin = new St.Bin({
|
||||||
|
x_align: Clutter.ActorAlign.END,
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
});
|
});
|
||||||
this._statusBin.set_x_align(Clutter.ActorAlign.END);
|
|
||||||
this.add_child(this._statusBin);
|
this.add_child(this._statusBin);
|
||||||
|
|
||||||
this._statusLabel = new St.Label({
|
this._statusLabel = new St.Label({
|
||||||
|
@ -770,13 +770,15 @@ var ProviderInfo = GObject.registerClass(
|
|||||||
class ProviderInfo extends St.Button {
|
class ProviderInfo extends St.Button {
|
||||||
_init(provider) {
|
_init(provider) {
|
||||||
this.provider = provider;
|
this.provider = provider;
|
||||||
super._init({ style_class: 'search-provider-icon',
|
super._init({
|
||||||
reactive: true,
|
style_class: 'search-provider-icon',
|
||||||
can_focus: true,
|
reactive: true,
|
||||||
accessible_name: provider.appInfo.get_name(),
|
can_focus: true,
|
||||||
track_hover: true });
|
accessible_name: provider.appInfo.get_name(),
|
||||||
|
track_hover: true,
|
||||||
|
y_align: Clutter.ActorAlign.START,
|
||||||
|
});
|
||||||
|
|
||||||
this.set_y_align(Clutter.ActorAlign.START);
|
|
||||||
this._content = new St.BoxLayout({ vertical: false,
|
this._content = new St.BoxLayout({ vertical: false,
|
||||||
style_class: 'list-search-provider-content' });
|
style_class: 'list-search-provider-content' });
|
||||||
this.set_child(this._content);
|
this.set_child(this._content);
|
||||||
|
@ -175,15 +175,16 @@ class Indicator extends PanelMenu.SystemIndicator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_createActionButton(iconName, accessibleName) {
|
_createActionButton(iconName, accessibleName) {
|
||||||
let icon = new St.Button({ reactive: true,
|
return new St.Button({
|
||||||
can_focus: true,
|
child: new St.Icon({ icon_name: iconName }),
|
||||||
track_hover: true,
|
reactive: true,
|
||||||
accessible_name: accessibleName,
|
can_focus: true,
|
||||||
x_expand: true,
|
track_hover: true,
|
||||||
style_class: 'system-menu-action' });
|
accessible_name: accessibleName,
|
||||||
icon.set_x_align(Clutter.ActorAlign.CENTER);
|
x_expand: true,
|
||||||
icon.child = new St.Icon({ icon_name: iconName });
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
return icon;
|
style_class: 'system-menu-action',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_createSubMenu() {
|
_createSubMenu() {
|
||||||
|
119
src/st/st-bin.c
119
src/st/st-bin.c
@ -43,9 +43,6 @@ struct _StBinPrivate
|
|||||||
{
|
{
|
||||||
ClutterActor *child;
|
ClutterActor *child;
|
||||||
|
|
||||||
StAlign x_align;
|
|
||||||
StAlign y_align;
|
|
||||||
|
|
||||||
guint x_fill : 1;
|
guint x_fill : 1;
|
||||||
guint y_fill : 1;
|
guint y_fill : 1;
|
||||||
};
|
};
|
||||||
@ -55,8 +52,6 @@ enum
|
|||||||
PROP_0,
|
PROP_0,
|
||||||
|
|
||||||
PROP_CHILD,
|
PROP_CHILD,
|
||||||
PROP_X_ALIGN,
|
|
||||||
PROP_Y_ALIGN,
|
|
||||||
PROP_X_FILL,
|
PROP_X_FILL,
|
||||||
PROP_Y_FILL,
|
PROP_Y_FILL,
|
||||||
|
|
||||||
@ -273,18 +268,6 @@ st_bin_set_property (GObject *gobject,
|
|||||||
st_bin_set_child (bin, g_value_get_object (value));
|
st_bin_set_child (bin, g_value_get_object (value));
|
||||||
break;
|
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:
|
case PROP_X_FILL:
|
||||||
st_bin_set_fill (bin,
|
st_bin_set_fill (bin,
|
||||||
g_value_get_boolean (value),
|
g_value_get_boolean (value),
|
||||||
@ -324,14 +307,6 @@ st_bin_get_property (GObject *gobject,
|
|||||||
g_value_set_boolean (value, priv->y_fill);
|
g_value_set_boolean (value, priv->y_fill);
|
||||||
break;
|
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:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||||
}
|
}
|
||||||
@ -367,32 +342,6 @@ st_bin_class_init (StBinClass *klass)
|
|||||||
CLUTTER_TYPE_ACTOR,
|
CLUTTER_TYPE_ACTOR,
|
||||||
ST_PARAM_READWRITE);
|
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:
|
* StBin:x-fill:
|
||||||
*
|
*
|
||||||
@ -425,10 +374,6 @@ st_bin_class_init (StBinClass *klass)
|
|||||||
static void
|
static void
|
||||||
st_bin_init (StBin *bin)
|
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;
|
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:
|
* st_bin_set_fill:
|
||||||
* @bin: a #StBin
|
* @bin: a #StBin
|
||||||
|
@ -47,12 +47,6 @@ StWidget * st_bin_new (void);
|
|||||||
void st_bin_set_child (StBin *bin,
|
void st_bin_set_child (StBin *bin,
|
||||||
ClutterActor *child);
|
ClutterActor *child);
|
||||||
ClutterActor *st_bin_get_child (StBin *bin);
|
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,
|
void st_bin_set_fill (StBin *bin,
|
||||||
gboolean x_fill,
|
gboolean x_fill,
|
||||||
gboolean y_fill);
|
gboolean y_fill);
|
||||||
|
Loading…
Reference in New Issue
Block a user