♻️ Rename method
Deploy / Extension Bundle (push) Has been cancelled

This commit is contained in:
Simon Schneegans
2022-01-02 14:00:18 +01:00
parent 3630e461a9
commit 27fec7adea
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -34,7 +34,7 @@ var PreferencesDialog = class PreferencesDialog {
// Load the user interface file. // Load the user interface file.
this._builder = new Gtk.Builder(); this._builder = new Gtk.Builder();
this._builder.add_from_resource(`/ui/${utils.gtk4() ? 'gtk4' : 'gtk3'}.ui`); this._builder.add_from_resource(`/ui/${utils.isGTK4() ? 'gtk4' : 'gtk3'}.ui`);
// This is our top-level widget which we will return later. // This is our top-level widget which we will return later.
this._widget = this._builder.get_object('settings-widget'); this._widget = this._builder.get_object('settings-widget');
@@ -77,7 +77,7 @@ var PreferencesDialog = class PreferencesDialog {
// Add a menu to the title bar of the preferences dialog. // Add a menu to the title bar of the preferences dialog.
this._widget.connect('realize', (widget) => { this._widget.connect('realize', (widget) => {
const window = utils.gtk4() ? widget.get_root() : widget.get_toplevel(); const window = utils.isGTK4() ? widget.get_root() : widget.get_toplevel();
// Show the version number in the title bar. // Show the version number in the title bar.
window.set_title(`Burn-My-Windows ${Me.metadata.version}`); window.set_title(`Burn-My-Windows ${Me.metadata.version}`);
@@ -113,7 +113,7 @@ var PreferencesDialog = class PreferencesDialog {
}); });
// Show the widgets on GTK3. // Show the widgets on GTK3.
if (!utils.gtk4()) { if (!utils.isGTK4()) {
this._widget.show_all(); this._widget.show_all();
} }
} }
@@ -280,7 +280,7 @@ var PreferencesDialog = class PreferencesDialog {
this._builder.get_object('fire-preset-button').set_menu_model(menu); this._builder.get_object('fire-preset-button').set_menu_model(menu);
const root = utils.gtk4() ? widget.get_root() : widget.get_toplevel(); const root = utils.isGTK4() ? widget.get_root() : widget.get_toplevel();
root.insert_action_group(groupName, group); root.insert_action_group(groupName, group);
}); });
} }
+1 -1
View File
@@ -39,6 +39,6 @@ function debug(message) {
} }
// This method simply returns true if we are currently using GTK4. // This method simply returns true if we are currently using GTK4.
function gtk4() { function isGTK4() {
return Gtk.get_major_version() == 4; return Gtk.get_major_version() == 4;
} }