[gnome-shell/wip/fmuellner/background-gradient: 190/191] panel: Notify when solid style changes



commit e45e8a2a14dbb4f26275504011550135f5f84ed0
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jul 24 12:01:35 2018 +0200

    panel: Notify when solid style changes
    
    In order to improve the transparent top bar's legibility with lighter
    wallpapers, we want the background to adapt to the top bar style. To
    allow for that in a clean way, export that information in a property
    and notify when it changes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783913

 js/ui/panel.js | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 49759af4c..1bca06b10 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -1039,6 +1039,10 @@ var Panel = new Lang.Class({
         return this._leftBox.opacity;
     },
 
+    get solidStyle() {
+        return this.actor.has_style_class_name('solid');
+    },
+
     _updatePanel() {
         let panel = Main.sessionMode.panel;
         this._hideIndicators();
@@ -1073,8 +1077,12 @@ var Panel = new Lang.Class({
     },
 
     _updateSolidStyle() {
+        let hadSolidStyle = this.solidStyle;
+
         if (this.has_style_pseudo_class('overview') || !Main.sessionMode.hasWindows) {
             this._removeStyleClassName('solid');
+            if (hadSolidStyle)
+                this.emit('solid-style-changed');
             return;
         }
 
@@ -1104,6 +1112,8 @@ var Panel = new Lang.Class({
         else
             this._removeStyleClassName('solid');
 
+        if (isNearEnough != hadSolidStyle)
+            this.emit('solid-style-changed');
     },
 
     _hideIndicators() {
@@ -1213,3 +1223,4 @@ var Panel = new Lang.Class({
             });
     }
 });
+Signals.addSignalMethods(Panel.prototype);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]