diff --git a/resources/qml/PrintSetupTooltip.qml b/resources/qml/PrintSetupTooltip.qml index 5e5b1dce73..58fb86d764 100644 --- a/resources/qml/PrintSetupTooltip.qml +++ b/resources/qml/PrintSetupTooltip.qml @@ -11,7 +11,7 @@ UM.PointingRectangle id: base property real sourceWidth: 0 width: UM.Theme.getSize("tooltip").width - height: UM.Theme.getSize("tooltip").height + height: textScroll.height + UM.Theme.getSize("tooltip_margins").height * 2 color: UM.Theme.getColor("tooltip") arrowSize: UM.Theme.getSize("default_arrow").width @@ -20,7 +20,7 @@ UM.PointingRectangle Behavior on opacity { - NumberAnimation { duration: 100; } + NumberAnimation { duration: 200; } } property alias text: label.text @@ -59,16 +59,19 @@ UM.PointingRectangle base.opacity = 0; } - MouseArea + ScrollView { - enabled: parent.opacity > 0 - visible: enabled - anchors.fill: parent - acceptedButtons: Qt.NoButton - hoverEnabled: true + id: textScroll + width: parent.width + height: Math.min(label.height, base.parent.height) + + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + ScrollBar.vertical.policy: ScrollBar.AsNeeded + + hoverEnabled: parent.opacity > 0 onHoveredChanged: { - if(containsMouse && base.opacity > 0) + if(hovered && base.opacity > 0) { base.show(Qt.point(target.x - 1, target.y - UM.Theme.getSize("tooltip_arrow_margins").height / 2)); //Same arrow position as before. } @@ -78,26 +81,16 @@ UM.PointingRectangle } } - ScrollView + UM.Label { - id: textScroll - width: base.width - height: base.height + id: label + x: UM.Theme.getSize("tooltip_margins").width + y: UM.Theme.getSize("tooltip_margins").height + width: textScroll.width - 2 * UM.Theme.getSize("tooltip_margins").width - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ScrollBar.vertical.policy: ScrollBar.AsNeeded - - UM.Label - { - id: label - x: UM.Theme.getSize("tooltip_margins").width - y: UM.Theme.getSize("tooltip_margins").height - width: base.width - UM.Theme.getSize("tooltip_margins").width * 2 - - wrapMode: Text.Wrap - textFormat: Text.RichText - color: UM.Theme.getColor("tooltip_text") - } + wrapMode: Text.Wrap + textFormat: Text.RichText + color: UM.Theme.getColor("tooltip_text") } } }