🔧 Disable matrix animation on GNOME 3.3x

This commit is contained in:
Simon Schneegans
2021-12-25 12:56:14 +01:00
parent a994a3e80d
commit c5aa8b9268
2 changed files with 27 additions and 22 deletions
+21 -16
View File
@@ -116,22 +116,25 @@ var PreferencesDialog = class PreferencesDialog {
const button = this._builder.get_object(settingsKey); const button = this._builder.get_object(settingsKey);
// Update the settings when the color is modified. if (button) {
button.connect('color-set', () => {
this._settings.set_string(settingsKey, button.get_rgba().to_string());
});
// Update the button state when the settings change. // Update the settings when the color is modified.
const settingSignalHandler = () => { button.connect('color-set', () => {
const rgba = new Gdk.RGBA(); this._settings.set_string(settingsKey, button.get_rgba().to_string());
rgba.parse(this._settings.get_string(settingsKey)); });
button.rgba = rgba;
};
this._settings.connect('changed::' + settingsKey, settingSignalHandler); // Update the button state when the settings change.
const settingSignalHandler = () => {
const rgba = new Gdk.RGBA();
rgba.parse(this._settings.get_string(settingsKey));
button.rgba = rgba;
};
// Initialize the button with the state in the settings. this._settings.connect('changed::' + settingsKey, settingSignalHandler);
settingSignalHandler();
// Initialize the button with the state in the settings.
settingSignalHandler();
}
this._bindResetButton(settingsKey); this._bindResetButton(settingsKey);
} }
@@ -139,9 +142,11 @@ var PreferencesDialog = class PreferencesDialog {
// Connects any widget's property to a settings key. The widget must have the same ID as // Connects any widget's property to a settings key. The widget must have the same ID as
// the settings key. It also binds the corresponding reset button. // the settings key. It also binds the corresponding reset button.
_bind(settingsKey, property) { _bind(settingsKey, property) {
this._settings.bind( const object = this._builder.get_object(settingsKey);
settingsKey, this._builder.get_object(settingsKey), property,
Gio.SettingsBindFlags.DEFAULT); if (object) {
this._settings.bind(settingsKey, object, property, Gio.SettingsBindFlags.DEFAULT);
}
this._bindResetButton(settingsKey); this._bindResetButton(settingsKey);
} }
+6 -6
View File
@@ -88,7 +88,7 @@
<object class="GtkListBox"> <object class="GtkListBox">
<property name="selection-mode">none</property> <property name="selection-mode">none</property>
<child> <!-- <child>
<object class="GtkListBoxRow"> <object class="GtkListBoxRow">
<property name="margin-start">10</property> <property name="margin-start">10</property>
<property name="margin-end">10</property> <property name="margin-end">10</property>
@@ -138,7 +138,7 @@
</object> </object>
</child> </child>
</object> </object>
</child> </child> -->
<child> <child>
<object class="GtkListBoxRow"> <object class="GtkListBoxRow">
@@ -415,7 +415,7 @@
</object> </object>
</child> </child>
<child> <!-- <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="margin-top">30</property> <property name="margin-top">30</property>
<property name="margin-bottom">10</property> <property name="margin-bottom">10</property>
@@ -430,9 +430,9 @@
</object> </object>
</child> </child>
</object> </object>
</child> </child> -->
<child> <!-- <child>
<object class="GtkFrame"> <object class="GtkFrame">
<child> <child>
<object class="GtkListBox"> <object class="GtkListBox">
@@ -633,7 +633,7 @@
</object> </object>
</child> </child>
</object> </object>
</child> </child> -->
</object> </object>
</child> </child>