🔀 Merge pull request #67 from Schneegans/feature/preview
This commit is contained in:
@@ -7,6 +7,11 @@
|
||||
#### New Features
|
||||
|
||||
* **New Effect: Broken Glass.** Shatter your windows into a shower sharp shards! This effect can be configured so that the shards fly away from your mouse pointer position!
|
||||
* The effect-configuration pages of the preferences dialog now have **Preview Buttons** which con be used to, well, preview the current settings (without having to enable the effect first).
|
||||
|
||||
#### Other Enhancements
|
||||
|
||||
* Added a menu entry with a link to the guide for creating new effect types.
|
||||
|
||||
## [Burn My Window 9](https://github.com/schneegans/Burn-My-Windows/releases/tag/v9)
|
||||
|
||||
|
||||
@@ -138,8 +138,9 @@ var SimpleFade = class SimpleFade {
|
||||
// This is called by the preferences dialog. It loads the settings page for this effect,
|
||||
// binds all properties to the settings and appends the page to the main stack of the
|
||||
// preferences dialog.
|
||||
static initPreferences(dialog) {
|
||||
static getPreferences(dialog) {
|
||||
// Empty for now... Code is added here later in the tutorial!
|
||||
return null;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- API for extension.js
|
||||
@@ -248,7 +249,7 @@ There should be two sliders in this example: The animation duration and the widt
|
||||
If your effect supports GNOME Shell 3.3x _and_ GNOME Shell 40+, you will have to provide two `*.ui` files for this.
|
||||
This is because starting with GNOME Shell 40, the preference dialog uses GTK4, before it used to use GTK3.
|
||||
Usually, there are only a few minor differences between the two files.
|
||||
We will load the respective file in the `initPreferences()` method of your new effect class.
|
||||
We will load the respective file in the `getPreferences()` method of your new effect class.
|
||||
|
||||
Just save the code below to `resources/ui/gtk3/SimpleFade.ui` and `resources/ui/gtk4/SimpleFade.ui` respectively.
|
||||
Remember to replace any occurrence of `simple-fade` with your effect's nick-name!
|
||||
@@ -276,10 +277,6 @@ Remember to replace any occurrence of `simple-fade` with your effect's nick-name
|
||||
|
||||
<object class="GtkBox" id="simple-fade-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
@@ -421,10 +418,6 @@ Remember to replace any occurrence of `simple-fade` with your effect's nick-name
|
||||
|
||||
<object class="GtkBox" id="simple-fade-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
@@ -528,10 +521,10 @@ Remember to replace any occurrence of `simple-fade` with your effect's nick-name
|
||||
|
||||
### Loading the Preferences Page
|
||||
|
||||
In order to load the above `*.ui` files, add the following code to your effect's `initPreferences()` method.
|
||||
In order to load the above `*.ui` files, add the following code to your effect's `getPreferences()` method.
|
||||
|
||||
```javascript
|
||||
static initPreferences(dialog) {
|
||||
static getPreferences(dialog) {
|
||||
|
||||
// Add the settings page to the builder.
|
||||
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/SimpleFade.ui`);
|
||||
@@ -541,12 +534,9 @@ static initPreferences(dialog) {
|
||||
dialog.bindAdjustment('simple-fade-animation-time');
|
||||
dialog.bindAdjustment('simple-fade-width');
|
||||
|
||||
// Finally, append the settings page to the main stack.
|
||||
const stack = dialog.getBuilder().get_object('main-stack');
|
||||
stack.add_titled(
|
||||
dialog.getBuilder().get_object(SimpleFade.getNick() + '-prefs'),
|
||||
SimpleFade.getNick(), SimpleFade.getLabel());
|
||||
}
|
||||
// Finally, return the new settings page.
|
||||
return dialog.getBuilder().get_object('simple-fade-prefs');
|
||||
}
|
||||
```
|
||||
|
||||
Once this is in place, you can kill the extension-preferences process and re-open the settings.
|
||||
|
||||
+42
-11
@@ -81,6 +81,14 @@ class Extension {
|
||||
this._origWindowTime = imports.ui.windowManager.DESTROY_WINDOW_ANIMATION_TIME;
|
||||
this._origDialogTime = imports.ui.windowManager.DIALOG_DESTROY_WINDOW_ANIMATION_TIME;
|
||||
|
||||
// Reset the dialog destroy time if the corresponding setting gets disabled.
|
||||
this._settings.connect('changed::destroy-dialogs', () => {
|
||||
if (!this._settings.get_boolean('destroy-dialogs')) {
|
||||
imports.ui.windowManager.DIALOG_DESTROY_WINDOW_ANIMATION_TIME =
|
||||
this._origDialogTime;
|
||||
}
|
||||
});
|
||||
|
||||
// We will use extensionThis to refer to the extension inside the patched methods of
|
||||
// the WorkspacesView.
|
||||
const extensionThis = this;
|
||||
@@ -207,26 +215,49 @@ class Extension {
|
||||
}
|
||||
|
||||
// We do nothing if a dialog got closed and we should not burn them.
|
||||
const shouldDestroyDialogs = this._settings.get_boolean('destroy-dialogs');
|
||||
const isDialogWindow =
|
||||
actor.meta_window.window_type == Meta.WindowType.MODAL_DIALOG ||
|
||||
actor.meta_window.window_type == Meta.WindowType.DIALOG;
|
||||
|
||||
if (!this._settings.get_boolean('destroy-dialogs') && isDialogWindow) {
|
||||
// If an effect is to be previewed, we have to affect dialogs es well. This is
|
||||
// because the preview window is a dialog window...
|
||||
const previewNick = this._settings.get_string('close-preview-effect');
|
||||
|
||||
if (isDialogWindow && !shouldDestroyDialogs && previewNick == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Create a list of all currently enabled effects.
|
||||
const enabledEffects = ALL_EFFECTS.filter(Effect => {
|
||||
return this._settings.get_boolean(`${Effect.getNick()}-close-effect`);
|
||||
});
|
||||
// Now we have to choose an effect.
|
||||
this._effect = null;
|
||||
|
||||
// Nothing is enabled...
|
||||
if (enabledEffects.length == 0) {
|
||||
return;
|
||||
// First we check if an effect is to be previewed.
|
||||
if (previewNick != '') {
|
||||
this._effect = ALL_EFFECTS.find(Effect => {
|
||||
return Effect.getNick() == previewNick;
|
||||
});
|
||||
|
||||
// Only preview the effect once.
|
||||
this._settings.set_string('close-preview-effect', '');
|
||||
|
||||
} else {
|
||||
|
||||
// Else we choose a random effect from all enabled effects. Therefore, we first
|
||||
// create a list of all currently enabled effects.
|
||||
const enabled = ALL_EFFECTS.filter(Effect => {
|
||||
return this._settings.get_boolean(`${Effect.getNick()}-close-effect`);
|
||||
});
|
||||
|
||||
// And then choose a random effect.
|
||||
if (enabled.length > 0) {
|
||||
this._effect = enabled[Math.floor(Math.random() * enabled.length)];
|
||||
}
|
||||
}
|
||||
|
||||
// Choose a random effect.
|
||||
this._effect = enabledEffects[Math.floor(Math.random() * enabledEffects.length)];
|
||||
// If nothing was enabled, we have to do nothing :)
|
||||
if (this._effect == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// The effect usually will choose to override the present transitions on the actor.
|
||||
const transitionConfig = this._effect.getCloseTransition(actor, this._settings);
|
||||
@@ -255,7 +286,7 @@ class Extension {
|
||||
// We set the currently used time here, so that others can get an idea how long this
|
||||
// will take...
|
||||
const duration = transition.get_duration();
|
||||
if (isDialogWindow) {
|
||||
if (isDialogWindow && shouldDestroyDialogs) {
|
||||
imports.ui.windowManager.DIALOG_DESTROY_WINDOW_ANIMATION_TIME = duration;
|
||||
} else {
|
||||
imports.ui.windowManager.DESTROY_WINDOW_ANIMATION_TIME = duration;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const {Gio, Gtk, Gdk} = imports.gi;
|
||||
const {Gio, Gtk, Gdk, GLib, GObject} = imports.gi;
|
||||
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
||||
@@ -31,6 +31,9 @@ const ALL_EFFECTS = [
|
||||
Me.imports.src.Wisps.Wisps,
|
||||
];
|
||||
|
||||
// This template widget class is defined at the bottom of this file.
|
||||
var BurnMyWindowsEffectPage = null;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// The preferences dialog is organized in pages, each of which is loaded from a //
|
||||
// separate ui file. There's one page with general options, all other paged are loaded //
|
||||
@@ -46,6 +49,19 @@ var PreferencesDialog = class PreferencesDialog {
|
||||
this._resources = Gio.Resource.load(Me.path + '/resources/burn-my-windows.gresource');
|
||||
Gio.resources_register(this._resources);
|
||||
|
||||
// Load the CSS file for the settings dialog.
|
||||
const styleProvider = Gtk.CssProvider.new();
|
||||
styleProvider.load_from_resource('/css/gtk.css');
|
||||
if (utils.isGTK4()) {
|
||||
Gtk.StyleContext.add_provider_for_display(
|
||||
Gdk.Display.get_default(), styleProvider,
|
||||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
} else {
|
||||
Gtk.StyleContext.add_provider_for_screen(
|
||||
Gdk.Screen.get_default(), styleProvider,
|
||||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
}
|
||||
|
||||
// Make sure custom icons are found.
|
||||
if (utils.isGTK4()) {
|
||||
Gtk.IconTheme.get_for_display(Gdk.Display.get_default()).add_resource_path('/img');
|
||||
@@ -53,6 +69,9 @@ var PreferencesDialog = class PreferencesDialog {
|
||||
Gtk.IconTheme.get_default().add_resource_path('/img');
|
||||
}
|
||||
|
||||
// Register the template widgets used in the settings dialog.
|
||||
this._registerCustomClasses();
|
||||
|
||||
// Store a reference to the settings object.
|
||||
this._settings = ExtensionUtils.getSettings();
|
||||
|
||||
@@ -65,10 +84,20 @@ var PreferencesDialog = class PreferencesDialog {
|
||||
this.bindSwitch('destroy-dialogs');
|
||||
|
||||
// Add all other effect pages.
|
||||
const stack = this._builder.get_object('main-stack');
|
||||
ALL_EFFECTS.forEach(Effect => {
|
||||
const [minMajor, minMinor] = Effect.getMinShellVersion();
|
||||
if (utils.shellVersionIsAtLeast(minMajor, minMinor)) {
|
||||
Effect.initPreferences(this);
|
||||
|
||||
const page = new BurnMyWindowsEffectPage(Effect, this);
|
||||
|
||||
// Add the Effect's preferences (if any).
|
||||
const preferences = Effect.getPreferences(this);
|
||||
if (preferences) {
|
||||
this.gtkBoxAppend(page, preferences);
|
||||
}
|
||||
|
||||
stack.add_titled(page, Effect.getNick(), Effect.getLabel());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -103,6 +132,7 @@ var PreferencesDialog = class PreferencesDialog {
|
||||
addAction('homepage', 'https://github.com/Schneegans/Burn-My-Windows');
|
||||
addAction('changelog', 'https://github.com/Schneegans/Burn-My-Windows/blob/main/docs/changelog.md');
|
||||
addAction('bugs', 'https://github.com/Schneegans/Burn-My-Windows/issues');
|
||||
addAction('new-effect', 'https://github.com/Schneegans/Burn-My-Windows/blob/main/docs/how-to-create-new-effects.md');
|
||||
addAction('donate-paypal', 'https://www.paypal.com/donate/?hosted_button_id=3F7UFL8KLVPXE');
|
||||
addAction('donate-github', 'https://github.com/sponsors/Schneegans');
|
||||
// clang-format on
|
||||
@@ -210,6 +240,17 @@ var PreferencesDialog = class PreferencesDialog {
|
||||
this._bindResetButton(settingsKey);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------- GTK3 / GTK4 helpers
|
||||
|
||||
// Appends the given child widget to the given Gtk.Box.
|
||||
gtkBoxAppend(box, child) {
|
||||
if (utils.isGTK4()) {
|
||||
box.append(child);
|
||||
} else {
|
||||
box.pack_start(child, false, false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------- private stuff
|
||||
|
||||
// Searches for a reset button for the given settings key and make it reset the settings
|
||||
@@ -234,6 +275,71 @@ var PreferencesDialog = class PreferencesDialog {
|
||||
|
||||
this._bindResetButton(settingsKey);
|
||||
}
|
||||
|
||||
// Initializes template widgets used by the preferences dialog.
|
||||
_registerCustomClasses() {
|
||||
|
||||
// Each effect page is based on a template widget. This template contains the title
|
||||
// and the preview button.
|
||||
// clang-format off
|
||||
BurnMyWindowsEffectPage =
|
||||
GObject.registerClass({
|
||||
GTypeName: 'BurnMyWindowsEffectPage',
|
||||
Template: `resource:///ui/${utils.getGTKString()}/effectPage.ui`,
|
||||
InternalChildren: ['label', 'button'],
|
||||
},
|
||||
class BurnMyWindowsEffectPage extends Gtk.Box {
|
||||
_init(Effect, dialog) {
|
||||
super._init();
|
||||
|
||||
// Set the effect's name as label.
|
||||
this._label.label = Effect.getLabel();
|
||||
|
||||
// Open the preview window once the preview button is clicked.
|
||||
this._button.connect('clicked', () => {
|
||||
|
||||
// Set the to-be-previewed effect.
|
||||
dialog.getSettings().set_string('close-preview-effect', Effect.getNick());
|
||||
|
||||
// Create the preview-window.
|
||||
const window = new Gtk.Window({
|
||||
title: `Preview for ${Effect.getLabel()}`,
|
||||
default_width: 800,
|
||||
default_height: 450,
|
||||
modal: true,
|
||||
transient_for: utils.isGTK4() ? this._button.get_root() :
|
||||
this._button.get_toplevel()
|
||||
});
|
||||
|
||||
const box = new Gtk.Box({
|
||||
orientation: Gtk.Orientation.VERTICAL,
|
||||
valign: Gtk.Align.CENTER,
|
||||
spacing: 10,
|
||||
});
|
||||
|
||||
const label = Gtk.Label.new('Close this Window to Preview the Effect!');
|
||||
label.get_style_context().add_class('large-title');
|
||||
|
||||
const image = new Gtk.Image({
|
||||
icon_name: 'burn-my-windows-symbolic',
|
||||
pixel_size: 128,
|
||||
});
|
||||
|
||||
dialog.gtkBoxAppend(box, image);
|
||||
dialog.gtkBoxAppend(box, label);
|
||||
|
||||
if (utils.isGTK4()) {
|
||||
window.set_child(box);
|
||||
} else {
|
||||
window.add(box);
|
||||
}
|
||||
|
||||
window.show();
|
||||
});
|
||||
}
|
||||
});
|
||||
// clang-format on
|
||||
}
|
||||
}
|
||||
|
||||
// Nothing to do for now...
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
.pill-button {
|
||||
border-radius: 9999px;
|
||||
}
|
||||
@@ -10,12 +10,16 @@
|
||||
<attribute name="label" translatable="yes">View Changelog</attribute>
|
||||
<attribute name="action">prefs.changelog</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Report a Bug</attribute>
|
||||
<attribute name="action">prefs.bugs</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Create a Custom Effect</attribute>
|
||||
<attribute name="action">prefs.new-effect</attribute>
|
||||
</item>
|
||||
<submenu>
|
||||
<attribute name="label" translatable="yes">Donate</attribute>
|
||||
<item>
|
||||
|
||||
@@ -17,10 +17,6 @@
|
||||
|
||||
<object class="GtkBox" id="energize-a-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
|
||||
@@ -17,10 +17,6 @@
|
||||
|
||||
<object class="GtkBox" id="energize-b-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
|
||||
@@ -24,10 +24,6 @@
|
||||
|
||||
<object class="GtkBox" id="fire-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
@@ -81,19 +77,6 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<child>
|
||||
<object class="GtkListBox">
|
||||
<property name="selection-mode">none</property>
|
||||
<style>
|
||||
<class name="rich-list" />
|
||||
</style>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
|
||||
@@ -10,10 +10,6 @@
|
||||
|
||||
<object class="GtkBox" id="tv-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
|
||||
@@ -17,10 +17,6 @@
|
||||
|
||||
<object class="GtkBox" id="wisps-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk" version="3.0" />
|
||||
|
||||
<template class="BurnMyWindowsEffectPage" parent="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="spacing">10</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel" id="label">
|
||||
<property name="xalign">0</property>
|
||||
<property name="hexpand">1</property>
|
||||
<style>
|
||||
<class name="large-title" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button">
|
||||
<property name="valign">center</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">8</property>
|
||||
<property name="margin_end">8</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon_name">media-playback-start-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Preview this Effect</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="suggested-action" />
|
||||
<class name="pill-button" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</template>
|
||||
|
||||
</interface>
|
||||
@@ -3,10 +3,6 @@
|
||||
|
||||
<object class="GtkBox" id="broken-glass-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
|
||||
<object class="GtkBox" id="energize-a-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
|
||||
<object class="GtkBox" id="energize-b-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
|
||||
<object class="GtkBox" id="fire-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
@@ -42,20 +38,6 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<child>
|
||||
<object class="GtkListBox">
|
||||
<property name="selection-mode">none</property>
|
||||
<property name="show-separators">1</property>
|
||||
<style>
|
||||
<class name="rich-list" />
|
||||
</style>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
|
||||
<object class="GtkBox" id="matrix-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
|
||||
<object class="GtkBox" id="trex-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
|
||||
<object class="GtkBox" id="tv-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
|
||||
<object class="GtkBox" id="wisps-prefs">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0" />
|
||||
|
||||
<template class="BurnMyWindowsEffectPage" parent="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-top">60</property>
|
||||
<property name="margin-bottom">60</property>
|
||||
<property name="margin-start">60</property>
|
||||
<property name="margin-end">60</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="spacing">10</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel" id="label">
|
||||
<property name="xalign">0</property>
|
||||
<property name="hexpand">1</property>
|
||||
<style>
|
||||
<class name="large-title" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button">
|
||||
<property name="valign">center</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">8</property>
|
||||
<property name="margin_end">8</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon_name">media-playback-start-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Preview this Effect</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
<style>
|
||||
<class name="suggested-action" />
|
||||
<class name="pill-button" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</template>
|
||||
|
||||
</interface>
|
||||
@@ -13,6 +13,12 @@
|
||||
<description>Set to true to burn dialogs as well.</description>
|
||||
</key>
|
||||
|
||||
<key name="close-preview-effect" type="s">
|
||||
<default>""</default>
|
||||
<summary>Close Preview Effect</summary>
|
||||
<description>The effect with this nick will be used for the next window-close animation.</description>
|
||||
</key>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<!-- Fire Options -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
|
||||
+3
-6
@@ -60,7 +60,7 @@ var BrokenGlass = class BrokenGlass {
|
||||
// This is called by the preferences dialog. It loads the settings page for this effect,
|
||||
// binds all properties to the settings and appends the page to the main stack of the
|
||||
// preferences dialog.
|
||||
static initPreferences(dialog) {
|
||||
static getPreferences(dialog) {
|
||||
|
||||
// Add the settings page to the builder.
|
||||
dialog.getBuilder().add_from_resource('/ui/gtk4/BrokenGlass.ui');
|
||||
@@ -72,11 +72,8 @@ var BrokenGlass = class BrokenGlass {
|
||||
dialog.bindAdjustment('broken-glass-blow-force');
|
||||
dialog.bindSwitch('broken-glass-use-pointer');
|
||||
|
||||
// Finally, append the settings page to the main stack.
|
||||
const stack = dialog.getBuilder().get_object('main-stack');
|
||||
stack.add_titled(
|
||||
dialog.getBuilder().get_object('broken-glass-prefs'), BrokenGlass.getNick(),
|
||||
BrokenGlass.getLabel());
|
||||
// Finally, return the new settings page.
|
||||
return dialog.getBuilder().get_object('broken-glass-prefs');
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- API for extension.js
|
||||
|
||||
+3
-6
@@ -57,7 +57,7 @@ var EnergizeA = class EnergizeA {
|
||||
// This is called by the preferences dialog. It loads the settings page for this effect,
|
||||
// binds all properties to the settings and appends the page to the main stack of the
|
||||
// preferences dialog.
|
||||
static initPreferences(dialog) {
|
||||
static getPreferences(dialog) {
|
||||
|
||||
// Add the settings page to the builder.
|
||||
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/EnergizeA.ui`);
|
||||
@@ -67,11 +67,8 @@ var EnergizeA = class EnergizeA {
|
||||
dialog.bindAdjustment('energize-a-scale');
|
||||
dialog.bindColorButton('energize-a-color');
|
||||
|
||||
// Finally, append the settings page to the main stack.
|
||||
const stack = dialog.getBuilder().get_object('main-stack');
|
||||
stack.add_titled(
|
||||
dialog.getBuilder().get_object('energize-a-prefs'), EnergizeA.getNick(),
|
||||
EnergizeA.getLabel());
|
||||
// Finally, return the new settings page.
|
||||
return dialog.getBuilder().get_object('energize-a-prefs');
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- API for extension.js
|
||||
|
||||
+3
-6
@@ -57,7 +57,7 @@ var EnergizeB = class EnergizeB {
|
||||
// This is called by the preferences dialog. It loads the settings page for this effect,
|
||||
// binds all properties to the settings and appends the page to the main stack of the
|
||||
// preferences dialog.
|
||||
static initPreferences(dialog) {
|
||||
static getPreferences(dialog) {
|
||||
|
||||
// Add the settings page to the builder.
|
||||
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/EnergizeB.ui`);
|
||||
@@ -67,11 +67,8 @@ var EnergizeB = class EnergizeB {
|
||||
dialog.bindAdjustment('energize-b-scale');
|
||||
dialog.bindColorButton('energize-b-color');
|
||||
|
||||
// Finally, append the settings page to the main stack.
|
||||
const stack = dialog.getBuilder().get_object('main-stack');
|
||||
stack.add_titled(
|
||||
dialog.getBuilder().get_object('energize-b-prefs'), EnergizeB.getNick(),
|
||||
EnergizeB.getLabel());
|
||||
// Finally, return the new settings page.
|
||||
return dialog.getBuilder().get_object('energize-b-prefs');
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- API for extension.js
|
||||
|
||||
+3
-5
@@ -61,7 +61,7 @@ var Fire = class Fire {
|
||||
// This is called by the preferences dialog. It loads the settings page for this effect,
|
||||
// binds all properties to the settings and appends the page to the main stack of the
|
||||
// preferences dialog.
|
||||
static initPreferences(dialog) {
|
||||
static getPreferences(dialog) {
|
||||
|
||||
// Add the settings page to the builder.
|
||||
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/Fire.ui`);
|
||||
@@ -89,10 +89,8 @@ var Fire = class Fire {
|
||||
// Initialize the fire-preset dropdown.
|
||||
Fire._createFirePresets(dialog);
|
||||
|
||||
// Finally, append the settings page to the main stack.
|
||||
const stack = dialog.getBuilder().get_object('main-stack');
|
||||
stack.add_titled(
|
||||
dialog.getBuilder().get_object('fire-prefs'), Fire.getNick(), Fire.getLabel());
|
||||
// Finally, return the new settings page.
|
||||
return dialog.getBuilder().get_object('fire-prefs');
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- API for extension.js
|
||||
|
||||
+3
-6
@@ -61,7 +61,7 @@ var Matrix = class Matrix {
|
||||
// This is called by the preferences dialog. It loads the settings page for this effect,
|
||||
// binds all properties to the settings and appends the page to the main stack of the
|
||||
// preferences dialog.
|
||||
static initPreferences(dialog) {
|
||||
static getPreferences(dialog) {
|
||||
|
||||
// Add the settings page to the builder.
|
||||
dialog.getBuilder().add_from_resource('/ui/gtk4/Matrix.ui');
|
||||
@@ -73,11 +73,8 @@ var Matrix = class Matrix {
|
||||
dialog.bindColorButton('matrix-trail-color');
|
||||
dialog.bindColorButton('matrix-tip-color');
|
||||
|
||||
// Finally, append the settings page to the main stack.
|
||||
const stack = dialog.getBuilder().get_object('main-stack');
|
||||
stack.add_titled(
|
||||
dialog.getBuilder().get_object('matrix-prefs'), Matrix.getNick(),
|
||||
Matrix.getLabel());
|
||||
// Finally, return the new settings page.
|
||||
return dialog.getBuilder().get_object('matrix-prefs');
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- API for extension.js
|
||||
|
||||
+3
-6
@@ -59,7 +59,7 @@ var TRexAttack = class TRexAttack {
|
||||
// This is called by the preferences dialog. It loads the settings page for this effect,
|
||||
// binds all properties to the settings and appends the page to the main stack of the
|
||||
// preferences dialog.
|
||||
static initPreferences(dialog) {
|
||||
static getPreferences(dialog) {
|
||||
|
||||
// Add the settings page to the builder.
|
||||
dialog.getBuilder().add_from_resource('/ui/gtk4/TRexAttack.ui');
|
||||
@@ -71,11 +71,8 @@ var TRexAttack = class TRexAttack {
|
||||
dialog.bindAdjustment('claw-scratch-count');
|
||||
dialog.bindAdjustment('claw-scratch-warp');
|
||||
|
||||
// Finally, append the settings page to the main stack.
|
||||
const stack = dialog.getBuilder().get_object('main-stack');
|
||||
stack.add_titled(
|
||||
dialog.getBuilder().get_object('trex-prefs'), TRexAttack.getNick(),
|
||||
TRexAttack.getLabel());
|
||||
// Finally, return the new settings page.
|
||||
return dialog.getBuilder().get_object('trex-prefs');
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- API for extension.js
|
||||
|
||||
+3
-6
@@ -59,7 +59,7 @@ var TVEffect = class TVEffect {
|
||||
// This is called by the preferences dialog. It loads the settings page for this effect,
|
||||
// binds all properties to the settings and appends the page to the main stack of the
|
||||
// preferences dialog.
|
||||
static initPreferences(dialog) {
|
||||
static getPreferences(dialog) {
|
||||
|
||||
// Add the settings page to the builder.
|
||||
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/TVEffect.ui`);
|
||||
@@ -68,11 +68,8 @@ var TVEffect = class TVEffect {
|
||||
dialog.bindAdjustment('tv-animation-time');
|
||||
dialog.bindColorButton('tv-effect-color');
|
||||
|
||||
// Finally, append the settings page to the main stack.
|
||||
const stack = dialog.getBuilder().get_object('main-stack');
|
||||
stack.add_titled(
|
||||
dialog.getBuilder().get_object('tv-prefs'), TVEffect.getNick(),
|
||||
TVEffect.getLabel());
|
||||
// Finally, return the new settings page.
|
||||
return dialog.getBuilder().get_object('tv-prefs');
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- API for extension.js
|
||||
|
||||
+3
-5
@@ -58,7 +58,7 @@ var Wisps = class Wisps {
|
||||
// This is called by the preferences dialog. It loads the settings page for this effect,
|
||||
// binds all properties to the settings and appends the page to the main stack of the
|
||||
// preferences dialog.
|
||||
static initPreferences(dialog) {
|
||||
static getPreferences(dialog) {
|
||||
|
||||
// Add the settings page to the builder.
|
||||
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/Wisps.ui`);
|
||||
@@ -68,10 +68,8 @@ var Wisps = class Wisps {
|
||||
dialog.bindAdjustment('wisps-scale');
|
||||
dialog.bindColorButton('wisps-color');
|
||||
|
||||
// Finally, append the settings page to the main stack.
|
||||
const stack = dialog.getBuilder().get_object('main-stack');
|
||||
stack.add_titled(
|
||||
dialog.getBuilder().get_object('wisps-prefs'), Wisps.getNick(), Wisps.getLabel());
|
||||
// Finally, return the new settings page.
|
||||
return dialog.getBuilder().get_object('wisps-prefs');
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- API for extension.js
|
||||
|
||||
Reference in New Issue
Block a user