mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
added patches from crab2313
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"uuid": "dash-to-panel@jderose9.github.com",
|
||||
"name": "Dash to Panel",
|
||||
"description": "An icon taskbar for the Gnome Shell. This extension moves the dash into the gnome main panel so that the application launchers and system tray are combined into a single panel, similar to that found in KDE Plasma and Windows 7+. A separate dock is no longer needed for easy access to running and favorited applications.\n\nFor a more traditional experience, you may also want to use Tweak Tool to enable Windows > Titlebar Buttons > Minimize & Maximize.\n\nFor the best support, please report any issues on Github. Dash-to-panel is developed and maintained by @jderose9 and @charlesg99.",
|
||||
"shell-version": [ "41" ],
|
||||
"shell-version": [ "41", "42" ],
|
||||
"url": "https://github.com/jderose9/dash-to-panel",
|
||||
"gettext-domain": "dash-to-panel",
|
||||
"version": 9999
|
||||
|
||||
80
panel.js
80
panel.js
@@ -99,7 +99,6 @@ var dtpPanel = Utils.defineClass({
|
||||
this._sessionStyle = null;
|
||||
this._unmappedButtons = [];
|
||||
this._elementGroups = [];
|
||||
this.cornerSize = 0;
|
||||
|
||||
let position = this.getPosition();
|
||||
|
||||
@@ -204,36 +203,18 @@ var dtpPanel = Utils.defineClass({
|
||||
let isTop = this.geom.position == St.Side.TOP;
|
||||
|
||||
if (isTop) {
|
||||
this.panel._leftCorner = this.panel._leftCorner || new Panel.PanelCorner(St.Side.LEFT);
|
||||
this.panel._rightCorner = this.panel._rightCorner || new Panel.PanelCorner(St.Side.RIGHT);
|
||||
|
||||
Main.overview._overview.insert_child_at_index(this._myPanelGhost, 0);
|
||||
} else {
|
||||
let overviewControls = Main.overview._overview._controls || Main.overview._controls;
|
||||
Main.overview._overview.add_actor(this._myPanelGhost);
|
||||
}
|
||||
|
||||
if (this.panel._leftCorner) {
|
||||
Utils.wrapActor(this.panel._leftCorner);
|
||||
Utils.wrapActor(this.panel._rightCorner);
|
||||
|
||||
if (isTop) {
|
||||
if (this.isStandalone) {
|
||||
this.panel.actor.add_child(this.panel._leftCorner.actor);
|
||||
this.panel.actor.add_child(this.panel._rightCorner.actor);
|
||||
}
|
||||
} else if (Config.PACKAGE_VERSION >= '3.32') {
|
||||
this.panel.actor.remove_child(this.panel._leftCorner.actor);
|
||||
this.panel.actor.remove_child(this.panel._rightCorner.actor);
|
||||
}
|
||||
}
|
||||
|
||||
this._setPanelPosition();
|
||||
|
||||
if (!this.isStandalone) {
|
||||
if (this.panel.vfunc_allocate) {
|
||||
this._panelConnectId = 0;
|
||||
Utils.hookVfunc(this.panel.__proto__, 'allocate', (box, flags) => this._mainPanelAllocate(0, box, flags));
|
||||
Utils.hookVfunc(Object.getPrototypeOf(this.panel), 'allocate', (box, flags) => this._mainPanelAllocate(0, box, flags));
|
||||
} else {
|
||||
this._panelConnectId = this.panel.actor.connect('allocate', (actor, box, flags) => this._mainPanelAllocate(actor, box, flags));
|
||||
}
|
||||
@@ -394,7 +375,6 @@ var dtpPanel = Utils.defineClass({
|
||||
|
||||
this._timeoutsHandler.destroy();
|
||||
this._signalsHandler.destroy();
|
||||
this._disablePanelCornerSignals();
|
||||
|
||||
this.panel.actor.remove_child(this.taskbar.actor);
|
||||
this._setAppmenuVisible(false);
|
||||
@@ -442,11 +422,6 @@ var dtpPanel = Utils.defineClass({
|
||||
});
|
||||
}
|
||||
|
||||
if (!this.panel._leftCorner.actor.mapped) {
|
||||
this.panel.actor.add_child(this.panel._leftCorner.actor);
|
||||
this.panel.actor.add_child(this.panel._rightCorner.actor);
|
||||
}
|
||||
|
||||
this._setShowDesktopButton(false);
|
||||
|
||||
delete Utils.getIndicators(this.statusArea.aggregateMenu._volume)._dtpIgnoreScroll;
|
||||
@@ -459,7 +434,7 @@ var dtpPanel = Utils.defineClass({
|
||||
if (this._panelConnectId) {
|
||||
this.panel.actor.disconnect(this._panelConnectId);
|
||||
} else {
|
||||
Utils.hookVfunc(this.panel.__proto__, 'allocate', this.panel.__proto__.vfunc_allocate);
|
||||
Utils.hookVfunc(Object.getPrototypeOf(this.panel), 'allocate', Object.getPrototypeOf(this.panel).vfunc_allocate);
|
||||
}
|
||||
|
||||
this.panel.actor._delegate = this.panel;
|
||||
@@ -513,26 +488,6 @@ var dtpPanel = Utils.defineClass({
|
||||
|
||||
this._updateGroupedElements(panelPositions);
|
||||
|
||||
this._disablePanelCornerSignals();
|
||||
|
||||
if (this.getPosition() == St.Side.TOP) {
|
||||
let visibleElements = panelPositions.filter(pp => pp.visible);
|
||||
let connectCorner = (corner, button) => {
|
||||
corner._button = button;
|
||||
corner._buttonStyleChangedSignalId = button.connect('style-changed', () => {
|
||||
corner.set_style_pseudo_class(button.get_style_pseudo_class());
|
||||
});
|
||||
}
|
||||
|
||||
if (visibleElements[0].element == Pos.ACTIVITIES_BTN) {
|
||||
connectCorner(this.panel._leftCorner, this.statusArea.activities);
|
||||
}
|
||||
|
||||
if (visibleElements[visibleElements.length - 1].element == Pos.SYSTEM_MENU) {
|
||||
connectCorner(this.panel._rightCorner, this.statusArea.aggregateMenu);
|
||||
}
|
||||
}
|
||||
|
||||
this.panel.actor.hide();
|
||||
this.panel.actor.show();
|
||||
},
|
||||
@@ -587,18 +542,6 @@ var dtpPanel = Utils.defineClass({
|
||||
});
|
||||
},
|
||||
|
||||
_disablePanelCornerSignals: function() {
|
||||
if (this.panel._rightCorner && this.panel._rightCorner._buttonStyleChangedSignalId) {
|
||||
this.panel._rightCorner._button.disconnect(this.panel._rightCorner._buttonStyleChangedSignalId);
|
||||
delete this.panel._rightCorner._buttonStyleChangedSignalId;
|
||||
}
|
||||
|
||||
if (this.panel._leftCorner && this.panel._leftCorner._buttonStyleChangedSignalId) {
|
||||
this.panel._leftCorner._button.disconnect(this.panel._leftCorner._buttonStyleChangedSignalId);
|
||||
delete this.panel._leftCorner._buttonStyleChangedSignalId;
|
||||
}
|
||||
},
|
||||
|
||||
_bindSettingsChanges: function() {
|
||||
let isVertical = this.checkIfVertical();
|
||||
|
||||
@@ -1006,26 +949,17 @@ var dtpPanel = Utils.defineClass({
|
||||
if (this.geom.position == St.Side.TOP) {
|
||||
let childBoxLeftCorner = new Clutter.ActorBox();
|
||||
let childBoxRightCorner = new Clutter.ActorBox();
|
||||
let currentCornerSize = this.cornerSize;
|
||||
let panelAllocFixedSize = box[this.fixedCoord.c2] - box[this.fixedCoord.c1];
|
||||
|
||||
[ , this.cornerSize] = this.panel._leftCorner.actor[this.sizeFunc](-1);
|
||||
childBoxLeftCorner[this.varCoord.c1] = 0;
|
||||
childBoxLeftCorner[this.varCoord.c2] = this.cornerSize;
|
||||
childBoxLeftCorner[this.varCoord.c2] = 0;
|
||||
childBoxLeftCorner[this.fixedCoord.c1] = panelAllocFixedSize;
|
||||
childBoxLeftCorner[this.fixedCoord.c2] = panelAllocFixedSize + this.cornerSize;
|
||||
childBoxLeftCorner[this.fixedCoord.c2] = panelAllocFixedSize;
|
||||
|
||||
childBoxRightCorner[this.varCoord.c1] = box[this.varCoord.c2] - this.cornerSize;
|
||||
childBoxRightCorner[this.varCoord.c1] = box[this.varCoord.c2];
|
||||
childBoxRightCorner[this.varCoord.c2] = box[this.varCoord.c2];
|
||||
childBoxRightCorner[this.fixedCoord.c1] = panelAllocFixedSize;
|
||||
childBoxRightCorner[this.fixedCoord.c2] = panelAllocFixedSize + this.cornerSize;
|
||||
|
||||
Utils.allocate(this.panel._leftCorner.actor, childBoxLeftCorner, flags);
|
||||
Utils.allocate(this.panel._rightCorner.actor, childBoxRightCorner, flags);
|
||||
|
||||
if (this.cornerSize != currentCornerSize) {
|
||||
this._setPanelClip();
|
||||
}
|
||||
childBoxRightCorner[this.fixedCoord.c2] = panelAllocFixedSize;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1052,7 +986,7 @@ var dtpPanel = Utils.defineClass({
|
||||
|
||||
_setPanelClip: function(clipContainer) {
|
||||
clipContainer = clipContainer || this.panelBox.get_parent();
|
||||
this._timeoutsHandler.add([T7, 0, () => Utils.setClip(clipContainer, clipContainer.x, clipContainer.y, this.panelBox.width, this.panelBox.height + this.cornerSize)]);
|
||||
this._timeoutsHandler.add([T7, 0, () => Utils.setClip(clipContainer, clipContainer.x, clipContainer.y, this.panelBox.width, this.panelBox.height)]);
|
||||
},
|
||||
|
||||
_onButtonPress: function(actor, event) {
|
||||
|
||||
@@ -682,7 +682,7 @@ function newUpdateHotCorners() {
|
||||
if (haveTopLeftCorner) {
|
||||
let corner = new Layout.HotCorner(this, monitor, cornerX, cornerY);
|
||||
|
||||
corner.setBarrierSize = size => corner.__proto__.setBarrierSize.call(corner, Math.min(size, 32));
|
||||
corner.setBarrierSize = size => Object.getPrototypeOf(corner).setBarrierSize.call(corner, Math.min(size, 32));
|
||||
corner.setBarrierSize(panel ? panel.dtpSize : 32);
|
||||
this.hotCorners.push(corner);
|
||||
} else {
|
||||
|
||||
@@ -1232,7 +1232,7 @@ var taskbar = Utils.defineClass({
|
||||
return Clutter.EVENT_STOP;
|
||||
}
|
||||
|
||||
return this.__proto__._onStageKeyPress.call(this, actor, event);
|
||||
return Object.getPrototypeOf(this)._onStageKeyPress.call(this, actor, event);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -39,10 +39,6 @@ var DynamicTransparency = Utils.defineClass({
|
||||
|
||||
this._initialPanelStyle = dtpPanel.panel.actor.get_style();
|
||||
|
||||
if (this._dtpPanel.geom.position == St.Side.TOP) {
|
||||
this._initialPanelCornerStyle = dtpPanel.panel._leftCorner.actor.get_style();
|
||||
}
|
||||
|
||||
this._signalsHandler = new Utils.GlobalSignalsHandler();
|
||||
this._bindSignals();
|
||||
|
||||
@@ -56,11 +52,6 @@ var DynamicTransparency = Utils.defineClass({
|
||||
this._proximityManager.removeWatch(this._proximityWatchId);
|
||||
|
||||
this._dtpPanel.panel.actor.set_style(this._initialPanelStyle);
|
||||
|
||||
if (this._dtpPanel.geom.position == St.Side.TOP) {
|
||||
this._dtpPanel.panel._leftCorner.actor.set_style(this._initialPanelCornerStyle);
|
||||
this._dtpPanel.panel._rightCorner.actor.set_style(this._initialPanelCornerStyle);
|
||||
}
|
||||
},
|
||||
|
||||
updateExternalStyle: function() {
|
||||
@@ -218,14 +209,8 @@ var DynamicTransparency = Utils.defineClass({
|
||||
this.currentBackgroundColor = Utils.getrgbaColor(this.backgroundColorRgb, this.alpha);
|
||||
|
||||
let transition = 'transition-duration:' + this.animationDuration;
|
||||
let cornerStyle = '-panel-corner-background-color: ' + this.currentBackgroundColor + transition;
|
||||
|
||||
this._dtpPanel.set_style('background-color: ' + this.currentBackgroundColor + transition + this._complementaryStyles);
|
||||
|
||||
if (this._dtpPanel.geom.position == St.Side.TOP) {
|
||||
this._dtpPanel.panel._leftCorner.actor.set_style(cornerStyle);
|
||||
this._dtpPanel.panel._rightCorner.actor.set_style(cornerStyle);
|
||||
}
|
||||
},
|
||||
|
||||
_setGradient: function() {
|
||||
|
||||
5
utils.js
5
utils.js
@@ -359,8 +359,7 @@ var mergeObjects = function(main, bck) {
|
||||
var hookVfunc = function(proto, symbol, func) {
|
||||
if (Gi.hook_up_vfunc_symbol && func) {
|
||||
//gjs > 1.53.3
|
||||
// todo
|
||||
//proto[Gi.hook_up_vfunc_symbol](symbol, func);
|
||||
proto[Gi.gobject_prototype_symbol][Gi.hook_up_vfunc_symbol](symbol, func);
|
||||
} else {
|
||||
//On older gjs, this is how to hook vfunc. It is buggy and can't be used reliably to replace
|
||||
//already hooked functions. Since it's our only use for it, disabled for now (and probably forever)
|
||||
@@ -389,7 +388,7 @@ var getTransformedAllocation = function(actor) {
|
||||
};
|
||||
|
||||
var allocate = function(actor, box, flags, useParent) {
|
||||
let allocateObj = useParent ? actor.__proto__ : actor;
|
||||
let allocateObj = useParent ? Object.getPrototypeOf(actor) : actor;
|
||||
|
||||
allocateObj.allocate.apply(actor, getAllocationParams(box, flags));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user