mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-17 08:17:59 +00:00
Addressbook: New tooltip implementation (old didn't work on ubuntu)
This commit is contained in:
parent
a0f35aa776
commit
28a220d4ac
2 changed files with 43 additions and 10 deletions
|
@ -120,8 +120,8 @@ Item {
|
||||||
repeat: true
|
repeat: true
|
||||||
running: false
|
running: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if(((tipItem.visible && !tipItem.containsMouse) || !tipItem.visible) && !mouseArea.containsMouse) {
|
if(((appWindow.toolTip.visible && !appWindow.toolTip.containsMouse) || !appWindow.toolTip.visible) && !mouseArea.containsMouse) {
|
||||||
tipItem.visible = false
|
appWindow.toolTip.visible = false
|
||||||
dropdown.expanded = false
|
dropdown.expanded = false
|
||||||
currentIndex = -1
|
currentIndex = -1
|
||||||
timer.stop()
|
timer.stop()
|
||||||
|
@ -210,14 +210,15 @@ Item {
|
||||||
|
|
||||||
onContainsMouseChanged: {
|
onContainsMouseChanged: {
|
||||||
if(containsMouse) {
|
if(containsMouse) {
|
||||||
var pos = rootItem.mapFromItem(delegate, 30, -20)
|
var pos = rootItem.mapFromItem(delegate, 30, -25)
|
||||||
tipItem.text = name
|
appWindow.toolTip.text = name
|
||||||
tipItem.x = pos.x + appWindow.x
|
appWindow.toolTip.x = pos.x - appWindow.toolTip.width
|
||||||
if(tipItem.height > 30)
|
// if(appWindow.toolTip.height > 30)
|
||||||
pos.y -= tipItem.height - 30
|
// pos.y -= appWindow.toolTip.height - 30
|
||||||
tipItem.y = pos.y + appWindow.y
|
appWindow.toolTip.y = pos.y
|
||||||
tipItem.visible = true
|
appWindow.toolTip.visible = true
|
||||||
tipItem.raise()
|
appWindow.toolTip.z = 3
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
32
main.qml
32
main.qml
|
@ -60,6 +60,7 @@ ApplicationWindow {
|
||||||
property bool daemonSynced: false
|
property bool daemonSynced: false
|
||||||
property int maxWindowHeight: (Screen.height < 900)? 720 : 800;
|
property int maxWindowHeight: (Screen.height < 900)? 720 : 800;
|
||||||
property bool daemonRunning: false
|
property bool daemonRunning: false
|
||||||
|
property alias toolTip: toolTip
|
||||||
|
|
||||||
// true if wallet ever synchronized
|
// true if wallet ever synchronized
|
||||||
property bool walletInitialized : false
|
property bool walletInitialized : false
|
||||||
|
@ -999,6 +1000,37 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// new ToolTip
|
||||||
|
Rectangle {
|
||||||
|
id: toolTip
|
||||||
|
property alias text: content.text
|
||||||
|
width: content.width + 12
|
||||||
|
height: content.height + 17
|
||||||
|
color: "#FF6C3C"
|
||||||
|
//radius: 3
|
||||||
|
visible:false;
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: tip
|
||||||
|
anchors.top: parent.bottom
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 5
|
||||||
|
source: "../images/tip.png"
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: content
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
y: 6
|
||||||
|
lineHeight: 0.7
|
||||||
|
font.family: "Arial"
|
||||||
|
font.pixelSize: 12
|
||||||
|
font.letterSpacing: -1
|
||||||
|
color: "#FFFFFF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
onClosing: {
|
onClosing: {
|
||||||
// Close wallet
|
// Close wallet
|
||||||
|
|
Loading…
Reference in a new issue