NIconButton: added native tooltip handling

This commit is contained in:
quadbyte 2025-08-10 15:09:58 -04:00
parent 275c2ae8ba
commit 9e0bb64d07
4 changed files with 18 additions and 17 deletions

View file

@ -83,8 +83,8 @@ Variants {
NIconButton {
id: demoPanelToggle
icon: "experiment"
tooltipText: "Open demo panel"
anchors.verticalCenter: parent.verticalCenter
onClicked: function () {
demoPanel.isLoaded = !demoPanel.isLoaded
@ -93,8 +93,8 @@ Variants {
NIconButton {
id: sidePanelToggle
icon: "widgets"
tooltipText: "Open side panel"
anchors.verticalCenter: parent.verticalCenter
onClicked: function () {
// Map this button's center to the screen and open the side panel below it

View file

@ -60,7 +60,7 @@ NPill {
if (testMode) {
lines.push("Time left: " + Time.formatVagueHumanReadableDuration(12345))
return lines.join("\n");
return lines.join("\n")
}
if (!root.isReady) {

View file

@ -52,18 +52,6 @@ NLoader {
NIconButton {
id: myIconButton
icon: "refresh"
onEntered: function () {
myTooltip.show()
}
onExited: function () {
myTooltip.hide()
}
}
NTooltip {
id: myTooltip
target: myIconButton
positionAbove: false
text: "Hello world"
}
NDivider {
@ -74,9 +62,8 @@ NLoader {
// NToggle
ColumnLayout {
spacing: Style.marginLarge * scaling
uniformCellSizes: true
NText {
text: "NToggle + NTooltip"
text: "NToggle"
color: Colors.accentSecondary
}