Replaced all NWidgets callback by proper signals

This commit is contained in:
quadbyte 2025-08-12 13:22:15 -04:00
parent 1a7a0dbb16
commit a7d4e0ec1d
27 changed files with 93 additions and 88 deletions

View file

@ -15,12 +15,13 @@ Rectangle {
property bool showBorder: true
property bool enabled: true
property bool hovering: false
property var onEntered: function () {}
property var onExited: function () {}
property var onClicked: function () {}
property real fontPointSize: Style.fontSizeMedium
property string fontFamily: "Material Symbols Outlined"
signal entered
signal exited
signal clicked
implicitWidth: size
implicitHeight: size
@ -62,20 +63,20 @@ Rectangle {
if (tooltipText) {
tooltip.show()
}
root.onEntered()
root.entered()
}
onExited: {
hovering = false
if (tooltipText) {
tooltip.hide()
}
root.onExited()
root.exited()
}
onClicked: {
if (tooltipText) {
tooltip.hide()
}
root.onClicked()
root.clicked()
}
}
}