panel.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. 'force_light_text',
  14. 'override_background',
  15. 'style_panel',
  16. 'override_background_dynamically',
  17. 'hidetopbar_compatibility',
  18. 'dtp_blur_original_panel'
  19. ],
  20. }, class Panel extends Adw.PreferencesPage {
  21. constructor(preferences) {
  22. super({});
  23. this.preferences = preferences;
  24. this.preferences.panel.settings.bind(
  25. 'blur', this._blur, 'active',
  26. Gio.SettingsBindFlags.DEFAULT
  27. );
  28. this.preferences.panel.settings.bind(
  29. 'static-blur', this._static_blur, 'active',
  30. Gio.SettingsBindFlags.DEFAULT
  31. );
  32. this.preferences.panel.settings.bind(
  33. 'unblur-in-overview', this._unblur_in_overview, 'active',
  34. Gio.SettingsBindFlags.DEFAULT
  35. );
  36. this.preferences.panel.settings.bind(
  37. 'force-light-text', this._force_light_text, 'active',
  38. Gio.SettingsBindFlags.DEFAULT
  39. );
  40. this.preferences.panel.settings.bind(
  41. 'override-background',
  42. this._override_background, 'enable-expansion',
  43. Gio.SettingsBindFlags.DEFAULT
  44. );
  45. this.preferences.panel.settings.bind(
  46. 'style-panel', this._style_panel, 'selected',
  47. Gio.SettingsBindFlags.DEFAULT
  48. );
  49. this.preferences.panel.settings.bind(
  50. 'override-background-dynamically',
  51. this._override_background_dynamically, 'active',
  52. Gio.SettingsBindFlags.DEFAULT
  53. );
  54. this._customize.connect_to(this.preferences, this.preferences.panel, this._static_blur);
  55. this.preferences.hidetopbar.settings.bind(
  56. 'compatibility', this._hidetopbar_compatibility, 'active',
  57. Gio.SettingsBindFlags.DEFAULT
  58. );
  59. this.preferences.dash_to_panel.settings.bind(
  60. 'blur-original-panel', this._dtp_blur_original_panel, 'active',
  61. Gio.SettingsBindFlags.DEFAULT
  62. );
  63. }
  64. });