Skip to content

Commit

Permalink
feat: support basic drag-and-drop operations
Browse files Browse the repository at this point in the history
  • Loading branch information
wineee committed Dec 12, 2023
1 parent ef08f94 commit 170b1b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/treeland/quick/qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ Item {

OutputDelegate {
property real topMargin: topbar.height
waylandCursor: cursor1
}
}
}
Expand Down
12 changes: 11 additions & 1 deletion src/treeland/quick/qml/OutputDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ OutputItem {
id: rootOutputItem
required property WaylandOutput waylandOutput
property OutputViewport onscreenViewport: outputViewport
property Cursor waylandCursor

output: waylandOutput
devicePixelRatio: waylandOutput.scale
Expand All @@ -19,6 +20,7 @@ OutputItem {
visible: cursor.visible && !cursor.isHardwareCursor

Image {
id: cursorImage
source: cursor.imageSource
x: -cursor.hotspot.x
y: -cursor.hotspot.y
Expand All @@ -27,6 +29,14 @@ OutputItem {
height: cursor.size.height
sourceClipRect: cursor.sourceRect
}

SurfaceItem {
id: dragIcon
z: cursorImage.z - 1
flags: SurfaceItem.DontCacheLastBuffer
visible: waylandCursor.dragSurface !== null
surface: waylandCursor.dragSurface
}
}

OutputViewport {
Expand Down Expand Up @@ -78,7 +88,7 @@ OutputItem {

Image {
id: background
source: "file:///usr/share/wallpapers/deepin/desktop.jpg"
source: "file:///run/current-system/sw/share/wallpapers/Altai/contents/images/1080x1920.png"
fillMode: Image.PreserveAspectCrop
asynchronous: true
anchors.fill: parent
Expand Down

0 comments on commit 170b1b1

Please sign in to comment.