mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Fix datemenu offset on 3.36
This commit is contained in:
14
panel.js
14
panel.js
@@ -261,10 +261,16 @@ var dtpPanel = Utils.defineClass({
|
||||
this._panelConnectId = this.panel.actor.connect('allocate', (actor, box, flags) => this._mainPanelAllocate(actor, box, flags));
|
||||
}
|
||||
|
||||
if (this.statusArea.dateMenu && DateMenu.IndicatorPad) {
|
||||
// remove the extra space before the clock when the message-indicator is displayed
|
||||
// remove the extra space before the clock when the message-indicator is displayed
|
||||
if (DateMenu.IndicatorPad) {
|
||||
Utils.hookVfunc(DateMenu.IndicatorPad.prototype, 'get_preferred_width', () => [0,0]);
|
||||
Utils.hookVfunc(DateMenu.IndicatorPad.prototype, 'get_preferred_height', () => [0,0]);
|
||||
} else {
|
||||
//3.36 switched to a size constraint applied on an anonymous child
|
||||
let indicatorPad = this.statusArea.dateMenu.get_first_child().get_first_child();
|
||||
|
||||
this._dateMenuIndicatorPadContraints = indicatorPad.get_constraints();
|
||||
indicatorPad.clear_constraints();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,6 +478,10 @@ var dtpPanel = Utils.defineClass({
|
||||
if (DateMenu.IndicatorPad) {
|
||||
Utils.hookVfunc(DateMenu.IndicatorPad.prototype, 'get_preferred_width', DateMenu.IndicatorPad.prototype.vfunc_get_preferred_width);
|
||||
Utils.hookVfunc(DateMenu.IndicatorPad.prototype, 'get_preferred_height', DateMenu.IndicatorPad.prototype.vfunc_get_preferred_height);
|
||||
} else if (this._dateMenuIndicatorPadContraints) {
|
||||
let indicatorPad = this.statusArea.dateMenu.get_first_child().get_first_child();
|
||||
|
||||
this._dateMenuIndicatorPadContraints.forEach(c => indicatorPad.add_constraint(c));
|
||||
}
|
||||
|
||||
if (this._panelConnectId) {
|
||||
|
||||
Reference in New Issue
Block a user