From f6b0ea14f11ebe3eaa6e96ba480ed3ac608ad9be Mon Sep 17 00:00:00 2001 From: franglais125 Date: Fri, 8 Sep 2017 03:16:29 -0400 Subject: [PATCH] Dynamic transparency: move style to stylesheet.css. We only keep manual tweaks for color and alpha in case the user set specific color/alpha from the available settings. --- stylesheet.css | 12 ++++++++++++ theming.js | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/stylesheet.css b/stylesheet.css index 6e9bf38cd..320c37e48 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -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); diff --git a/theming.js b/theming.js index 7fb73a01a..185abbf60 100644 --- a/theming.js +++ b/theming.js @@ -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) {