mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 05:50:30 +02:00
Add error tooltip
This commit is contained in:
parent
9e11ae311e
commit
c04a6b5b88
2 changed files with 59 additions and 0 deletions
|
@ -606,6 +606,14 @@ ScrollingWindow {
|
|||
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: TextInput.AlignHCenter
|
||||
|
||||
HifiControls.ToolTip {
|
||||
anchors.fill: parent
|
||||
|
||||
visible: styleData.value === "Error"
|
||||
|
||||
toolTip: assetProxyModel.data(styleData.index, 0x106)
|
||||
}
|
||||
}
|
||||
}
|
||||
Component {
|
||||
|
|
51
interface/resources/qml/controls-uit/ToolTip.qml
Normal file
51
interface/resources/qml/controls-uit/ToolTip.qml
Normal file
|
@ -0,0 +1,51 @@
|
|||
//
|
||||
// ToolTip.qml
|
||||
//
|
||||
// Created by Clement on 9/12/17
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
import QtQuick 2.5
|
||||
|
||||
Item {
|
||||
property string toolTip
|
||||
property bool showToolTip: false
|
||||
|
||||
Rectangle {
|
||||
id: toolTipRectangle
|
||||
anchors.right: parent.right
|
||||
|
||||
width: toolTipText.width + 4
|
||||
height: toolTipText.height + 4
|
||||
opacity: (toolTip != "" && showToolTip) ? 1 : 0
|
||||
color: "#ffffaa"
|
||||
border.color: "#0a0a0a"
|
||||
Text {
|
||||
id: toolTipText
|
||||
text: toolTip
|
||||
color: "black"
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
Behavior on opacity {
|
||||
PropertyAnimation {
|
||||
easing.type: Easing.InOutQuad
|
||||
duration: 250
|
||||
}
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
onEntered: showTimer.start()
|
||||
onExited: { showToolTip = false; showTimer.stop(); }
|
||||
hoverEnabled: true
|
||||
}
|
||||
Timer {
|
||||
id: showTimer
|
||||
interval: 250
|
||||
onTriggered: { showToolTip = true; }
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue