getting a bit more organized and adding some ui tweaks
This commit is contained in:
parent
9b6949090e
commit
7545f05724
5 changed files with 52 additions and 5 deletions
|
@ -38,6 +38,7 @@ Item {
|
|||
|
||||
// Emitted when clicking to activate underneath mousearea
|
||||
signal clicked()
|
||||
signal rightClicked()
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
|
@ -127,10 +128,16 @@ Item {
|
|||
MouseArea {
|
||||
id: clickArea
|
||||
anchors.fill: parent
|
||||
onClicked: root.clicked()
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onEntered: root.containsMouse = true
|
||||
onExited: root.containsMouse = false
|
||||
onClicked: {
|
||||
if (mouse.button === Qt.RightButton)
|
||||
root.rightClicked();
|
||||
else
|
||||
root.clicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,6 +113,17 @@ ColumnLayout {
|
|||
serviceItemList.currentIndex = index;
|
||||
changeServiceItem(index);
|
||||
}
|
||||
onRightClicked: rightClickMenu.popup()
|
||||
}
|
||||
|
||||
Controls.Menu {
|
||||
id: rightClickMenu
|
||||
x: mouseHandler.mouseX
|
||||
y: mouseHandler.mouseY + 10
|
||||
Kirigami.Action {
|
||||
text: "delete"
|
||||
onTriggered: serviceItemModel.removeItem(index)
|
||||
}
|
||||
}
|
||||
|
||||
DropArea {
|
||||
|
|
|
@ -32,11 +32,18 @@ Item {
|
|||
anchors.fill: parent
|
||||
|
||||
Controls.ToolButton {
|
||||
text: "Grid"
|
||||
text: "Solo"
|
||||
icon.name: "viewimage"
|
||||
hoverEnabled: true
|
||||
}
|
||||
Controls.ToolButton {
|
||||
text: "Solo"
|
||||
text: "Grid"
|
||||
icon.name: "view-app-grid-symbolic"
|
||||
hoverEnabled: true
|
||||
}
|
||||
Controls.ToolButton {
|
||||
text: "Details"
|
||||
icon.name: "view-list-details"
|
||||
hoverEnabled: true
|
||||
}
|
||||
Controls.ToolSeparator {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue