mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-07-26 14:24:45 +00:00
better popup positioning
This commit is contained in:
parent
fd6d93e7ed
commit
43d95cd332
1 changed files with 10 additions and 4 deletions
|
|
@ -88,10 +88,16 @@ Item {
|
||||||
imagePath: "widgets/background"
|
imagePath: "widgets/background"
|
||||||
//used only indesktop mode, not panel
|
//used only indesktop mode, not panel
|
||||||
|
|
||||||
x: Math.min(parent.width - width - units.largeSpacing, Math.max(units.largeSpacing, root.mapToItem(root.rootItem, 0, 0).x + root.width / 2 - width / 2))
|
property bool wideMode: expandedOverlay.width > width * 2
|
||||||
y: Math.min(parent.height - height - units.largeSpacing, Math.max(units.largeSpacing, root.mapToItem(root.rootItem, 0, 0).y + root.height / 2 - height / 2))
|
|
||||||
width: Math.max(Math.max(root.fullRepresentation.implicitWidth, units.gridUnit * 15), plasmoid.switchWidth) * 1.5
|
x: wideMode
|
||||||
height: Math.max(Math.max(root.fullRepresentation.implicitHeight, units.gridUnit * 15), plasmoid.switchHeight) * 1.5
|
? Math.min(parent.width - width - units.largeSpacing, Math.max(units.largeSpacing, root.mapToItem(root.rootItem, 0, 0).x + root.width / 2 - width / 2))
|
||||||
|
: expandedOverlay.width/2 - width/2
|
||||||
|
y: wideMode
|
||||||
|
? Math.min(parent.height - height - units.largeSpacing, Math.max(units.largeSpacing, root.mapToItem(root.rootItem, 0, 0).y + root.height / 2 - height / 2))
|
||||||
|
: units.largeSpacing
|
||||||
|
width: Math.min(expandedOverlay.width - units.largeSpacing * 2, Math.max(Math.max(root.fullRepresentation.implicitWidth, units.gridUnit * 15), plasmoid.switchWidth) * 1.5)
|
||||||
|
height: Math.min(expandedOverlay.height - units.largeSpacing * 2, Math.max(Math.max(root.fullRepresentation.implicitHeight, units.gridUnit * 15), plasmoid.switchHeight) * 1.5)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue