diff options
| author | Nippy <nippy@Nippy-Mac-mini.local> | 2026-10-09 17:23:53 +0200 |
|---|---|---|
| committer | Nippy <nippy@Nippy-Mac-mini.local> | 2026-10-09 17:23:53 +0200 |
| commit | 9d5be1660d8f74038ebed3d74fdbc809e43787ae (patch) | |
| tree | 4cb46c3765be87ca4c5219f2f714425d7dfddb56 /raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/popup/surface_style.js | |
| parent | deb4b8a9c407832c35100a643bd7a592589c9679 (diff) | |
| download | RaveOS-PKGBUILD-9d5be1660d8f74038ebed3d74fdbc809e43787ae.tar.gz RaveOS-PKGBUILD-9d5be1660d8f74038ebed3d74fdbc809e43787ae.zip | |
gnome fix
Diffstat (limited to 'raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/popup/surface_style.js')
| -rw-r--r-- | raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/popup/surface_style.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/popup/surface_style.js b/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/popup/surface_style.js new file mode 100644 index 0000000..1dfb947 --- /dev/null +++ b/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/components/popup/surface_style.js @@ -0,0 +1,59 @@ +export const PopupBlurSurfaceStyle = class PopupBlurSurfaceStyle { + constructor(surface) { + this.surface = surface; + this.original_target_style = null; + this.target_style_set = false; + } + + capture_target_style() { + this.original_target_style = this.surface.target ? this.surface.target.get_style() : null; + } + + update_target_style() { + if ( + !this.surface.target.set_style + || !this.surface.settings.popup.OVERRIDE_BACKGROUND + ) { + this.restore_target_style(); + return; + } + + if ( + this.has_style_class(this.surface.target, 'bms-keyboard-surface') + ) + return; + + const base_style = this.original_target_style ?? ''; + const separator = base_style.trim() && !base_style.trim().endsWith(';') ? '; ' : ''; + + this.surface.target.set_style( + `${base_style}${separator}border-radius: ${this.surface.get_corner_radius()}px;` + ); + this.target_style_set = true; + } + + restore_target_style() { + if (!this.target_style_set || !this.surface.target.set_style) + return; + + this.surface.target.set_style(this.original_target_style); + this.target_style_set = false; + } + + has_any_style_class(actor, style_classes) { + return style_classes.some(style_class => this.has_style_class(actor, style_class)); + } + + has_style_class(actor, style_class) { + if (!actor) + return false; + + if (actor.has_style_class_name) + return actor.has_style_class_name(style_class); + + if (actor.get_style_class_name) + return (actor.get_style_class_name() ?? '').split(/\s+/).includes(style_class); + + return false; + } +}; |