🔧 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);
// Update the settings when the color is modified.
button.connect('color-set', () => {
this._settings.set_string(settingsKey, button.get_rgba().to_string());
});
if (button) {
// 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;
};
// Update the settings when the color is modified.
button.connect('color-set', () => {
this._settings.set_string(settingsKey, button.get_rgba().to_string());
});
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.
settingSignalHandler();
this._settings.connect('changed::' + settingsKey, settingSignalHandler);
// Initialize the button with the state in the settings.
settingSignalHandler();
}
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
// the settings key. It also binds the corresponding reset button.
_bind(settingsKey, property) {
this._settings.bind(
settingsKey, this._builder.get_object(settingsKey), property,
Gio.SettingsBindFlags.DEFAULT);
const object = this._builder.get_object(settingsKey);
if (object) {
this._settings.bind(settingsKey, object, property, Gio.SettingsBindFlags.DEFAULT);
}
this._bindResetButton(settingsKey);
}
+6 -6
View File
@@ -88,7 +88,7 @@
<object class="GtkListBox">
<property name="selection-mode">none</property>
<child>
<!-- <child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
@@ -138,7 +138,7 @@
</object>
</child>
</object>
</child>
</child> -->
<child>
<object class="GtkListBoxRow">
@@ -415,7 +415,7 @@
</object>
</child>
<child>
<!-- <child>
<object class="GtkBox">
<property name="margin-top">30</property>
<property name="margin-bottom">10</property>
@@ -430,9 +430,9 @@
</object>
</child>
</object>
</child>
</child> -->
<child>
<!-- <child>
<object class="GtkFrame">
<child>
<object class="GtkListBox">
@@ -633,7 +633,7 @@
</object>
</child>
</object>
</child>
</child> -->
</object>
</child>