1
0
Fork 0

Adding upstream version 48.2.

Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
This commit is contained in:
Daniel Baumann 2025-06-22 20:26:11 +02:00
parent 0d8723e422
commit 1fcdbd5df9
Signed by: daniel.baumann
GPG key ID: BCC918A2ABD66424
1059 changed files with 623842 additions and 0 deletions

48
js/ui/checkBox.js Normal file
View file

@ -0,0 +1,48 @@
import Atk from 'gi://Atk';
import Clutter from 'gi://Clutter';
import GObject from 'gi://GObject';
import Pango from 'gi://Pango';
import St from 'gi://St';
export const CheckBox = GObject.registerClass(
class CheckBox extends St.Button {
_init(label) {
let container = new St.BoxLayout({
x_expand: true,
y_expand: true,
});
super._init({
style_class: 'check-box',
child: container,
button_mask: St.ButtonMask.ONE,
toggle_mode: true,
can_focus: true,
});
this.set_accessible_role(Atk.Role.CHECK_BOX);
this._box = new St.Bin({y_align: Clutter.ActorAlign.START});
container.add_child(this._box);
this._check = new St.Icon({
icon_name: 'check-symbolic',
});
this._box.set_child(this._check);
this._label = new St.Label({y_align: Clutter.ActorAlign.CENTER});
this._label.clutter_text.set_line_wrap(true);
this._label.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE);
this.set_label_actor(this._label);
container.add_child(this._label);
if (label)
this.setLabel(label);
}
setLabel(label) {
this._label.set_text(label);
}
getLabelActor() {
return this._label;
}
});