read and use padding from current theme

This commit is contained in:
Olaf Leidinger 2015-02-22 12:53:14 +01:00
parent 9c600f4de4
commit fa2c7007fa
2 changed files with 8 additions and 0 deletions

View File

@ -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);
}

View File

@ -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;