Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion panels/dock/AppletItemButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ IconButton {

icon.width: 16
icon.height: 16
smooth: false

Connections {
target: control
Expand All @@ -39,4 +38,8 @@ IconButton {
radius: control.radius
isActive: control.isActive
}

Component.onCompleted: {
contentItem.smooth = false
}
}
42 changes: 41 additions & 1 deletion panels/dock/taskmanager/package/AppItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,48 @@ Item {
sourceSize: Qt.size(iconSize, iconSize)
anchors.centerIn: parent
retainWhileLoading: true
smooth: iconSize > 32
smooth: false

function mapToScene(px, py) {
return parent.mapToItem(Window.window.contentItem, Qt.point(px, py))
}

function mapFromScene(px, py) {
return parent.mapFromItem(Window.window.contentItem, Qt.point(px, py))
}

function fixPosition() {
anchors.centerIn = undefined
var targetX = (parent.width - width) / 2
var targetY = (parent.height - height) / 2

var scenePos = mapToScene(targetX, targetY)

var physicalX = Math.round(scenePos.x * Panel.devicePixelRatio)
var physicalY = Math.round(scenePos.y * Panel.devicePixelRatio)

var localPos = mapFromScene(physicalX / Panel.devicePixelRatio, physicalY / Panel.devicePixelRatio)

x = localPos.x
y = localPos.y
}

Timer {
id: fixPositionTimer
interval: 100
repeat: false
running: false
onTriggered: {
icon.fixPosition()
}
}

Connections {
target: root
function onIconGlobalPointChanged() {
fixPositionTimer.start()
}
}
LaunchAnimation {
id: launchAnimation
launchSpace: {
Expand Down
9 changes: 7 additions & 2 deletions panels/dock/tray/ShellSurfaceItemProxy.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand All @@ -17,14 +17,19 @@ Item {
property bool hovered: hoverHandler.hovered
property bool pressed: tapHandler.pressed
property int cursorShape: Qt.ArrowCursor

property alias shellSurfaceItem: impl

implicitWidth: shellSurface ? shellSurface.width : 10
implicitHeight: shellSurface ? shellSurface.height : 10

function takeFocus() {
impl.takeFocus()
}

function fixPosition() {
fixPositionTimer.start()
}

ShellSurfaceItem {
id: impl
width: parent.width
Expand Down
8 changes: 4 additions & 4 deletions panels/dock/tray/package/ActionLegacyTrayPluginDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,17 @@ AppletItemButton {

HoverHandler {
id: hoverHandler
parent: surfaceItem
parent: surfaceItem.shellSurfaceItem
}
TapHandler {
id: tapHandler
parent: surfaceItem
parent: surfaceItem.shellSurfaceItem
}

ShellSurfaceItem {
DDT.ShellSurfaceItemProxy {
id: surfaceItem
anchors.fill: parent
shellSurface: pluginItem.plugin
smooth: false
}

Component.onCompleted: {
Expand Down Expand Up @@ -130,6 +129,7 @@ AppletItemButton {

onItemGlobalPosChanged: {
updatePluginItemPosTimer.start()
surfaceItem.fixPosition()
}

onVisibleChanged: {
Expand Down
9 changes: 8 additions & 1 deletion panels/dock/tray/quickpanel/DragItem.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -105,6 +105,7 @@ Item {
}

Loader {
id: proxyLoader
active: isFallbackIcon && root.dragItem.DQuickDrag.isDragging
anchors.centerIn: parent
anchors.verticalCenterOffset: -root.fallbackIconSize.height / 3 * 2
Expand All @@ -114,6 +115,12 @@ Item {
height: root.fallbackIconSize.height
}
}

onCurrentDragPointChanged: {
if (proxyLoader.item) {
proxyLoader.item.fixPosition()
}
}
}

DragHandler {
Expand Down
3 changes: 2 additions & 1 deletion panels/dock/tray/quickpanel/PanelTrayItem.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -57,6 +57,7 @@ Control {
name: "dock-control-panel"
palette: DTK.makeIconPalette(root.palette)
theme: root.ColorSelector.controlTheme
smooth: false
}
HoverHandler {
enabled: !root.isOpened
Expand Down
Loading