checkBox: Fix expand and align properties

In f2bd39b20c, the expand property for
checkboxes was accidentally set to the grandchild (the StBin), instead
of the child (the StBoxLayout) of the StButton. Fix that and let the
BoxLayout expand instead of the Bin.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/885
This commit is contained in:
Jonas Dreßler 2019-12-04 21:37:34 +01:00 committed by Florian Müllner
parent a2044c61ae
commit f3eeb94c90

View File

@ -4,7 +4,10 @@ const { Clutter, GObject, Pango, St } = imports.gi;
var CheckBox = GObject.registerClass(
class CheckBox extends St.Button {
_init(label) {
let container = new St.BoxLayout();
let container = new St.BoxLayout({
x_expand: true,
y_expand: true,
});
super._init({
style_class: 'check-box',
child: container,
@ -13,11 +16,7 @@ class CheckBox extends St.Button {
can_focus: true,
});
this._box = new St.Bin({
x_expand: true,
y_expand: true,
y_align: Clutter.ActorAlign.START,
});
this._box = new St.Bin({ y_align: Clutter.ActorAlign.START });
container.add_actor(this._box);
this._label = new St.Label();