mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Merge branch 'master' into custom-window-preview
This commit is contained in:
13
panel.js
13
panel.js
@@ -156,7 +156,11 @@ var dtpPanelWrapper = Utils.defineClass({
|
||||
if(this.appMenu)
|
||||
this.panel._leftBox.remove_child(this.appMenu.container);
|
||||
|
||||
this.dynamicTransparency = new Transparency.DynamicTransparency(this);
|
||||
//the timeout makes sure the theme's styles are computed before initially applying the transparency
|
||||
this.startDynamicTransparencyId = Mainloop.timeout_add(0, () => {
|
||||
this.dynamicTransparency = new Transparency.DynamicTransparency(this);
|
||||
});
|
||||
|
||||
this.taskbar = new Taskbar.taskbar(this._dtpSettings, this);
|
||||
Main.overview.dashIconSize = this.taskbar.iconSize;
|
||||
|
||||
@@ -276,7 +280,12 @@ var dtpPanelWrapper = Utils.defineClass({
|
||||
this._showDesktopTimeoutId = 0;
|
||||
}
|
||||
|
||||
this.dynamicTransparency.destroy();
|
||||
if (this.startDynamicTransparencyId) {
|
||||
Mainloop.source_remove(this.startDynamicTransparencyId);
|
||||
this.startDynamicTransparencyId = 0;
|
||||
} else {
|
||||
this.dynamicTransparency.destroy();
|
||||
}
|
||||
|
||||
// reset stored icon size to the default dash
|
||||
Main.overview.dashIconSize = Main.overview._controls.dash.iconSize;
|
||||
|
||||
@@ -118,7 +118,8 @@ var taskbarActor = Utils.defineClass({
|
||||
hupper = Math.floor(hupper);
|
||||
scrollview._dtpFadeSize = hupper > hpageSize ? this._delegate.iconSize : 0;
|
||||
|
||||
if (this._currentBackgroundColor !== this._delegate.panelWrapper.dynamicTransparency.currentBackgroundColor) {
|
||||
if (this._delegate.panelWrapper.dynamicTransparency &&
|
||||
this._currentBackgroundColor !== this._delegate.panelWrapper.dynamicTransparency.currentBackgroundColor) {
|
||||
this._currentBackgroundColor = this._delegate.panelWrapper.dynamicTransparency.currentBackgroundColor;
|
||||
let gradientStart = 'background-gradient-start: ' + this._currentBackgroundColor;
|
||||
leftFade.set_style(gradientStart);
|
||||
|
||||
@@ -144,6 +144,7 @@ var DynamicTransparency = Utils.defineClass({
|
||||
|
||||
this._updateColor(themeBackground);
|
||||
this._updateAlpha(themeBackground);
|
||||
this._updateComplementaryStyles();
|
||||
this._updateGradient();
|
||||
this._setBackground();
|
||||
this._setGradient();
|
||||
@@ -164,6 +165,12 @@ var DynamicTransparency = Utils.defineClass({
|
||||
this._setGradient();
|
||||
},
|
||||
|
||||
_updateComplementaryStyles: function() {
|
||||
let panelThemeNode = this._dtpPanel.panel.actor.get_theme_node();
|
||||
|
||||
this._complementaryStyles = 'border-radius: ' + panelThemeNode.get_border_radius(0) + 'px;';
|
||||
},
|
||||
|
||||
_updateColor: function(themeBackground) {
|
||||
this.backgroundColorRgb = this._dtpSettings.get_boolean('trans-use-custom-bg') ?
|
||||
this._dtpSettings.get_string('trans-bg-color') :
|
||||
@@ -198,7 +205,7 @@ var DynamicTransparency = Utils.defineClass({
|
||||
let transition = 'transition-duration:' + this.animationDuration;
|
||||
let cornerStyle = '-panel-corner-background-color: ' + this.currentBackgroundColor + transition;
|
||||
|
||||
this._dtpPanel.panelBg.set_style('background-color: ' + this.currentBackgroundColor + transition + this._dtpPanel.panelBg.styles);
|
||||
this._dtpPanel.panelBg.set_style('background-color: ' + this.currentBackgroundColor + transition + this._complementaryStyles);
|
||||
this._dtpPanel.panel._leftCorner.actor.set_style(cornerStyle);
|
||||
this._dtpPanel.panel._rightCorner.actor.set_style(cornerStyle);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user