mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Use custom container to set background color
This commit is contained in:
20
panel.js
20
panel.js
@@ -86,6 +86,13 @@ var dtpPanelWrapper = Utils.defineClass({
|
||||
|
||||
this._oldPanelHeight = this.panel.actor.get_height();
|
||||
|
||||
this.panelBg = new St.Widget({ layout_manager: new Clutter.BinLayout() });
|
||||
this.panelBox.remove_actor(this.panel.actor);
|
||||
this.panelBg.add_child(this.panel.actor);
|
||||
this.panelBox.add(this.panelBg);
|
||||
|
||||
this.panelBg.styles = 'border-radius: ' + this.panel.actor.get_theme_node().get_border_radius(0) + 'px;';
|
||||
|
||||
// The overview uses the this.panel height as a margin by way of a "ghost" transparent Clone
|
||||
// This pushes everything down, which isn't desired when the this.panel is moved to the bottom
|
||||
// I'm adding a 2nd ghost this.panel and will resize the top or bottom ghost depending on the this.panel position
|
||||
@@ -274,6 +281,9 @@ var dtpPanelWrapper = Utils.defineClass({
|
||||
// reset stored icon size to the default dash
|
||||
Main.overview.dashIconSize = Main.overview._controls.dash.iconSize;
|
||||
|
||||
this.panelBg.remove_actor(this.panel.actor);
|
||||
this.panelBox.add(this.panel.actor);
|
||||
|
||||
this.panel.actor.remove_style_class_name('dashtopanelMainPanel');
|
||||
|
||||
// remove this.panel styling
|
||||
@@ -765,10 +775,18 @@ var dtpSecondaryPanel = Utils.defineClass({
|
||||
},
|
||||
|
||||
vfunc_allocate: function(box, flags) {
|
||||
if(this.delegate) {
|
||||
if (this.delegate) {
|
||||
this.delegate._vfunc_allocate(box, flags);
|
||||
}
|
||||
},
|
||||
|
||||
vfunc_get_preferred_width(forHeight) {
|
||||
if (this.delegate) {
|
||||
return [0, this.delegate.monitor.width];
|
||||
}
|
||||
|
||||
return [0, 0];
|
||||
},
|
||||
|
||||
_setPanelMenu: function(settingName, propName, constr, container, isInit) {
|
||||
if (isInit) {
|
||||
|
||||
@@ -77,7 +77,7 @@ var dtpPanelManager = Utils.defineClass({
|
||||
if (monitor == dtpPrimaryMonitor)
|
||||
return;
|
||||
|
||||
let panelBox = new St.BoxLayout({ name: 'dashtopanelSecondaryPanelBox', vertical: true });
|
||||
let panelBox = new St.BoxLayout({ name: 'panelBox', vertical: true });
|
||||
Main.layoutManager.addChrome(panelBox, { affectsStruts: true, trackFullscreen: true });
|
||||
|
||||
let panel = new Panel.dtpSecondaryPanel(this._dtpSettings, monitor);
|
||||
|
||||
@@ -39,7 +39,6 @@ var DynamicTransparency = Utils.defineClass({
|
||||
|
||||
this._initialPanelStyle = dtpPanel.panel.actor.get_style();
|
||||
this._initialPanelCornerStyle = dtpPanel.panel._leftCorner.actor.get_style();
|
||||
this._initialPanelBoxStyle = dtpPanel.panelBox.get_style();
|
||||
|
||||
this._signalsHandler = new Utils.GlobalSignalsHandler();
|
||||
this._bindSignals();
|
||||
@@ -54,7 +53,6 @@ var DynamicTransparency = Utils.defineClass({
|
||||
this._proximityManager.removeWatch(this._proximityWatchId);
|
||||
|
||||
this._dtpPanel.panel.actor.set_style(this._initialPanelStyle);
|
||||
this._dtpPanel.panelBox.set_style(this._initialPanelBoxStyle);
|
||||
this._dtpPanel.panel._leftCorner.actor.set_style(this._initialPanelCornerStyle);
|
||||
this._dtpPanel.panel._rightCorner.actor.set_style(this._initialPanelCornerStyle);
|
||||
},
|
||||
@@ -200,7 +198,7 @@ var DynamicTransparency = Utils.defineClass({
|
||||
let transition = 'transition-duration:' + this._animationDuration;
|
||||
let cornerStyle = '-panel-corner-background-color: ' + this.currentBackgroundColor + transition;
|
||||
|
||||
this._dtpPanel.panelBox.set_style('background-color: ' + this.currentBackgroundColor + transition);
|
||||
this._dtpPanel.panelBg.set_style('background-color: ' + this.currentBackgroundColor + transition + this._dtpPanel.panelBg.styles);
|
||||
this._dtpPanel.panel._leftCorner.actor.set_style(cornerStyle);
|
||||
this._dtpPanel.panel._rightCorner.actor.set_style(cornerStyle);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user