mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Include vertical flag in panel geometry
This commit is contained in:
@@ -171,7 +171,7 @@ export const TaskbarAppIcon = GObject.registerClass(
|
|||||||
})
|
})
|
||||||
this._dtpIconContainer = new St.Widget({
|
this._dtpIconContainer = new St.Widget({
|
||||||
layout_manager: new Clutter.BinLayout(),
|
layout_manager: new Clutter.BinLayout(),
|
||||||
style: getIconContainerStyle(panel.checkIfVertical()),
|
style: getIconContainerStyle(panel.geom.vertical),
|
||||||
})
|
})
|
||||||
|
|
||||||
this.remove_child(this._iconContainer)
|
this.remove_child(this._iconContainer)
|
||||||
@@ -202,7 +202,7 @@ export const TaskbarAppIcon = GObject.registerClass(
|
|||||||
this._container.add_child(this._dotsContainer)
|
this._container.add_child(this._dotsContainer)
|
||||||
this.set_child(this._container)
|
this.set_child(this._container)
|
||||||
|
|
||||||
if (panel.checkIfVertical()) {
|
if (panel.geom.vertical) {
|
||||||
this.set_width(panel.geom.innerSize)
|
this.set_width(panel.geom.innerSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -729,7 +729,7 @@ export const TaskbarAppIcon = GObject.registerClass(
|
|||||||
SETTINGS.get_int('group-apps-label-max-width') * scaleFactor
|
SETTINGS.get_int('group-apps-label-max-width') * scaleFactor
|
||||||
let variableWidth =
|
let variableWidth =
|
||||||
!useFixedWidth ||
|
!useFixedWidth ||
|
||||||
this.dtpPanel.checkIfVertical() ||
|
this.dtpPanel.geom.vertical ||
|
||||||
this.dtpPanel.taskbar.fullScrollView
|
this.dtpPanel.taskbar.fullScrollView
|
||||||
|
|
||||||
this._windowTitle[maxLabelWidth > 0 ? 'show' : 'hide']()
|
this._windowTitle[maxLabelWidth > 0 ? 'show' : 'hide']()
|
||||||
@@ -809,7 +809,7 @@ export const TaskbarAppIcon = GObject.registerClass(
|
|||||||
let bgSvg = '/img/highlight_stacked_bg'
|
let bgSvg = '/img/highlight_stacked_bg'
|
||||||
|
|
||||||
if (pos == DOT_POSITION.LEFT || pos == DOT_POSITION.RIGHT) {
|
if (pos == DOT_POSITION.LEFT || pos == DOT_POSITION.RIGHT) {
|
||||||
bgSvg += this.dtpPanel.checkIfVertical() ? '_2' : '_3'
|
bgSvg += this.dtpPanel.geom.vertical ? '_2' : '_3'
|
||||||
}
|
}
|
||||||
|
|
||||||
inlineStyle +=
|
inlineStyle +=
|
||||||
@@ -858,7 +858,7 @@ export const TaskbarAppIcon = GObject.registerClass(
|
|||||||
_setAppIconPadding() {
|
_setAppIconPadding() {
|
||||||
const padding = getIconPadding(this.dtpPanel)
|
const padding = getIconPadding(this.dtpPanel)
|
||||||
const margin = SETTINGS.get_int('appicon-margin')
|
const margin = SETTINGS.get_int('appicon-margin')
|
||||||
let vertical = this.dtpPanel.checkIfVertical()
|
let vertical = this.dtpPanel.geom.vertical
|
||||||
|
|
||||||
this.set_style(
|
this.set_style(
|
||||||
`padding: ${vertical ? margin : 0}px ${vertical ? 0 : margin}px;`,
|
`padding: ${vertical ? margin : 0}px ${vertical ? 0 : margin}px;`,
|
||||||
@@ -2012,7 +2012,7 @@ export function ItemShowLabel() {
|
|||||||
let labelWidth = this.label.get_width()
|
let labelWidth = this.label.get_width()
|
||||||
let labelHeight = this.label.get_height()
|
let labelHeight = this.label.get_height()
|
||||||
|
|
||||||
let position = this._dtpPanel.getPosition()
|
let position = this._dtpPanel.geom.position
|
||||||
let labelOffset = node.get_length('-x-offset')
|
let labelOffset = node.get_length('-x-offset')
|
||||||
|
|
||||||
// From TaskbarItemContainer
|
// From TaskbarItemContainer
|
||||||
@@ -2180,7 +2180,7 @@ export const ShowAppsIconWrapper = class extends EventEmitter {
|
|||||||
setShowAppsPadding() {
|
setShowAppsPadding() {
|
||||||
let padding = getIconPadding(this.realShowAppsIcon._dtpPanel)
|
let padding = getIconPadding(this.realShowAppsIcon._dtpPanel)
|
||||||
let sidePadding = SETTINGS.get_int('show-apps-icon-side-padding')
|
let sidePadding = SETTINGS.get_int('show-apps-icon-side-padding')
|
||||||
let isVertical = this.realShowAppsIcon._dtpPanel.checkIfVertical()
|
let isVertical = this.realShowAppsIcon._dtpPanel.geom.vertical
|
||||||
|
|
||||||
this.actor.set_style(
|
this.actor.set_style(
|
||||||
'padding:' +
|
'padding:' +
|
||||||
@@ -2254,7 +2254,7 @@ export const ShowAppsIconWrapper = class extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
export const MyShowAppsIconMenu = class extends PopupMenu.PopupMenu {
|
export const MyShowAppsIconMenu = class extends PopupMenu.PopupMenu {
|
||||||
constructor(actor, dtpPanel) {
|
constructor(actor, dtpPanel) {
|
||||||
super(actor, 0, dtpPanel.getPosition())
|
super(actor, 0, dtpPanel.geom.position)
|
||||||
|
|
||||||
this._dtpPanel = dtpPanel
|
this._dtpPanel = dtpPanel
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export const Intellihide = class {
|
|||||||
this._hoveredOut = false
|
this._hoveredOut = false
|
||||||
this._windowOverlap = false
|
this._windowOverlap = false
|
||||||
this._translationProp =
|
this._translationProp =
|
||||||
'translation_' + (this._dtpPanel.checkIfVertical() ? 'x' : 'y')
|
'translation_' + (this._dtpPanel.geom.vertical ? 'x' : 'y')
|
||||||
|
|
||||||
this._panelBox.translation_y = 0
|
this._panelBox.translation_y = 0
|
||||||
this._panelBox.translation_x = 0
|
this._panelBox.translation_x = 0
|
||||||
@@ -332,7 +332,7 @@ export const Intellihide = class {
|
|||||||
let position = this._dtpPanel.geom.position
|
let position = this._dtpPanel.geom.position
|
||||||
let opts = { backend: global.backend }
|
let opts = { backend: global.backend }
|
||||||
|
|
||||||
if (this._dtpPanel.checkIfVertical()) {
|
if (this._dtpPanel.geom.vertical) {
|
||||||
opts.y1 = this._monitor.y
|
opts.y1 = this._monitor.y
|
||||||
opts.y2 = this._monitor.y + this._monitor.height
|
opts.y2 = this._monitor.y + this._monitor.height
|
||||||
opts.x1 = opts.x2 = this._monitor.x
|
opts.x1 = opts.x2 = this._monitor.x
|
||||||
@@ -391,24 +391,30 @@ export const Intellihide = class {
|
|||||||
_pointerIn(x, y, fixedOffset, limitSizeSetting) {
|
_pointerIn(x, y, fixedOffset, limitSizeSetting) {
|
||||||
let geom = this._dtpPanel.geom
|
let geom = this._dtpPanel.geom
|
||||||
let position = geom.position
|
let position = geom.position
|
||||||
let varCoordY1 = this._monitor.y
|
let varCoordX1 = this._monitor.x
|
||||||
|
let varCoordY1 = geom.vertical ? geom.y : this._monitor.y // if vertical, ignore the original GS panel if present
|
||||||
let varOffset = {}
|
let varOffset = {}
|
||||||
|
|
||||||
if (geom.dockMode && SETTINGS.get_boolean(limitSizeSetting)) {
|
if (geom.dockMode && SETTINGS.get_boolean(limitSizeSetting)) {
|
||||||
let refActor = geom.dynamic
|
let alloc = this._dtpPanel.allocation
|
||||||
? this._dtpPanel
|
|
||||||
: this._dtpPanel.clipContainer
|
|
||||||
|
|
||||||
varOffset[this._dtpPanel.varCoord.c1] =
|
if (!geom.dynamic) {
|
||||||
refActor.allocation[this._dtpPanel.varCoord.c1]
|
// when fixed, use the panel clipcontainer which is positioned
|
||||||
varOffset[this._dtpPanel.varCoord.c2] =
|
// relative to the stage itself
|
||||||
refActor.allocation[this._dtpPanel.varCoord.c2]
|
varCoordX1 = geom.x
|
||||||
|
varCoordY1 = geom.y
|
||||||
|
varOffset[this._dtpPanel.varCoord.c2] =
|
||||||
|
alloc[this._dtpPanel.varCoord.c2] - alloc[this._dtpPanel.varCoord.c1]
|
||||||
|
} else {
|
||||||
|
// when dynamic, the panel clipcontainer spans the whole monitor edge
|
||||||
|
// and the panel is positioned relatively to the clipcontainer
|
||||||
|
varOffset[this._dtpPanel.varCoord.c1] =
|
||||||
|
alloc[this._dtpPanel.varCoord.c1]
|
||||||
|
varOffset[this._dtpPanel.varCoord.c2] =
|
||||||
|
alloc[this._dtpPanel.varCoord.c2]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if vertical, ignore the original GS panel if present
|
|
||||||
if (position == St.Side.LEFT || position == St.Side.RIGHT)
|
|
||||||
varCoordY1 = geom.y
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
((position == St.Side.TOP && y <= this._monitor.y + fixedOffset) ||
|
((position == St.Side.TOP && y <= this._monitor.y + fixedOffset) ||
|
||||||
(position == St.Side.BOTTOM &&
|
(position == St.Side.BOTTOM &&
|
||||||
@@ -416,8 +422,8 @@ export const Intellihide = class {
|
|||||||
(position == St.Side.LEFT && x <= this._monitor.x + fixedOffset) ||
|
(position == St.Side.LEFT && x <= this._monitor.x + fixedOffset) ||
|
||||||
(position == St.Side.RIGHT &&
|
(position == St.Side.RIGHT &&
|
||||||
x >= this._monitor.x + this._monitor.width - fixedOffset)) &&
|
x >= this._monitor.x + this._monitor.width - fixedOffset)) &&
|
||||||
x >= this._monitor.x + (varOffset.x1 || 0) &&
|
x >= varCoordX1 + (varOffset.x1 || 0) &&
|
||||||
x < this._monitor.x + (varOffset.x2 || this._monitor.width) &&
|
x < varCoordX1 + (varOffset.x2 || this._monitor.width) &&
|
||||||
y >= varCoordY1 + (varOffset.y1 || 0) &&
|
y >= varCoordY1 + (varOffset.y1 || 0) &&
|
||||||
y < varCoordY1 + (varOffset.y2 || this._monitor.height)
|
y < varCoordY1 + (varOffset.y2 || this._monitor.height)
|
||||||
)
|
)
|
||||||
@@ -511,24 +517,23 @@ export const Intellihide = class {
|
|||||||
this._dtpPanel.taskbar._shownInitially = false
|
this._dtpPanel.taskbar._shownInitially = false
|
||||||
}
|
}
|
||||||
|
|
||||||
this._animatePanel(0, immediate)
|
this._animatePanel(
|
||||||
|
0,
|
||||||
|
immediate,
|
||||||
|
() => (this._dtpPanel.taskbar._shownInitially = true),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
_hidePanel(immediate) {
|
_hidePanel(immediate) {
|
||||||
let position = this._dtpPanel.geom.position
|
let position = this._dtpPanel.geom.position
|
||||||
let size =
|
let size = this._panelBox[this._dtpPanel.geom.vertical ? 'width' : 'height']
|
||||||
this._panelBox[
|
|
||||||
position == St.Side.LEFT || position == St.Side.RIGHT
|
|
||||||
? 'width'
|
|
||||||
: 'height'
|
|
||||||
]
|
|
||||||
let coefficient =
|
let coefficient =
|
||||||
position == St.Side.TOP || position == St.Side.LEFT ? -1 : 1
|
position == St.Side.TOP || position == St.Side.LEFT ? -1 : 1
|
||||||
|
|
||||||
this._animatePanel(size * coefficient, immediate)
|
this._animatePanel(size * coefficient, immediate)
|
||||||
}
|
}
|
||||||
|
|
||||||
_animatePanel(destination, immediate) {
|
_animatePanel(destination, immediate, onComplete) {
|
||||||
if (destination === this._animationDestination) return
|
if (destination === this._animationDestination) return
|
||||||
|
|
||||||
Utils.stopAnimations(this._panelBox)
|
Utils.stopAnimations(this._panelBox)
|
||||||
@@ -566,6 +571,7 @@ export const Intellihide = class {
|
|||||||
transition: 'easeOutQuad',
|
transition: 'easeOutQuad',
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
this._panelBox.visible = !destination
|
this._panelBox.visible = !destination
|
||||||
|
onComplete ? onComplete() : null
|
||||||
update()
|
update()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ export const Overview = class {
|
|||||||
let { transitioning, finalState, progress } =
|
let { transitioning, finalState, progress } =
|
||||||
overviewControls._stateAdjustment.getStateTransitionParams()
|
overviewControls._stateAdjustment.getStateTransitionParams()
|
||||||
let size =
|
let size =
|
||||||
focusedPanel.geom[focusedPanel.checkIfVertical() ? 'w' : 'h'] *
|
focusedPanel.geom[focusedPanel.geom.vertical ? 'w' : 'h'] *
|
||||||
(transitioning
|
(transitioning
|
||||||
? Math.abs((finalState != 0 ? 0 : 1) - progress)
|
? Math.abs((finalState != 0 ? 0 : 1) - progress)
|
||||||
: 1)
|
: 1)
|
||||||
|
|||||||
41
src/panel.js
41
src/panel.js
@@ -357,7 +357,7 @@ export const Panel = GObject.registerClass(
|
|||||||
|
|
||||||
this.panelStyle.enable(this)
|
this.panelStyle.enable(this)
|
||||||
|
|
||||||
if (this.checkIfVertical()) {
|
if (this.geom.vertical) {
|
||||||
this._signalsHandler.add([
|
this._signalsHandler.add([
|
||||||
this.panelBox,
|
this.panelBox,
|
||||||
'notify::visible',
|
'notify::visible',
|
||||||
@@ -527,13 +527,11 @@ export const Panel = GObject.registerClass(
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkIfVertical() {
|
checkIfVertical() {
|
||||||
let position = this.getPosition()
|
return this.geom.vertical
|
||||||
|
|
||||||
return position == St.Side.LEFT || position == St.Side.RIGHT
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getOrientation() {
|
getOrientation() {
|
||||||
return this.checkIfVertical() ? 'vertical' : 'horizontal'
|
return this.geom.vertical ? 'vertical' : 'horizontal'
|
||||||
}
|
}
|
||||||
|
|
||||||
updateElementPositions() {
|
updateElementPositions() {
|
||||||
@@ -614,7 +612,7 @@ export const Panel = GObject.registerClass(
|
|||||||
}
|
}
|
||||||
|
|
||||||
_bindSettingsChanges() {
|
_bindSettingsChanges() {
|
||||||
let isVertical = this.checkIfVertical()
|
let isVertical = this.geom.vertical
|
||||||
|
|
||||||
this._signalsHandler.add(
|
this._signalsHandler.add(
|
||||||
[
|
[
|
||||||
@@ -732,7 +730,7 @@ export const Panel = GObject.registerClass(
|
|||||||
this.taskbar.resetAppIcons(true)
|
this.taskbar.resetAppIcons(true)
|
||||||
this.dynamicTransparency.updateExternalStyle()
|
this.dynamicTransparency.updateExternalStyle()
|
||||||
|
|
||||||
if (this.checkIfVertical()) {
|
if (this.geom.vertical) {
|
||||||
this.showAppsIconWrapper.realShowAppsIcon.toggleButton.set_width(
|
this.showAppsIconWrapper.realShowAppsIcon.toggleButton.set_width(
|
||||||
this.geom.innerSize,
|
this.geom.innerSize,
|
||||||
)
|
)
|
||||||
@@ -741,7 +739,8 @@ export const Panel = GObject.registerClass(
|
|||||||
}
|
}
|
||||||
|
|
||||||
getGeometry() {
|
getGeometry() {
|
||||||
let isVertical = this.checkIfVertical()
|
let position = this.getPosition()
|
||||||
|
let vertical = position == St.Side.LEFT || position == St.Side.RIGHT
|
||||||
let scaleFactor = Utils.getScaleFactor()
|
let scaleFactor = Utils.getScaleFactor()
|
||||||
let panelBoxTheme = this.panelBox.get_theme_node()
|
let panelBoxTheme = this.panelBox.get_theme_node()
|
||||||
let sideMargins =
|
let sideMargins =
|
||||||
@@ -752,7 +751,6 @@ export const Panel = GObject.registerClass(
|
|||||||
panelBoxTheme.get_padding(St.Side.BOTTOM)
|
panelBoxTheme.get_padding(St.Side.BOTTOM)
|
||||||
let sidePadding = SETTINGS.get_int('panel-side-padding')
|
let sidePadding = SETTINGS.get_int('panel-side-padding')
|
||||||
let topBottomPadding = SETTINGS.get_int('panel-top-bottom-padding')
|
let topBottomPadding = SETTINGS.get_int('panel-top-bottom-padding')
|
||||||
let position = this.getPosition()
|
|
||||||
let panelLength = PanelSettings.getPanelLength(
|
let panelLength = PanelSettings.getPanelLength(
|
||||||
SETTINGS,
|
SETTINGS,
|
||||||
this.monitor.index,
|
this.monitor.index,
|
||||||
@@ -774,9 +772,9 @@ export const Panel = GObject.registerClass(
|
|||||||
let outerSize = 0
|
let outerSize = 0
|
||||||
let panelSize = PanelSettings.getPanelSize(SETTINGS, this.monitor.index)
|
let panelSize = PanelSettings.getPanelSize(SETTINGS, this.monitor.index)
|
||||||
|
|
||||||
if (isVertical && panelSize - sidePadding * 2 < MIN_PANEL_SIZE)
|
if (vertical && panelSize - sidePadding * 2 < MIN_PANEL_SIZE)
|
||||||
sidePadding = (panelSize - MIN_PANEL_SIZE) * 0.5
|
sidePadding = (panelSize - MIN_PANEL_SIZE) * 0.5
|
||||||
else if (!isVertical && panelSize - topBottomPadding * 2 < MIN_PANEL_SIZE)
|
else if (!vertical && panelSize - topBottomPadding * 2 < MIN_PANEL_SIZE)
|
||||||
topBottomPadding = (panelSize - MIN_PANEL_SIZE) * 0.5
|
topBottomPadding = (panelSize - MIN_PANEL_SIZE) * 0.5
|
||||||
|
|
||||||
iconSize = innerSize = outerSize = panelSize * scaleFactor
|
iconSize = innerSize = outerSize = panelSize * scaleFactor
|
||||||
@@ -789,7 +787,7 @@ export const Panel = GObject.registerClass(
|
|||||||
topOffset = position == St.Side.TOP ? gsTopPanelHeight : 0
|
topOffset = position == St.Side.TOP ? gsTopPanelHeight : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isVertical) {
|
if (vertical) {
|
||||||
if (!SETTINGS.get_boolean('group-apps')) {
|
if (!SETTINGS.get_boolean('group-apps')) {
|
||||||
// add window title width and side padding of _dtpIconContainer when vertical
|
// add window title width and side padding of _dtpIconContainer when vertical
|
||||||
innerSize = outerSize +=
|
innerSize = outerSize +=
|
||||||
@@ -837,13 +835,13 @@ export const Panel = GObject.registerClass(
|
|||||||
|
|
||||||
if (length < 1) {
|
if (length < 1) {
|
||||||
// fixed size, less than 100%, so adjust start coordinate
|
// fixed size, less than 100%, so adjust start coordinate
|
||||||
if (!isVertical && anchor == Pos.MIDDLE)
|
if (!vertical && anchor == Pos.MIDDLE)
|
||||||
x += (this.monitor.width - w - sideMargins) * 0.5
|
x += (this.monitor.width - w - sideMargins) * 0.5
|
||||||
else if (isVertical && anchor == Pos.MIDDLE)
|
else if (vertical && anchor == Pos.MIDDLE)
|
||||||
y += (this.monitor.height - h - topBottomMargins) * 0.5
|
y += (this.monitor.height - h - topBottomMargins) * 0.5
|
||||||
else if (!isVertical && anchor == Pos.END)
|
else if (!vertical && anchor == Pos.END)
|
||||||
x += this.monitor.width - w - sideMargins
|
x += this.monitor.width - w - sideMargins
|
||||||
else if (isVertical && anchor == Pos.END)
|
else if (vertical && anchor == Pos.END)
|
||||||
y += this.monitor.height - h - topBottomMargins
|
y += this.monitor.height - h - topBottomMargins
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -862,6 +860,7 @@ export const Panel = GObject.registerClass(
|
|||||||
varPadding,
|
varPadding,
|
||||||
topOffset, // only if gnome-shell top panel is present and position is TOP
|
topOffset, // only if gnome-shell top panel is present and position is TOP
|
||||||
position,
|
position,
|
||||||
|
vertical,
|
||||||
dynamic,
|
dynamic,
|
||||||
dockMode,
|
dockMode,
|
||||||
}
|
}
|
||||||
@@ -1128,7 +1127,7 @@ export const Panel = GObject.registerClass(
|
|||||||
this.set_size(this.geom.w, this.geom.h)
|
this.set_size(this.geom.w, this.geom.h)
|
||||||
this.clipContainer.set_position(this.geom.x, this.geom.y)
|
this.clipContainer.set_position(this.geom.x, this.geom.y)
|
||||||
|
|
||||||
this._setVertical(this.panel, this.checkIfVertical())
|
this._setVertical(this.panel, this.geom.vertical)
|
||||||
|
|
||||||
// center the system menu popup relative to its panel button
|
// center the system menu popup relative to its panel button
|
||||||
if (this.statusArea.quickSettings?.menu) {
|
if (this.statusArea.quickSettings?.menu) {
|
||||||
@@ -1157,7 +1156,7 @@ export const Panel = GObject.registerClass(
|
|||||||
T7,
|
T7,
|
||||||
0,
|
0,
|
||||||
() => {
|
() => {
|
||||||
let vertical = this.checkIfVertical()
|
let vertical = this.geom.vertical
|
||||||
let w = vertical ? this.geom.outerSize : this.geom.w
|
let w = vertical ? this.geom.outerSize : this.geom.w
|
||||||
let h = vertical ? this.geom.h : this.geom.outerSize
|
let h = vertical ? this.geom.h : this.geom.outerSize
|
||||||
|
|
||||||
@@ -1208,7 +1207,7 @@ export const Panel = GObject.registerClass(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let params = this.checkIfVertical()
|
let params = this.geom.vertical
|
||||||
? [stageY, 'y', 'height']
|
? [stageY, 'y', 'height']
|
||||||
: [stageX, 'x', 'width']
|
: [stageX, 'x', 'width']
|
||||||
let dragWindow = this._getDraggableWindowForPosition.apply(
|
let dragWindow = this._getDraggableWindowForPosition.apply(
|
||||||
@@ -1255,7 +1254,7 @@ export const Panel = GObject.registerClass(
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onBoxActorAdded(box) {
|
_onBoxActorAdded(box) {
|
||||||
if (this.checkIfVertical()) {
|
if (this.geom.vertical) {
|
||||||
this._setVertical(box, true)
|
this._setVertical(box, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1458,7 +1457,7 @@ export const Panel = GObject.registerClass(
|
|||||||
|
|
||||||
if (this._showDesktopButton) {
|
if (this._showDesktopButton) {
|
||||||
let buttonSize = SETTINGS.get_int('showdesktop-button-width') + 'px;'
|
let buttonSize = SETTINGS.get_int('showdesktop-button-width') + 'px;'
|
||||||
let isVertical = this.checkIfVertical()
|
let isVertical = this.geom.vertical
|
||||||
|
|
||||||
let sytle = 'border: 0 solid ' + rgb + ';'
|
let sytle = 'border: 0 solid ' + rgb + ';'
|
||||||
sytle += isVertical
|
sytle += isVertical
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ export const PanelManager = class {
|
|||||||
this._adjustPanelMenuButton(
|
this._adjustPanelMenuButton(
|
||||||
this._getPanelMenuButton(child.get_first_child()),
|
this._getPanelMenuButton(child.get_first_child()),
|
||||||
this.primaryPanel.monitor,
|
this.primaryPanel.monitor,
|
||||||
this.primaryPanel.getPosition(),
|
this.primaryPanel.geom.position,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
@@ -699,11 +699,10 @@ export const PanelManager = class {
|
|||||||
|
|
||||||
panelBox._dtpIndex = monitor.index
|
panelBox._dtpIndex = monitor.index
|
||||||
panelBox.set_position(0, 0)
|
panelBox.set_position(0, 0)
|
||||||
|
panelBox.set_width(-1)
|
||||||
if (panel.checkIfVertical) panelBox.set_width(-1)
|
|
||||||
|
|
||||||
this._findPanelMenuButtons(panelBox).forEach((pmb) =>
|
this._findPanelMenuButtons(panelBox).forEach((pmb) =>
|
||||||
this._adjustPanelMenuButton(pmb, monitor, panel.getPosition()),
|
this._adjustPanelMenuButton(pmb, monitor, panel.geom.position),
|
||||||
)
|
)
|
||||||
|
|
||||||
panel.taskbar.iconAnimator.start()
|
panel.taskbar.iconAnimator.start()
|
||||||
@@ -947,7 +946,7 @@ function newUpdateHotCorners() {
|
|||||||
global.dashToPanel.panels,
|
global.dashToPanel.panels,
|
||||||
(p) => p.monitor.index == i,
|
(p) => p.monitor.index == i,
|
||||||
)
|
)
|
||||||
let panelPosition = panel ? panel.getPosition() : St.Side.BOTTOM
|
let panelPosition = panel ? panel.geom.position : St.Side.BOTTOM
|
||||||
let panelTopLeft =
|
let panelTopLeft =
|
||||||
panelPosition == St.Side.TOP || panelPosition == St.Side.LEFT
|
panelPosition == St.Side.TOP || panelPosition == St.Side.LEFT
|
||||||
let monitor = this.monitors[i]
|
let monitor = this.monitors[i]
|
||||||
@@ -1036,7 +1035,7 @@ function newUpdatePanelBarrier(panel) {
|
|||||||
let fixed1 = panel.monitor.y
|
let fixed1 = panel.monitor.y
|
||||||
let fixed2 = panel.monitor.y + barrierSize
|
let fixed2 = panel.monitor.y + barrierSize
|
||||||
|
|
||||||
if (panel.checkIfVertical()) {
|
if (panel.geom.vertical) {
|
||||||
barriers._rightPanelBarrier.push(
|
barriers._rightPanelBarrier.push(
|
||||||
panel.monitor.y + panel.monitor.height,
|
panel.monitor.y + panel.monitor.height,
|
||||||
Meta.BarrierDirection.NEGATIVE_Y,
|
Meta.BarrierDirection.NEGATIVE_Y,
|
||||||
@@ -1056,7 +1055,7 @@ function newUpdatePanelBarrier(panel) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (panel.getPosition()) {
|
switch (panel.geom.position) {
|
||||||
//values are initialized as St.Side.TOP
|
//values are initialized as St.Side.TOP
|
||||||
case St.Side.BOTTOM:
|
case St.Side.BOTTOM:
|
||||||
fixed1 = panel.monitor.y + panel.monitor.height - barrierSize
|
fixed1 = panel.monitor.y + panel.monitor.height - barrierSize
|
||||||
@@ -1107,7 +1106,7 @@ function _newLookingGlassResize() {
|
|||||||
(p) => p.monitor == Main.layoutManager.primaryMonitor,
|
(p) => p.monitor == Main.layoutManager.primaryMonitor,
|
||||||
)
|
)
|
||||||
let topOffset =
|
let topOffset =
|
||||||
primaryMonitorPanel.getPosition() == St.Side.TOP
|
primaryMonitorPanel.geom.position == St.Side.TOP
|
||||||
? primaryMonitorPanel.geom.outerSize +
|
? primaryMonitorPanel.geom.outerSize +
|
||||||
(SETTINGS.get_boolean('stockgs-keep-top-panel')
|
(SETTINGS.get_boolean('stockgs-keep-top-panel')
|
||||||
? Main.layoutManager.panelBox.height
|
? Main.layoutManager.panelBox.height
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export const PanelStyle = class {
|
|||||||
this._rightBoxOperations = []
|
this._rightBoxOperations = []
|
||||||
|
|
||||||
let trayPadding = SETTINGS.get_int('tray-padding')
|
let trayPadding = SETTINGS.get_int('tray-padding')
|
||||||
let isVertical = this.panel.checkIfVertical()
|
let isVertical = this.panel.geom.vertical
|
||||||
let paddingStyle = 'padding: ' + (isVertical ? '%dpx 0' : '0 %dpx')
|
let paddingStyle = 'padding: ' + (isVertical ? '%dpx 0' : '0 %dpx')
|
||||||
|
|
||||||
if (trayPadding >= 0) {
|
if (trayPadding >= 0) {
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ export const Taskbar = class extends EventEmitter {
|
|||||||
this._labelShowing = false
|
this._labelShowing = false
|
||||||
this.fullScrollView = 0
|
this.fullScrollView = 0
|
||||||
|
|
||||||
let isVertical = panel.checkIfVertical()
|
let isVertical = panel.geom.vertical
|
||||||
|
|
||||||
this._box = Utils.createBoxLayout({
|
this._box = Utils.createBoxLayout({
|
||||||
vertical: isVertical,
|
vertical: isVertical,
|
||||||
@@ -471,7 +471,7 @@ export const Taskbar = class extends EventEmitter {
|
|||||||
_updateIconAnimations(pointerX, pointerY) {
|
_updateIconAnimations(pointerX, pointerY) {
|
||||||
this._iconAnimationTimestamp = Date.now()
|
this._iconAnimationTimestamp = Date.now()
|
||||||
let type = iconAnimationSettings.type
|
let type = iconAnimationSettings.type
|
||||||
let vertical = this.dtpPanel.checkIfVertical()
|
let vertical = this.dtpPanel.geom.vertical
|
||||||
|
|
||||||
if (!pointerX || !pointerY) [pointerX, pointerY] = global.get_pointer()
|
if (!pointerX || !pointerY) [pointerX, pointerY] = global.get_pointer()
|
||||||
|
|
||||||
@@ -602,7 +602,7 @@ export const Taskbar = class extends EventEmitter {
|
|||||||
// force a fixed label width to prevent the icons from "wiggling" when an animation runs
|
// force a fixed label width to prevent the icons from "wiggling" when an animation runs
|
||||||
// (adding or removing an icon). When the taskbar is full, revert to a dynamic label width
|
// (adding or removing an icon). When the taskbar is full, revert to a dynamic label width
|
||||||
// to allow them to resize and make room for new icons.
|
// to allow them to resize and make room for new icons.
|
||||||
if (!this.dtpPanel.checkIfVertical() && !this.isGroupApps) {
|
if (!this.dtpPanel.geom.vertical && !this.isGroupApps) {
|
||||||
let initial = this.fullScrollView
|
let initial = this.fullScrollView
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -1270,7 +1270,7 @@ export const Taskbar = class extends EventEmitter {
|
|||||||
if (!this._settings.is_writable('favorite-apps'))
|
if (!this._settings.is_writable('favorite-apps'))
|
||||||
return DND.DragMotionResult.NO_DROP
|
return DND.DragMotionResult.NO_DROP
|
||||||
|
|
||||||
let isVertical = this.dtpPanel.checkIfVertical()
|
let isVertical = this.dtpPanel.geom.vertical
|
||||||
|
|
||||||
if (!this._box.contains(source) && !source._dashItemContainer) {
|
if (!this._box.contains(source) && !source._dashItemContainer) {
|
||||||
//not an appIcon of the taskbar, probably from the applications view
|
//not an appIcon of the taskbar, probably from the applications view
|
||||||
@@ -1625,7 +1625,7 @@ export const TaskbarItemContainer = GObject.registerClass(
|
|||||||
this._updateCloneContainerPosition(cloneContainer)
|
this._updateCloneContainerPosition(cloneContainer)
|
||||||
|
|
||||||
// For the stretch animation
|
// For the stretch animation
|
||||||
let boundProperty = this._dtpPanel.checkIfVertical()
|
let boundProperty = this._dtpPanel.geom.vertical
|
||||||
? 'translation_y'
|
? 'translation_y'
|
||||||
: 'translation_x'
|
: 'translation_x'
|
||||||
this.bind_property(
|
this.bind_property(
|
||||||
@@ -1637,7 +1637,7 @@ export const TaskbarItemContainer = GObject.registerClass(
|
|||||||
|
|
||||||
// The clone follows its source when the taskbar is scrolled.
|
// The clone follows its source when the taskbar is scrolled.
|
||||||
let taskbarScrollView = this.get_parent().get_parent()
|
let taskbarScrollView = this.get_parent().get_parent()
|
||||||
let adjustment = this._dtpPanel.checkIfVertical()
|
let adjustment = this._dtpPanel.geom.vertical
|
||||||
? taskbarScrollView.get_vadjustment()
|
? taskbarScrollView.get_vadjustment()
|
||||||
: taskbarScrollView.get_hadjustment()
|
: taskbarScrollView.get_hadjustment()
|
||||||
let adjustmentChangedId = adjustment.connect('notify::value', () =>
|
let adjustmentChangedId = adjustment.connect('notify::value', () =>
|
||||||
@@ -1675,7 +1675,7 @@ export const TaskbarItemContainer = GObject.registerClass(
|
|||||||
else if (level) this._createRaisedClone()
|
else if (level) this._createRaisedClone()
|
||||||
else return
|
else return
|
||||||
|
|
||||||
let panelPosition = this._dtpPanel.getPosition()
|
let panelPosition = this._dtpPanel.geom.position
|
||||||
let panelElementPositions = PanelSettings.getPanelElementPositions(
|
let panelElementPositions = PanelSettings.getPanelElementPositions(
|
||||||
SETTINGS,
|
SETTINGS,
|
||||||
this._dtpPanel.monitor.index,
|
this._dtpPanel.monitor.index,
|
||||||
@@ -1747,7 +1747,7 @@ export const TaskbarItemContainer = GObject.registerClass(
|
|||||||
stretch(translation) {
|
stretch(translation) {
|
||||||
let duration = iconAnimationSettings.duration / 1000
|
let duration = iconAnimationSettings.duration / 1000
|
||||||
let zoom = iconAnimationSettings.zoom
|
let zoom = iconAnimationSettings.zoom
|
||||||
let animatedProperty = this._dtpPanel.checkIfVertical()
|
let animatedProperty = this._dtpPanel.geom.vertical
|
||||||
? 'translation_y'
|
? 'translation_y'
|
||||||
: 'translation_x'
|
: 'translation_x'
|
||||||
let isShowing = this.opacity != 255 || this.child.opacity != 255
|
let isShowing = this.opacity != 255 || this.child.opacity != 255
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ export const DynamicTransparency = class {
|
|||||||
this._proximityManager.removeWatch(this._proximityWatchId)
|
this._proximityManager.removeWatch(this._proximityWatchId)
|
||||||
|
|
||||||
if (SETTINGS.get_boolean('trans-use-dynamic-opacity')) {
|
if (SETTINGS.get_boolean('trans-use-dynamic-opacity')) {
|
||||||
let isVertical = this._dtpPanel.checkIfVertical()
|
let isVertical = this._dtpPanel.geom.vertical
|
||||||
let threshold = SETTINGS.get_int('trans-dynamic-distance')
|
let threshold = SETTINGS.get_int('trans-dynamic-distance')
|
||||||
|
|
||||||
this._windowOverlap = false
|
this._windowOverlap = false
|
||||||
@@ -179,7 +179,7 @@ export const DynamicTransparency = class {
|
|||||||
if (SETTINGS.get_boolean('trans-use-custom-gradient')) {
|
if (SETTINGS.get_boolean('trans-use-custom-gradient')) {
|
||||||
this._gradientStyle +=
|
this._gradientStyle +=
|
||||||
'background-gradient-direction: ' +
|
'background-gradient-direction: ' +
|
||||||
(this._dtpPanel.checkIfVertical() ? 'horizontal;' : 'vertical;') +
|
(this._dtpPanel.geom.vertical ? 'horizontal;' : 'vertical;') +
|
||||||
'background-gradient-start: ' +
|
'background-gradient-start: ' +
|
||||||
Utils.getrgbaColor(
|
Utils.getrgbaColor(
|
||||||
SETTINGS.get_string('trans-gradient-top-color'),
|
SETTINGS.get_string('trans-gradient-top-color'),
|
||||||
|
|||||||
@@ -73,9 +73,7 @@ export const PreviewMenu = GObject.registerClass(
|
|||||||
this.allowCloseWindow = true
|
this.allowCloseWindow = true
|
||||||
this.peekInitialWorkspaceIndex = -1
|
this.peekInitialWorkspaceIndex = -1
|
||||||
this.opened = false
|
this.opened = false
|
||||||
this.isVertical =
|
this._translationProp = 'translation_' + (geom.vertical ? 'x' : 'y')
|
||||||
geom.position == St.Side.LEFT || geom.position == St.Side.RIGHT
|
|
||||||
this._translationProp = 'translation_' + (this.isVertical ? 'x' : 'y')
|
|
||||||
this._translationDirection =
|
this._translationDirection =
|
||||||
geom.position == St.Side.TOP || geom.position == St.Side.LEFT ? -1 : 1
|
geom.position == St.Side.TOP || geom.position == St.Side.LEFT ? -1 : 1
|
||||||
this._translationOffset =
|
this._translationOffset =
|
||||||
@@ -94,13 +92,13 @@ export const PreviewMenu = GObject.registerClass(
|
|||||||
y_align:
|
y_align:
|
||||||
Clutter.ActorAlign[geom.position != St.Side.BOTTOM ? 'START' : 'END'],
|
Clutter.ActorAlign[geom.position != St.Side.BOTTOM ? 'START' : 'END'],
|
||||||
})
|
})
|
||||||
this._box = Utils.createBoxLayout({ vertical: this.isVertical })
|
this._box = Utils.createBoxLayout({ vertical: geom.vertical })
|
||||||
this._scrollView = new St.ScrollView({
|
this._scrollView = new St.ScrollView({
|
||||||
name: 'dashtopanelPreviewScrollview',
|
name: 'dashtopanelPreviewScrollview',
|
||||||
hscrollbar_policy: St.PolicyType.NEVER,
|
hscrollbar_policy: St.PolicyType.NEVER,
|
||||||
vscrollbar_policy: St.PolicyType.NEVER,
|
vscrollbar_policy: St.PolicyType.NEVER,
|
||||||
enable_mouse_scrolling: true,
|
enable_mouse_scrolling: true,
|
||||||
y_expand: !this.isVertical,
|
y_expand: !geom.vertical,
|
||||||
})
|
})
|
||||||
|
|
||||||
this._scrollView.add_child(this._box)
|
this._scrollView.add_child(this._box)
|
||||||
@@ -429,7 +427,7 @@ export const PreviewMenu = GObject.registerClass(
|
|||||||
|
|
||||||
_onScrollEvent(actor, event) {
|
_onScrollEvent(actor, event) {
|
||||||
if (!event.is_pointer_emulated()) {
|
if (!event.is_pointer_emulated()) {
|
||||||
let vOrh = this.isVertical ? 'v' : 'h'
|
let vOrh = this.panel.geom.vertical ? 'v' : 'h'
|
||||||
let adjustment = this._scrollView[`${vOrh}adjustment`]
|
let adjustment = this._scrollView[`${vOrh}adjustment`]
|
||||||
let increment = adjustment.step_increment
|
let increment = adjustment.step_increment
|
||||||
let delta = increment
|
let delta = increment
|
||||||
@@ -496,7 +494,7 @@ export const PreviewMenu = GObject.registerClass(
|
|||||||
SETTINGS.get_int('window-preview-padding') * 2) *
|
SETTINGS.get_int('window-preview-padding') * 2) *
|
||||||
scaleFactor
|
scaleFactor
|
||||||
|
|
||||||
if (this.isVertical) {
|
if (this.panel.geom.vertical) {
|
||||||
w = previewSize
|
w = previewSize
|
||||||
this.clipHeight = this.panel.monitor.height
|
this.clipHeight = this.panel.monitor.height
|
||||||
y = this.panel.monitor.y
|
y = this.panel.monitor.y
|
||||||
@@ -555,7 +553,7 @@ export const PreviewMenu = GObject.registerClass(
|
|||||||
previewsHeight < this.panel.monitor.height,
|
previewsHeight < this.panel.monitor.height,
|
||||||
)
|
)
|
||||||
|
|
||||||
if (this.isVertical) {
|
if (this.panel.geom.vertical) {
|
||||||
y =
|
y =
|
||||||
sourceAllocation.y1 +
|
sourceAllocation.y1 +
|
||||||
appIconMargin -
|
appIconMargin -
|
||||||
@@ -615,7 +613,7 @@ export const PreviewMenu = GObject.registerClass(
|
|||||||
_getScrollAdjustmentValues() {
|
_getScrollAdjustmentValues() {
|
||||||
let [value, , upper, , , pageSize] =
|
let [value, , upper, , , pageSize] =
|
||||||
this._scrollView[
|
this._scrollView[
|
||||||
(this.isVertical ? 'v' : 'h') + 'adjustment'
|
(this.panel.geom.vertical ? 'v' : 'h') + 'adjustment'
|
||||||
].get_values()
|
].get_values()
|
||||||
|
|
||||||
return [value, upper, pageSize]
|
return [value, upper, pageSize]
|
||||||
@@ -640,7 +638,7 @@ export const PreviewMenu = GObject.registerClass(
|
|||||||
'background-gradient-direction:' +
|
'background-gradient-direction:' +
|
||||||
this.panel.getOrientation()
|
this.panel.getOrientation()
|
||||||
|
|
||||||
if (this.isVertical) {
|
if (this.panel.geom.vertical) {
|
||||||
y = end ? this.panel.monitor.height - FADE_SIZE : 0
|
y = end ? this.panel.monitor.height - FADE_SIZE : 0
|
||||||
} else {
|
} else {
|
||||||
x = end ? this.panel.monitor.width - FADE_SIZE : 0
|
x = end ? this.panel.monitor.width - FADE_SIZE : 0
|
||||||
@@ -653,8 +651,8 @@ export const PreviewMenu = GObject.registerClass(
|
|||||||
style: fadeStyle,
|
style: fadeStyle,
|
||||||
x: x,
|
x: x,
|
||||||
y: y,
|
y: y,
|
||||||
width: this.isVertical ? this.width : FADE_SIZE,
|
width: this.panel.geom.vertical ? this.width : FADE_SIZE,
|
||||||
height: this.isVertical ? FADE_SIZE : this.height,
|
height: this.panel.geom.vertical ? FADE_SIZE : this.height,
|
||||||
})
|
})
|
||||||
|
|
||||||
return fadeWidget
|
return fadeWidget
|
||||||
@@ -668,7 +666,7 @@ export const PreviewMenu = GObject.registerClass(
|
|||||||
if (!c.animatingOut) {
|
if (!c.animatingOut) {
|
||||||
let [width, height] = c.getSize()
|
let [width, height] = c.getSize()
|
||||||
|
|
||||||
if (this.isVertical) {
|
if (this.panel.geom.vertical) {
|
||||||
previewsWidth = Math.max(width, previewsWidth)
|
previewsWidth = Math.max(width, previewsWidth)
|
||||||
previewsHeight += height
|
previewsHeight += height
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user