Simplify tooltip handling for settings

Rather than use three different signals, use a single showTooltip signal
with a
text property. This makes it possible to show any tooltip from within a
setting
item.
This commit is contained in:
Arjen Hiemstra 2016-05-11 17:03:02 +02:00
parent 2abb9a47c1
commit b7fd97737c
3 changed files with 8 additions and 5 deletions

View file

@ -13,7 +13,7 @@ Button {
style: UM.Theme.styles.sidebar_category;
signal showTooltip();
signal showTooltip(string text);
signal hideTooltip();
signal contextMenuRequested()
@ -69,11 +69,13 @@ Button {
iconSource: UM.Theme.getIcon("notice")
onEntered: {
base.showTooltip()
base.showTooltip(catalog.i18nc("@label", "This setting is normally calculated, but it currently has an absolute value set.\n\nClick to restore the calculated value."))
}
onExited: {
base.hideTooltip();
}
UM.I18nCatalog { id: catalog; name: "cura" }
}
}