mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Fix vertical assignments for gnome 48
This commit is contained in:
@@ -1146,7 +1146,7 @@ export const Panel = GObject.registerClass(
|
||||
}
|
||||
|
||||
if (actor instanceof St.BoxLayout) {
|
||||
actor.vertical = isVertical
|
||||
Utils.setBoxLayoutVertical(actor, isVertical)
|
||||
} else if (
|
||||
actor != this.statusArea.appMenu &&
|
||||
((actor._delegate || actor) instanceof PanelMenu.ButtonBox ||
|
||||
|
||||
@@ -535,6 +535,7 @@ export const Taskbar = class extends EventEmitter {
|
||||
_updateIconAnimations(pointerX, pointerY) {
|
||||
this._iconAnimationTimestamp = Date.now()
|
||||
let type = iconAnimationSettings.type
|
||||
let vertical = this.dtpPanel.checkIfVertical()
|
||||
|
||||
if (!pointerX || !pointerY) [pointerX, pointerY] = global.get_pointer()
|
||||
|
||||
@@ -542,10 +543,8 @@ export const Taskbar = class extends EventEmitter {
|
||||
let [x, y] = item.get_transformed_position()
|
||||
let [width, height] = item.get_transformed_size()
|
||||
let [centerX, centerY] = [x + width / 2, y + height / 2]
|
||||
let size = this._box.vertical ? height : width
|
||||
let difference = this._box.vertical
|
||||
? pointerY - centerY
|
||||
: pointerX - centerX
|
||||
let size = vertical ? height : width
|
||||
let difference = vertical ? pointerY - centerY : pointerX - centerX
|
||||
let distance = Math.abs(difference)
|
||||
let maxDistance = (iconAnimationSettings.extent / 2) * size
|
||||
|
||||
|
||||
14
src/utils.js
14
src/utils.js
@@ -182,15 +182,23 @@ export const TimeoutsHandler = class extends BasicHandler {
|
||||
}
|
||||
|
||||
export function createBoxLayout(options) {
|
||||
if (options && Config.PACKAGE_VERSION >= '48') {
|
||||
// https://mutter.gnome.org/clutter/enum.Orientation.html
|
||||
options.orientation = options.vertical ? 1 : 0
|
||||
if (options && 'vertical' in options) {
|
||||
let vertical = options.vertical
|
||||
|
||||
delete options.vertical
|
||||
setBoxLayoutVertical(options, vertical)
|
||||
}
|
||||
|
||||
return new St.BoxLayout(options)
|
||||
}
|
||||
|
||||
export function setBoxLayoutVertical(box, vertical) {
|
||||
if (Config.PACKAGE_VERSION >= '48')
|
||||
// https://mutter.gnome.org/clutter/enum.Orientation.html
|
||||
box.orientation = vertical ? 1 : 0
|
||||
else box.vertical = vertical
|
||||
}
|
||||
|
||||
// This is wrapper to maintain compatibility with GNOME-Shell 3.30+ as well as
|
||||
// previous versions.
|
||||
export const DisplayWrapper = {
|
||||
|
||||
Reference in New Issue
Block a user