1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

dock: create an initial basic dock

This commit is contained in:
bbedward
2025-08-04 19:10:20 -04:00
parent 9dbb6b094f
commit 436c7e2234
15 changed files with 1765 additions and 6 deletions

View File

@@ -28,6 +28,7 @@ GridView {
signal keyboardNavigationReset()
signal itemClicked(int index, var modelData)
signal itemHovered(int index)
signal itemRightClicked(int index, var modelData, real mouseX, real mouseY)
function ensureVisible(index) {
if (index < 0 || index >= gridView.count)
@@ -148,6 +149,7 @@ GridView {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton
z: 10
onEntered: {
if (hoverUpdatesSelection && !keyboardNavigationActive)
@@ -158,8 +160,13 @@ GridView {
onPositionChanged: {
keyboardNavigationReset();
}
onClicked: {
itemClicked(index, model);
onClicked: (mouse) => {
if (mouse.button === Qt.LeftButton) {
itemClicked(index, model);
} else if (mouse.button === Qt.RightButton) {
var globalPos = mapToGlobal(mouse.x, mouse.y);
itemRightClicked(index, model, globalPos.x, globalPos.y);
}
}
}