[gnome] Update extensions
This commit is contained in:
@ -9,8 +9,13 @@ export const Panel = GObject.registerClass({
|
||||
Template: GLib.uri_resolve_relative(import.meta.url, '../ui/panel.ui', GLib.UriFlags.NONE),
|
||||
InternalChildren: [
|
||||
'blur',
|
||||
'customize',
|
||||
'static_blur',
|
||||
'pipeline_choose_row',
|
||||
'mode_static',
|
||||
'mode_dynamic',
|
||||
'sigma_row',
|
||||
'sigma',
|
||||
'brightness_row',
|
||||
'brightness',
|
||||
'unblur_in_overview',
|
||||
'force_light_text',
|
||||
'override_background',
|
||||
@ -20,17 +25,37 @@ export const Panel = GObject.registerClass({
|
||||
'dtp_blur_original_panel'
|
||||
],
|
||||
}, class Panel extends Adw.PreferencesPage {
|
||||
constructor(preferences) {
|
||||
constructor(preferences, pipelines_manager, pipelines_page) {
|
||||
super({});
|
||||
|
||||
this.preferences = preferences;
|
||||
this.pipelines_manager = pipelines_manager;
|
||||
this.pipelines_page = pipelines_page;
|
||||
|
||||
this.preferences.panel.settings.bind(
|
||||
'blur', this._blur, 'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
this._pipeline_choose_row.initialize(
|
||||
this.preferences.panel, this.pipelines_manager, this.pipelines_page
|
||||
);
|
||||
|
||||
this.change_blur_mode(this.preferences.panel.STATIC_BLUR, true);
|
||||
|
||||
this._mode_static.connect('toggled',
|
||||
() => this.preferences.panel.STATIC_BLUR = this._mode_static.active
|
||||
);
|
||||
this.preferences.panel.STATIC_BLUR_changed(
|
||||
() => this.change_blur_mode(this.preferences.panel.STATIC_BLUR, false)
|
||||
);
|
||||
|
||||
this.preferences.panel.settings.bind(
|
||||
'static-blur', this._static_blur, 'active',
|
||||
'sigma', this._sigma, 'value',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
this.preferences.panel.settings.bind(
|
||||
'brightness', this._brightness, 'value',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
this.preferences.panel.settings.bind(
|
||||
@ -55,9 +80,6 @@ export const Panel = GObject.registerClass({
|
||||
this._override_background_dynamically, 'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
this._customize.connect_to(this.preferences, this.preferences.panel, this._static_blur);
|
||||
|
||||
this.preferences.hidetopbar.settings.bind(
|
||||
'compatibility', this._hidetopbar_compatibility, 'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
@ -67,4 +89,14 @@ export const Panel = GObject.registerClass({
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
}
|
||||
|
||||
change_blur_mode(is_static_blur, first_run) {
|
||||
this._mode_static.set_active(is_static_blur);
|
||||
if (first_run)
|
||||
this._mode_dynamic.set_active(!is_static_blur);
|
||||
|
||||
this._pipeline_choose_row.set_visible(is_static_blur);
|
||||
this._sigma_row.set_visible(!is_static_blur);
|
||||
this._brightness_row.set_visible(!is_static_blur);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user