mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Add "BoxedIconButton" class
This commit is contained in:
38
clapper_src/buttons.js
Normal file
38
clapper_src/buttons.js
Normal 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();
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user