mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Use custom panel on primary monitor
This commit is contained in:
@@ -23,6 +23,7 @@ const Meta = imports.gi.Meta;
|
||||
const St = imports.gi.St;
|
||||
|
||||
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
||||
const Panel = Me.imports.panel;
|
||||
const Proximity = Me.imports.proximity;
|
||||
const Utils = Me.imports.utils;
|
||||
|
||||
@@ -36,8 +37,8 @@ var DynamicTransparency = Utils.defineClass({
|
||||
this._windowOverlap = false;
|
||||
this.currentBackgroundColor = 0;
|
||||
|
||||
this._initialPanelStyle = dtpPanel.panel.actor.get_style();
|
||||
this._initialPanelCornerStyle = dtpPanel.panel._leftCorner.actor.get_style();
|
||||
this._initialPanelStyle = dtpPanel.get_style();
|
||||
this._initialPanelCornerStyle = dtpPanel._leftCorner.actor.get_style();
|
||||
|
||||
this._signalsHandler = new Utils.GlobalSignalsHandler();
|
||||
this._bindSignals();
|
||||
@@ -51,9 +52,9 @@ var DynamicTransparency = Utils.defineClass({
|
||||
this._signalsHandler.destroy();
|
||||
this._proximityManager.removeWatch(this._proximityWatchId);
|
||||
|
||||
this._dtpPanel.panel.actor.set_style(this._initialPanelStyle);
|
||||
this._dtpPanel.panel._leftCorner.actor.set_style(this._initialPanelCornerStyle);
|
||||
this._dtpPanel.panel._rightCorner.actor.set_style(this._initialPanelCornerStyle);
|
||||
this._dtpPanel.set_style(this._initialPanelStyle);
|
||||
this._dtpPanel._leftCorner.actor.set_style(this._initialPanelCornerStyle);
|
||||
this._dtpPanel._rightCorner.actor.set_style(this._initialPanelCornerStyle);
|
||||
},
|
||||
|
||||
_bindSignals: function() {
|
||||
@@ -165,7 +166,7 @@ var DynamicTransparency = Utils.defineClass({
|
||||
},
|
||||
|
||||
_updateComplementaryStyles: function() {
|
||||
let panelThemeNode = this._dtpPanel.panel.actor.get_theme_node();
|
||||
let panelThemeNode = this._dtpPanel.get_theme_node();
|
||||
|
||||
this._complementaryStyles = 'border-radius: ' + panelThemeNode.get_border_radius(0) + 'px;';
|
||||
},
|
||||
@@ -190,7 +191,7 @@ var DynamicTransparency = Utils.defineClass({
|
||||
this._gradientStyle = '';
|
||||
|
||||
if (Me.settings.get_boolean('trans-use-custom-gradient')) {
|
||||
this._gradientStyle += 'background-gradient-direction: vertical; ' +
|
||||
this._gradientStyle += 'background-gradient-direction: ' + (Panel.checkIfVertical() ? 'horizontal;' : 'vertical;') +
|
||||
'background-gradient-start: ' + Utils.getrgbaColor(Me.settings.get_string('trans-gradient-top-color'),
|
||||
Me.settings.get_double('trans-gradient-top-opacity')) +
|
||||
'background-gradient-end: ' + Utils.getrgbaColor(Me.settings.get_string('trans-gradient-bottom-color'),
|
||||
@@ -205,12 +206,12 @@ var DynamicTransparency = Utils.defineClass({
|
||||
let cornerStyle = '-panel-corner-background-color: ' + this.currentBackgroundColor + transition;
|
||||
|
||||
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);
|
||||
this._dtpPanel._leftCorner.actor.set_style(cornerStyle);
|
||||
this._dtpPanel._rightCorner.actor.set_style(cornerStyle);
|
||||
},
|
||||
|
||||
_setGradient: function() {
|
||||
this._dtpPanel.panel.actor.set_style(
|
||||
this._dtpPanel.set_style(
|
||||
'background: none; ' +
|
||||
'border-image: none; ' +
|
||||
'background-image: none; ' +
|
||||
|
||||
Reference in New Issue
Block a user