♻️ Introduce utils.getGTKString()
This commit is contained in:
@@ -45,14 +45,10 @@ var PreferencesDialog = class PreferencesDialog {
|
|||||||
this._settings = ExtensionUtils.getSettings();
|
this._settings = ExtensionUtils.getSettings();
|
||||||
|
|
||||||
// Load the general user interface files.
|
// Load the general user interface files.
|
||||||
{
|
this._builder = new Gtk.Builder();
|
||||||
const dir = utils.isGTK4() ? 'gtk4' : 'gtk3';
|
this._builder.add_from_resource(`/ui/common/main-menu.ui`);
|
||||||
|
this._builder.add_from_resource(`/ui/${utils.getGTKString()}/prefs.ui`);
|
||||||
this._builder = new Gtk.Builder();
|
this._builder.add_from_resource(`/ui/${utils.getGTKString()}/generalPage.ui`);
|
||||||
this._builder.add_from_resource(`/ui/common/main-menu.ui`);
|
|
||||||
this._builder.add_from_resource(`/ui/${dir}/prefs.ui`);
|
|
||||||
this._builder.add_from_resource(`/ui/${dir}/generalPage.ui`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bind general options properties.
|
// Bind general options properties.
|
||||||
this.bindSwitch('destroy-dialogs');
|
this.bindSwitch('destroy-dialogs');
|
||||||
|
|||||||
+1
-2
@@ -61,8 +61,7 @@ var FireEffect = class FireEffect {
|
|||||||
static initPreferences(dialog) {
|
static initPreferences(dialog) {
|
||||||
|
|
||||||
// Add the settings page to the builder.
|
// Add the settings page to the builder.
|
||||||
dialog.getBuilder().add_from_resource(
|
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/firePage.ui`);
|
||||||
`/ui/${utils.isGTK4() ? 'gtk4' : 'gtk3'}/firePage.ui`);
|
|
||||||
|
|
||||||
// Bind all properties.
|
// Bind all properties.
|
||||||
dialog.bindAdjustment('fire-animation-time');
|
dialog.bindAdjustment('fire-animation-time');
|
||||||
|
|||||||
+1
-2
@@ -59,8 +59,7 @@ var TVEffect = class TVEffect {
|
|||||||
static initPreferences(dialog) {
|
static initPreferences(dialog) {
|
||||||
|
|
||||||
// Add the settings page to the builder.
|
// Add the settings page to the builder.
|
||||||
dialog.getBuilder().add_from_resource(
|
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/tvPage.ui`);
|
||||||
`/ui/${utils.isGTK4() ? 'gtk4' : 'gtk3'}/tvPage.ui`);
|
|
||||||
|
|
||||||
// Bind all properties.
|
// Bind all properties.
|
||||||
dialog.bindAdjustment('tv-animation-time');
|
dialog.bindAdjustment('tv-animation-time');
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ function isGTK4() {
|
|||||||
return Gtk.get_major_version() == 4;
|
return Gtk.get_major_version() == 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getGTKString() {
|
||||||
|
return isGTK4() ? 'gtk4' : 'gtk3';
|
||||||
|
}
|
||||||
|
|
||||||
function isInShellProcess() {
|
function isInShellProcess() {
|
||||||
return window.global && global.stage;
|
return window.global && global.stage;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user