From d68f274a098d7d8669bf90f5416a35c4593b4ff6 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 11 May 2016 17:03:54 +0200 Subject: [PATCH] Improve positioning of tooltips in advanced mode --- resources/qml/Sidebar.qml | 2 +- resources/qml/SidebarSimple.qml | 6 +++--- resources/qml/SidebarTooltip.qml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 5426125194..b98f3477dc 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -27,7 +27,7 @@ Rectangle function showTooltip(item, position, text) { tooltip.text = text; - position = item.mapToItem(base, position.x, position.y / 2); + position = item.mapToItem(base, position.x, position.y); tooltip.show(position); } diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 21aa315dd1..0e877ab09b 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -120,7 +120,7 @@ Item } } onEntered: { - base.showTooltip(infillCellRight, Qt.point(-infillCellRight.x, parent.height), model.text); + base.showTooltip(infillCellRight, Qt.point(-infillCellRight.x, 0), model.text); } onExited: { base.hideTooltip(); @@ -224,7 +224,7 @@ Item onEntered: { parent.hovered_ex = true - base.showTooltip(brimCheckBox, Qt.point(-helpersCellRight.x, parent.height), + base.showTooltip(brimCheckBox, Qt.point(-helpersCellRight.x, 0), catalog.i18nc("@label", "Enable printing a brim. This will add a single-layer-thick flat area around your object which is easy to cut off afterwards.")); } onExited: @@ -257,7 +257,7 @@ Item onEntered: { parent.hovered_ex = true - base.showTooltip(supportCheckBox, Qt.point(-helpersCellRight.x, parent.height), + base.showTooltip(supportCheckBox, Qt.point(-helpersCellRight.x, 0), catalog.i18nc("@label", "Enable printing support structures. This will build up supporting structures below the model to prevent the model from sagging or printing in mid air.")); } onExited: diff --git a/resources/qml/SidebarTooltip.qml b/resources/qml/SidebarTooltip.qml index 1c7f4bcb76..5cb7ff1f0b 100644 --- a/resources/qml/SidebarTooltip.qml +++ b/resources/qml/SidebarTooltip.qml @@ -31,7 +31,7 @@ UM.PointingRectangle { y = position.y - UM.Theme.getSize("tooltip_arrow_margins").height; } base.opacity = 1; - target = Qt.point(40 , position.y) + target = Qt.point(40 , position.y + UM.Theme.getSize("tooltip_arrow_margins").height / 2) } function hide() {