panel.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import Adw from 'gi://Adw';
  2. import GLib from 'gi://GLib';
  3. import GObject from 'gi://GObject';
  4. import Gio from 'gi://Gio';
  5. export const Panel = GObject.registerClass({
  6. GTypeName: 'Panel',
  7. Template: GLib.uri_resolve_relative(import.meta.url, '../ui/panel.ui', GLib.UriFlags.NONE),
  8. InternalChildren: [
  9. 'blur',
  10. 'customize',
  11. 'static_blur',
  12. 'unblur_in_overview',
  13. 'override_background',
  14. 'style_panel',
  15. 'override_background_dynamically',
  16. 'hidetopbar_compatibility',
  17. 'dtp_blur_original_panel'
  18. ],
  19. }, class Panel extends Adw.PreferencesPage {
  20. constructor(preferences) {
  21. super({});
  22. this.preferences = preferences;
  23. this.preferences.panel.settings.bind(
  24. 'blur', this._blur, 'active',
  25. Gio.SettingsBindFlags.DEFAULT
  26. );
  27. this.preferences.panel.settings.bind(
  28. 'static-blur', this._static_blur, 'active',
  29. Gio.SettingsBindFlags.DEFAULT
  30. );
  31. this.preferences.panel.settings.bind(
  32. 'unblur-in-overview', this._unblur_in_overview, 'active',
  33. Gio.SettingsBindFlags.DEFAULT
  34. );
  35. this.preferences.panel.settings.bind(
  36. 'override-background',
  37. this._override_background, 'enable-expansion',
  38. Gio.SettingsBindFlags.DEFAULT
  39. );
  40. this.preferences.panel.settings.bind(
  41. 'style-panel', this._style_panel, 'selected',
  42. Gio.SettingsBindFlags.DEFAULT
  43. );
  44. this.preferences.panel.settings.bind(
  45. 'override-background-dynamically',
  46. this._override_background_dynamically, 'active',
  47. Gio.SettingsBindFlags.DEFAULT
  48. );
  49. this._customize.connect_to(this.preferences, this.preferences.panel, this._static_blur);
  50. this.preferences.hidetopbar.settings.bind(
  51. 'compatibility', this._hidetopbar_compatibility, 'active',
  52. Gio.SettingsBindFlags.DEFAULT
  53. );
  54. this.preferences.dash_to_panel.settings.bind(
  55. 'blur-original-panel', this._dtp_blur_original_panel, 'active',
  56. Gio.SettingsBindFlags.DEFAULT
  57. );
  58. }
  59. });