From 98b07e7a2ca722e1f9f9d8101fec7d27e60473cc Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 17 Apr 2015 09:23:25 +0200 Subject: [PATCH] Fixed tooltips --- qml/Sidebar.qml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/qml/Sidebar.qml b/qml/Sidebar.qml index 43b6c43bbb..c9f8307218 100644 --- a/qml/Sidebar.qml +++ b/qml/Sidebar.qml @@ -13,8 +13,9 @@ UM.AngledCornerRectangle { property alias saveAction: saveButton.saveAction; cornerSize: UM.Theme.sizes.default_margin.width; - + function showTooltip(item, position, text) { + print("omg zomg") tooltip.text = text; position = item.mapToItem(base, position.x, position.y); tooltip.show(position); @@ -59,7 +60,18 @@ UM.AngledCornerRectangle { property Item sidebar: base; - onLoaded: if(item) item.configureSettings = base.configureMachinesAction + onLoaded: + { + if(item) item.configureSettings = base.configureMachinesAction; + if(typeof(item.onShowTooltip) != 'undefined') + { + item.showTooltip.connect(base.showTooltip) + } + + } + + //onShowTooltip: base.showTooltip(item,position,text) + //onHideTooltip: base.hideTooltip() } SaveButton { @@ -68,8 +80,9 @@ UM.AngledCornerRectangle { Layout.preferredHeight: UM.Theme.sizes.button.height; Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter; } + } - + SidebarTooltip { id: tooltip; }