Skip to content

Commit

Permalink
Dynamic transparency: move style to stylesheet.css.
Browse files Browse the repository at this point in the history
We only keep manual tweaks for color and alpha in case the
user set specific color/alpha from the available settings.
  • Loading branch information
franglais125 committed Sep 8, 2017
1 parent e0fc16a commit f6b0ea1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
12 changes: 12 additions & 0 deletions stylesheet.css
Expand Up @@ -95,6 +95,18 @@
background: #2e3436;
}

#dashtodockContainer .opaque {
background-color: rgba(46, 52, 54, 0.8);
border-color: rgba(128, 128, 128, 0.4);
transition-duration: 300ms;
}

#dashtodockContainer .transparent {
background-color: rgba(46, 52, 54, 0.2);
border-color: rgba(128, 128, 128, 0.1);
transition-duration: 500ms;
}

#dashtodockContainer .number-overlay {
color: rgba(255,255,255,1);
background-color: rgba(0,0,0,0.8);
Expand Down
18 changes: 12 additions & 6 deletions theming.js
Expand Up @@ -453,23 +453,29 @@ const Transparency = new Lang.Class({
}
}));

if (isNearEnough)
if (isNearEnough) {
this._actor.remove_style_class_name('transparent');
this._actor.add_style_class_name('opaque');
this._actor.set_style(this._opaque_style);
else
}
else {
this._actor.remove_style_class_name('opaque');
this._actor.add_style_class_name('transparent');
this._actor.set_style(this._transparent_style);
}
},

_updateStyles: function() {
this._transparent_style = 'background-color: rgba(' +
this._backgroundColor + ',' + this._alpha + ');' +
'border-color: rgba(' +
this._backgroundColor + ',' + this._borderAlpha + ');' +
'transition-duration: 500ms;';
this._backgroundColor + ',' + this._borderAlpha + ');';

this._opaque_style = 'background-color: rgba(' +
this._backgroundColor + ',' + '1);' +
'border-color: rgba(' +
this._backgroundColor + ',' + this._originalBorderAlpha + ');' +
'transition-duration: 300ms;';
this._backgroundColor + ',' + this._originalBorderAlpha + ');';

},

setColor: function(color) {
Expand Down

0 comments on commit f6b0ea1

Please sign in to comment.