Files
clapper/clapper_src/buttons.js
2020-09-12 19:28:17 +02:00

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();
}
});