(blur: boolean)
| 96 | ); |
| 97 | } |
| 98 | setBlurBackground(blur: boolean) { |
| 99 | const themeContext = St.ThemeContext.get_for_stage(global.stage); |
| 100 | if ((this.blurEffect && blur) || (!this.blurEffect && !blur)) { |
| 101 | return; |
| 102 | } else if (this.blurEffect && !blur) { |
| 103 | this._scaleChangedId?.disconnect(); |
| 104 | this.backgroundGroup.remove_effect(this.blurEffect); |
| 105 | delete this.blurEffect; |
| 106 | return; |
| 107 | } |
| 108 | |
| 109 | const effect = (this.blurEffect = new Shell.BlurEffect({ |
| 110 | brightness: 0.55, |
| 111 | sigma: 60 * themeContext.scale_factor, |
| 112 | })); |
| 113 | |
| 114 | this._scaleChangedId = SignalHandle.connect( |
| 115 | themeContext, |
| 116 | 'notify::scale-factor', |
| 117 | () => { |
| 118 | effect.sigma = 60 * themeContext.scale_factor; |
| 119 | } |
| 120 | ); |
| 121 | |
| 122 | this.backgroundGroup.add_effect(this.blurEffect); |
| 123 | } |
| 124 | |
| 125 | registerToSignals() { |
| 126 | this.signals.push({ |
no test coverage detected