Add "BoxedIconButton" class

This commit is contained in:
Rafostar
2020-09-11 21:28:00 +02:00
parent 5afe5149aa
commit 6938f01433
3 changed files with 44 additions and 10 deletions

38
clapper_src/buttons.js Normal file
View File

@@ -0,0 +1,38 @@
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);
}
get visible()
{
return this.box.visible;
}
show_all()
{
this.box.show_all();
}
show()
{
this.box.show();
}
hide()
{
this.box.hide();
}
});