From fa2c7007fa38b8c2f465b9fb6f79fe6b3bf1a1c9 Mon Sep 17 00:00:00 2001 From: Olaf Leidinger Date: Sun, 22 Feb 2015 12:53:14 +0100 Subject: [PATCH] read and use padding from current theme --- src/extension.js | 4 ++++ src/icon.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/extension.js b/src/extension.js index ce85cdc..8246998 100644 --- a/src/extension.js +++ b/src/extension.js @@ -348,6 +348,8 @@ const TeaTime = new Lang.Class({ _onStyleChanged: function(actor) { let themeNode = actor.get_theme_node(); let color = themeNode.get_foreground_color() + let [bHasPadding, padding] = themeNode.lookup_length("-natural-hpadding", false); + this._primaryColor = color; this._secondaryColor = new Clutter.Color({ red: color.red, @@ -355,6 +357,8 @@ const TeaTime = new Lang.Class({ blue: color.blue, alpha: color.alpha*0.3 }); + this._logo.setPadding(bHasPadding*padding); + this._graphicalTimer.setPadding(bHasPadding*padding); this._logo.setColor(this._primaryColor, this._secondaryColor); this._graphicalTimer.setColor(this._primaryColor, this._secondaryColor); } diff --git a/src/icon.js b/src/icon.js index 0149a0d..f14cdfa 100644 --- a/src/icon.js +++ b/src/icon.js @@ -39,6 +39,10 @@ const TwoColorIcon = new Lang.Class({ this._secundaryColor = this._primaryColor; this._currentStatus = null; }, + setPadding: function(padding) { + this.margin_left = padding; + this.margin_right = padding; + }, setColor: function(primary, secundary) { this._primaryColor = primary; this._secundaryColor = secundary;