Skip to content

Commit

Permalink
feat: adapt to launchpad plugin
Browse files Browse the repository at this point in the history
Modify the launchpad location.
  • Loading branch information
18202781743 committed Apr 9, 2024
1 parent 7605703 commit bad2caa
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
24 changes: 24 additions & 0 deletions panels/dock/launcherItem/package/launcheritem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,30 @@ AppletItem {
implicitWidth: useColumnLayout ? Panel.rootObject.dockSize : dockSize
implicitHeight: useColumnLayout ? dockSize : Panel.rootObject.dockSize

onXChanged: updateLaunchpadPos()
onYChanged: updateLaunchpadPos()
Connections {
target: Panel.rootObject
function onDockCenterPartPosChanged()
{
updateLaunchpadPos()
}
}

function updateLaunchpadPos()
{
var launchpad = DS.applet("org.deepin.ds.launchpad")
if (!launchpad)
return

var lX = launcher.mapToGlobal(launcher.x + launcher.width / 2, 0).x
var lY = Panel.rootObject.y
launchpad.rootObject.windowedPos = Qt.point(lX, lY)
}
Component.onCompleted: {
updateLaunchpadPos()
}

D.ActionButton {
anchors.centerIn: parent
icon.name: Applet.iconName
Expand Down
5 changes: 5 additions & 0 deletions panels/dock/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Window {
property int dockLeftSpaceForCenter: useColumnLayout ?
(Screen.height - dockLeftPart.implicitHeight - dockRightPart.implicitHeight) :
(Screen.width - dockLeftPart.implicitWidth - dockRightPart.implicitWidth)
// TODO
signal dockCenterPartPosChanged()

property int dockCenterPartCount: dockCenterPartModel.count

Expand Down Expand Up @@ -251,6 +253,9 @@ Window {
id: dockCenterPart
implicitWidth: centerLoader.implicitWidth
implicitHeight: centerLoader.implicitHeight
onXChanged: dockCenterPartPosChanged()
onYChanged: dockCenterPartPosChanged()

OverflowContainer {
id: centerLoader
anchors.fill: parent
Expand Down

0 comments on commit bad2caa

Please sign in to comment.