From bcbbaf41f375b31688468d8bf7e169636266e13a Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 2 Apr 2015 11:17:38 +0200 Subject: [PATCH] Add a tooltip to PrinterButton --- qml/PrinterButton.qml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/qml/PrinterButton.qml b/qml/PrinterButton.qml index 48ecaa64e7..3c01a050f7 100644 --- a/qml/PrinterButton.qml +++ b/qml/PrinterButton.qml @@ -6,5 +6,24 @@ import QtQuick.Layouts 1.1 import UM 1.0 as UM Button { + id: base; style: UM.Theme.styles.tool_button; + + Rectangle { + anchors.bottom: parent.top; + + width: parent.width; + height: base.hovered ? label.height : 0; + Behavior on height { NumberAnimation { duration: 75; } } + + opacity: base.hovered ? 1.0 : 0.0; + Behavior on opacity { NumberAnimation { duration: 75; } } + + Label { + id: label + anchors.horizontalCenter: parent.horizontalCenter; + text: base.text; + font: UM.Theme.fonts.button_tooltip; + } + } }