gnome-shell/js/ui/checkBox.js
Florian Müllner 2c62e45168 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
2019-11-04 21:27:56 +01:00

40 lines
1004 B
JavaScript

/* exported CheckBox */
const { Clutter, GObject, Pango, St } = imports.gi;
var CheckBox = GObject.registerClass(
class CheckBox extends St.Button {
_init(label) {
let container = new St.BoxLayout();
super._init({
style_class: 'check-box',
child: container,
button_mask: St.ButtonMask.ONE,
toggle_mode: true,
can_focus: true,
});
this._box = new St.Bin({
x_expand: true,
y_expand: true,
y_align: Clutter.ActorAlign.START,
});
container.add_actor(this._box);
this._label = new St.Label();
this._label.clutter_text.set_line_wrap(true);
this._label.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE);
container.add_actor(this._label);
if (label)
this.setLabel(label);
}
setLabel(label) {
this._label.set_text(label);
}
getLabelActor() {
return this._label;
}
});