mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Simplify insertion of panel bg in panelbox
This commit is contained in:
20
panel.js
20
panel.js
@@ -110,6 +110,8 @@ var dtpPanel = Utils.defineClass({
|
||||
let position = getPosition();
|
||||
|
||||
this.callParent('_init', { name: 'panel', reactive: true });
|
||||
this.bg = new St.Widget({ layout_manager: new Clutter.BinLayout() });
|
||||
this.bg.add_child(this);
|
||||
|
||||
Utils.wrapActor(this);
|
||||
this._delegate = this;
|
||||
@@ -198,13 +200,7 @@ var dtpPanel = Utils.defineClass({
|
||||
}
|
||||
|
||||
this.geom = this.getGeometry();
|
||||
this.panelBg = new St.Widget({ layout_manager: new Clutter.BinLayout() });
|
||||
this.panelBox.remove_actor(this);
|
||||
this.panelBg.add_child(this);
|
||||
this.panelBox.add(this.panelBg);
|
||||
|
||||
this.panelBg.styles = 'border-radius: ' + this.get_theme_node().get_border_radius(0) + 'px;';
|
||||
|
||||
|
||||
// The overview uses the panel height as a margin by way of a "ghost" transparent Clone
|
||||
// This pushes everything down, which isn't desired when the panel is moved to the bottom
|
||||
// I'm adding a 2nd ghost panel and will resize the top or bottom ghost depending on the panel position
|
||||
@@ -430,9 +426,6 @@ var dtpPanel = Utils.defineClass({
|
||||
// reset stored icon size to the default dash
|
||||
Main.overview.dashIconSize = Main.overview._controls.dash.iconSize;
|
||||
|
||||
this.panelBg.remove_actor(this);
|
||||
this.panelBox.add(this);
|
||||
|
||||
this.menuManager._changeMenu = this.menuManager._oldChangeMenu;
|
||||
|
||||
this._myPanelGhost.get_parent().remove_actor(this._myPanelGhost);
|
||||
@@ -469,13 +462,6 @@ var dtpPanel = Utils.defineClass({
|
||||
}
|
||||
|
||||
Main.ctrlAltTabManager.removeGroup(this);
|
||||
|
||||
Main.layoutManager.removeChrome(this.panelBox);
|
||||
this.panelBox.destroy();
|
||||
|
||||
this.container = null;
|
||||
this.taskbar = null;
|
||||
this._signalsHandler = null;
|
||||
},
|
||||
|
||||
//next 3 functions are needed by other extensions to add elements to the secondary panel
|
||||
|
||||
@@ -217,6 +217,8 @@ var dtpPanelManager = Utils.defineClass({
|
||||
this._removePanelBarriers(p);
|
||||
|
||||
p.disable();
|
||||
Main.layoutManager.removeChrome(p.panelBox);
|
||||
p.panelBox.destroy();
|
||||
});
|
||||
|
||||
if (BoxPointer.BoxPointer.prototype.vfunc_get_preferred_height) {
|
||||
@@ -224,9 +226,6 @@ var dtpPanelManager = Utils.defineClass({
|
||||
}
|
||||
|
||||
if (reset) return;
|
||||
|
||||
Main.overview._panelGhost.set_height(Main.panel.height);
|
||||
|
||||
this._setKeyBindings(false);
|
||||
|
||||
this._signalsHandler.destroy();
|
||||
@@ -249,6 +248,7 @@ var dtpPanelManager = Utils.defineClass({
|
||||
Main.overview.viewSelector._workspacesDisplay._updateWorkspacesViews = this._oldUpdateWorkspacesViews;
|
||||
Main.overview.getShowAppsButton = this._oldGetShowAppsButton;
|
||||
|
||||
Main.overview._panelGhost.set_height(Main.panel.actor.height);
|
||||
Main.panel.actor.show();
|
||||
|
||||
if (this._needsDashItemContainerAllocate) {
|
||||
@@ -283,7 +283,7 @@ var dtpPanelManager = Utils.defineClass({
|
||||
let panelBox = new St.BoxLayout({ name: 'panelBox' });
|
||||
let panel = new Panel.dtpPanel(this, monitor, panelBox, isSecondary);
|
||||
|
||||
panelBox.add(panel);
|
||||
panelBox.add(panel.bg);
|
||||
Main.layoutManager.addChrome(panelBox, { affectsStruts: true, trackFullscreen: true });
|
||||
panel.enable();
|
||||
|
||||
|
||||
@@ -215,7 +215,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._complementaryStyles);
|
||||
this._dtpPanel.bg.set_style('background-color: ' + this.currentBackgroundColor + transition + this._complementaryStyles);
|
||||
|
||||
if (this._dtpPanel._leftCorner) {
|
||||
this._dtpPanel._leftCorner.actor.set_style(cornerStyle);
|
||||
|
||||
Reference in New Issue
Block a user