MCPcopy Index your code
hub / github.com/material-shell/material-shell / setBlurBackground

Method setBlurBackground

src/layout/main.ts:98–123  ·  view source on GitHub ↗
(blur: boolean)

Source from the content-addressed store, hash-verified

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({

Callers 2

constructorMethod · 0.95
registerToSignalsMethod · 0.95

Calls 4

remove_effectMethod · 0.80
add_effectMethod · 0.80
disconnectMethod · 0.65
connectMethod · 0.65

Tested by

no test coverage detected