Name our classes

In order to not end up with random names prefixed with Gjs_, give each class a proper name, so its easier to inspect and allows usage with UI files
This commit is contained in:
Rafał Dzięgiel
2021-09-02 20:12:39 +02:00
parent 914292612b
commit dc25ec976a
20 changed files with 94 additions and 32 deletions

View File

@@ -1,7 +1,9 @@
const { GObject, Gtk } = imports.gi;
const Misc = imports.src.misc;
var CustomButton = GObject.registerClass(
var CustomButton = GObject.registerClass({
GTypeName: 'ClapperCustomButton',
},
class ClapperCustomButton extends Gtk.Button
{
_init(opts)
@@ -30,7 +32,9 @@ class ClapperCustomButton extends Gtk.Button
}
});
var IconToggleButton = GObject.registerClass(
var IconToggleButton = GObject.registerClass({
GTypeName: 'ClapperIconToggleButton',
},
class ClapperIconToggleButton extends CustomButton
{
_init(primaryIcon, secondaryIcon)