diff --git a/prefs.js b/prefs.js index 2182911..83f14e7 100644 --- a/prefs.js +++ b/prefs.js @@ -138,6 +138,28 @@ var PreferencesDialog = class PreferencesDialog { // clang-format on } + // Populate the open-effects drop-down menu. + { + const menu = this._builder.get_object('open-effect-menu'); + const group = Gio.SimpleActionGroup.new(); + window.insert_action_group('open-effects', group); + + ALL_EFFECTS.forEach(Effect => { + const [minMajor, minMinor] = Effect.getMinShellVersion(); + if (utils.shellVersionIsAtLeast(minMajor, minMinor)) { + const nick = Effect.getNick(); + const label = Effect.getLabel(); + const actionName = nick + '-open-effect'; + const fullName = 'open-effects.' + actionName; + + const action = this._settings.create_action(actionName); + group.add_action(action); + + menu.append_item(Gio.MenuItem.new(label, fullName)); + } + }); + } + // Populate the close-effects drop-down menu. { const menu = this._builder.get_object('close-effect-menu'); @@ -299,8 +321,12 @@ var PreferencesDialog = class PreferencesDialog { this._button.connect('clicked', () => { // Set the to-be-previewed effect. + dialog.getSettings().set_string('open-preview-effect', Effect.getNick()); dialog.getSettings().set_string('close-preview-effect', Effect.getNick()); + // Make sure that the window.show() firther below "sees" this change. + Gio.Settings.sync(); + // Create the preview-window. const window = new Gtk.Window({ title: `Preview for ${Effect.getLabel()}`, diff --git a/resources/ui/gtk3/prefs.ui b/resources/ui/gtk3/prefs.ui index 8b70434..708d1f5 100644 --- a/resources/ui/gtk3/prefs.ui +++ b/resources/ui/gtk3/prefs.ui @@ -3,6 +3,7 @@ + main-menu @@ -68,6 +69,70 @@ none + + + 10 + 10 + 10 + 10 + 0 + + + 8 + + + vertical + 3 + + + Open Window Animation + 0 + start + center + 1 + + + + + If multiple are selected, one is chosen randomly. + 0 + start + center + 1 + + + + + + + + open-effect-menu + + + 8 + + + Choose Effects + + + + + pan-down-symbolic + 1 + + + + + + + + + + + 10 @@ -144,7 +209,7 @@ 8 - Also Burn Dialogs + Also Add Effects to Dialogs 0 start center diff --git a/resources/ui/gtk4/prefs.ui b/resources/ui/gtk4/prefs.ui index 9d77674..a4182b1 100644 --- a/resources/ui/gtk4/prefs.ui +++ b/resources/ui/gtk4/prefs.ui @@ -3,6 +3,7 @@ + main-menu @@ -70,6 +71,50 @@ + + + 0 + + + + + vertical + 3 + + + Open Window Animation + 0 + start + center + 1 + + + + + If multiple are selected, one is chosen randomly. + 0 + start + center + 1 + + + + + + + + Choose Effects + open-effect-menu + + + + + + + 0 @@ -121,7 +166,7 @@ - Also Burn Dialogs + Also Add Effects to Dialogs 0 start center diff --git a/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml b/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml index 73845d9..6637fbb 100644 --- a/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml +++ b/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml @@ -19,6 +19,12 @@ The effect with this nick will be used for the next window-close animation. + + "" + Open Preview Effect + The effect with this nick will be used for the next window-open animation. + + @@ -29,6 +35,12 @@ Use the fire effect for window closing. + + false + Fire Open Effect + Use the fire effect for window opening. + + 1500 Fire Animation Time @@ -93,6 +105,12 @@ Use the matrix effect for window closing. + + false + Matrix Open Effect + Use the matrix effect for window opening. + + 3000 Matrix Animation Time @@ -139,6 +157,12 @@ Use the tv effect for window closing. + + false + TV Open Effect + Use the tv effect for window opening. + + 400 TV Animation Time @@ -161,6 +185,12 @@ Use the trex effect for window closing. + + false + T-Rex Open Effect + Use the trex effect for window opening. + + 1500 T-Rex Animation Time @@ -201,6 +231,12 @@ Use the Energize A effect for window closing. + + false + Energize A Open Effect + Use the Energize A effect for window opening. + + 2000 Energize A Animation Time @@ -229,6 +265,12 @@ Use the Energize B effect for window closing. + + false + Energize B Open Effect + Use the Energize B effect for window opening. + + 2000 Energize B Animation Time @@ -257,6 +299,12 @@ Use the wisps effect for window closing. + + false + Wisps Open Effect + Use the wisps effect for window opening. + + 2000 Wisps Animation Time @@ -285,6 +333,12 @@ Use the broken glass effect for window closing. + + false + Broken Glass Open Effect + Use the broken glass effect for window opening. + + 1500 Broken Glass Animation Time