NightLight/Bar: left click toggle, converted to NIconButton
+ Adapted some tooltip to the new richtext NText
This commit is contained in:
parent
87f9afbd85
commit
80f6570f04
7 changed files with 39 additions and 51 deletions
|
|
@ -27,6 +27,7 @@ Rectangle {
|
|||
signal entered
|
||||
signal exited
|
||||
signal clicked
|
||||
signal rightClicked
|
||||
|
||||
implicitWidth: size
|
||||
implicitHeight: size
|
||||
|
|
@ -57,6 +58,7 @@ Rectangle {
|
|||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
hoverEnabled: true
|
||||
onEntered: {
|
||||
hovering = true
|
||||
|
|
@ -72,11 +74,15 @@ Rectangle {
|
|||
}
|
||||
root.exited()
|
||||
}
|
||||
onClicked: {
|
||||
onClicked: function (mouse) {
|
||||
if (tooltipText) {
|
||||
tooltip.hide()
|
||||
}
|
||||
root.clicked()
|
||||
if (mouse.button === Qt.LeftButton) {
|
||||
root.clicked()
|
||||
} else if (mouse.button === Qt.RightButton) {
|
||||
root.rightClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue