Skip to content

Commit

Permalink
chore: clean up IconItemDelegate click implementation
Browse files Browse the repository at this point in the history
Log:
  • Loading branch information
BLumia committed Nov 23, 2023
1 parent 49e2d2a commit 885ec69
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions qml/IconItemDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ Control {
}
}


Label {
id: iconItemLabel
text: display.startsWith("internal/category/") ? getCategoryName(display.substring(18)) : display
Expand All @@ -108,29 +107,22 @@ Control {
wrapMode: Text.WordWrap
elide: Text.ElideRight
maximumLineCount: 2
}
}
}

TapHandler {
acceptedButtons: Qt.RightButton
onTapped: {
root.menuTriggered()
}
}
}

MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton
onClicked: {
if (root.icons) {
root.folderClicked()
} else {
root.itemClicked()
}
}
onPressAndHold: {
}

TapHandler {
acceptedButtons: Qt.RightButton
onTapped: {
root.menuTriggered()
}
}

Expand All @@ -150,7 +142,11 @@ Control {
}

Keys.onSpacePressed: {
root.itemClicked()
if (root.icons !== undefined) {
root.folderClicked()
} else {
root.itemClicked()
}
}

Keys.onReturnPressed: {
Expand Down

0 comments on commit 885ec69

Please sign in to comment.