Fix showing tooltips on control hover

This commit is contained in:
Arjen Hiemstra 2015-04-17 13:51:41 +02:00
parent e7224c8c1a
commit 7ef8038145
2 changed files with 11 additions and 9 deletions

View File

@ -15,7 +15,6 @@ UM.AngledCornerRectangle {
cornerSize: UM.Theme.sizes.default_margin.width; cornerSize: UM.Theme.sizes.default_margin.width;
function showTooltip(item, position, text) { function showTooltip(item, position, text) {
print("omg zomg")
tooltip.text = text; tooltip.text = text;
position = item.mapToItem(base, position.x, position.y); position = item.mapToItem(base, position.x, position.y);
tooltip.show(position); tooltip.show(position);
@ -72,16 +71,19 @@ UM.AngledCornerRectangle {
onLoaded: onLoaded:
{ {
if(item) item.configureSettings = base.configureMachinesAction; if(item)
if(typeof(item.onShowTooltip) != 'undefined')
{ {
item.showTooltip.connect(base.showTooltip) item.configureSettings = base.configureMachinesAction;
if(item.onShowTooltip != undefined)
{
item.showTooltip.connect(base.showTooltip)
}
if(item.onHideTooltip != undefined)
{
item.hideTooltip.connect(base.hideTooltip)
}
} }
} }
//onShowTooltip: base.showTooltip(item,position,text)
//onHideTooltip: base.hideTooltip()
} }
SaveButton { SaveButton {

View File

@ -1,3 +1,3 @@
import UM 1.0 as UM import UM 1.0 as UM
UM.SettingView{} UM.SettingView { }