mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
41 lines
633 B
JavaScript
41 lines
633 B
JavaScript
const { GObject, Gtk } = imports.gi;
|
|
|
|
var BoxedIconButton = GObject.registerClass(
|
|
class BoxedIconButton extends Gtk.Button
|
|
{
|
|
_init(icon, size)
|
|
{
|
|
super._init();
|
|
|
|
let image = Gtk.Image.new_from_icon_name(icon, size);
|
|
|
|
if(image)
|
|
this.set_image(image);
|
|
|
|
this.box = new Gtk.Box();
|
|
this.box.pack_start(this, false, false, 0);
|
|
|
|
super.show();
|
|
}
|
|
|
|
get visible()
|
|
{
|
|
return this.box.visible;
|
|
}
|
|
|
|
show_all()
|
|
{
|
|
this.box.show_all();
|
|
}
|
|
|
|
show()
|
|
{
|
|
this.box.show();
|
|
}
|
|
|
|
hide()
|
|
{
|
|
this.box.hide();
|
|
}
|
|
});
|