other.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 Other = GObject.registerClass({
  6. GTypeName: 'Other',
  7. Template: GLib.uri_resolve_relative(import.meta.url, '../ui/other.ui', GLib.UriFlags.NONE),
  8. InternalChildren: [
  9. 'lockscreen_blur',
  10. 'lockscreen_pipeline_choose_row',
  11. 'screenshot_blur',
  12. 'screenshot_pipeline_choose_row',
  13. 'window_list_blur',
  14. 'window_list_sigma',
  15. 'window_list_brightness',
  16. 'coverflow_alt_tab_blur',
  17. 'coverflow_alt_tab_pipeline_choose_row',
  18. 'hack_level',
  19. 'debug',
  20. 'reset'
  21. ],
  22. }, class Overview extends Adw.PreferencesPage {
  23. constructor(preferences, pipelines_manager, pipelines_page) {
  24. super({});
  25. this.preferences = preferences;
  26. this.pipelines_manager = pipelines_manager;
  27. this.pipelines_page = pipelines_page;
  28. this.preferences.lockscreen.settings.bind(
  29. 'blur', this._lockscreen_blur, 'active',
  30. Gio.SettingsBindFlags.DEFAULT
  31. );
  32. this._lockscreen_pipeline_choose_row.initialize(
  33. this.preferences.lockscreen, this.pipelines_manager, this.pipelines_page
  34. );
  35. this.preferences.screenshot.settings.bind(
  36. 'blur', this._screenshot_blur, 'active',
  37. Gio.SettingsBindFlags.DEFAULT
  38. );
  39. this._screenshot_pipeline_choose_row.initialize(
  40. this.preferences.screenshot, this.pipelines_manager, this.pipelines_page
  41. );
  42. this.preferences.window_list.settings.bind(
  43. 'blur', this._window_list_blur, 'active',
  44. Gio.SettingsBindFlags.DEFAULT
  45. );
  46. this.preferences.window_list.settings.bind(
  47. 'sigma', this._window_list_sigma, 'value',
  48. Gio.SettingsBindFlags.DEFAULT
  49. );
  50. this.preferences.window_list.settings.bind(
  51. 'brightness', this._window_list_brightness, 'value',
  52. Gio.SettingsBindFlags.DEFAULT
  53. );
  54. this.preferences.coverflow_alt_tab.settings.bind(
  55. 'blur', this._coverflow_alt_tab_blur, 'active',
  56. Gio.SettingsBindFlags.DEFAULT
  57. );
  58. this._coverflow_alt_tab_pipeline_choose_row.initialize(
  59. this.preferences.coverflow_alt_tab, this.pipelines_manager, this.pipelines_page
  60. );
  61. this.preferences.settings.bind(
  62. 'hacks-level', this._hack_level, 'selected',
  63. Gio.SettingsBindFlags.DEFAULT
  64. );
  65. this.preferences.settings.bind(
  66. 'debug', this._debug, 'active',
  67. Gio.SettingsBindFlags.DEFAULT
  68. );
  69. this._reset.connect('clicked', () => this.preferences.reset());
  70. }
  71. });