mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Added basic layout to tooltip QML
This commit is contained in:
parent
d1526c25b2
commit
0c2e208044
1 changed files with 36 additions and 20 deletions
|
@ -1,13 +1,14 @@
|
|||
import Hifi 1.0 as Hifi
|
||||
import QtQuick 2.3 as Original
|
||||
import QtQuick.Layouts 1.1
|
||||
import "controls"
|
||||
import "styles"
|
||||
|
||||
Hifi.Tooltip {
|
||||
id: root
|
||||
HifiConstants { id: hifi }
|
||||
x: (lastMousePosition.x > surfaceSize.width/2) ? lastMousePosition.x - root.width : lastMousePosition.x + 20
|
||||
y: (lastMousePosition.y > surfaceSize.height/2) ? lastMousePosition.y - root.height : lastMousePosition.y + 5
|
||||
x: (lastMousePosition.x > surfaceSize.width/2) ? lastMousePosition.x - root.width : lastMousePosition.x
|
||||
y: (lastMousePosition.y > surfaceSize.height/2) ? lastMousePosition.y - root.height : lastMousePosition.y
|
||||
implicitWidth: border.implicitWidth
|
||||
implicitHeight: border.implicitHeight
|
||||
|
||||
|
@ -18,29 +19,44 @@ Hifi.Tooltip {
|
|||
//implicitHeight: Math.max(text.implicitHeight, 64)
|
||||
implicitHeight: tooltipBackground.implicitHeight
|
||||
|
||||
/*
|
||||
Text {
|
||||
id: text
|
||||
anchors.fill: parent
|
||||
anchors.margins: 16
|
||||
font.pixelSize: hifi.fonts.pixelSize / 2
|
||||
text: root.text
|
||||
wrapMode: Original.Text.WordWrap
|
||||
}*/
|
||||
|
||||
Image {
|
||||
Original.Image {
|
||||
id: tooltipBackground
|
||||
source: "../images/NoPictureProvided.svg"
|
||||
source: "../images/tooltip_container.svg"
|
||||
width: 323
|
||||
height: 423
|
||||
anchors.fill: parent
|
||||
|
||||
/*
|
||||
Image {
|
||||
id: tooltipBackground
|
||||
source: "../images/NoPictureProvided.svg"
|
||||
anchors.fill: parent
|
||||
}*/
|
||||
ColumnLayout {
|
||||
spacing: 5
|
||||
|
||||
Text {
|
||||
id: textPlace
|
||||
//anchors.fill: parent
|
||||
anchors.margins: 5
|
||||
font.pixelSize: hifi.fonts.pixelSize / 2
|
||||
text: root.text
|
||||
wrapMode: Original.Text.WordWrap
|
||||
}
|
||||
|
||||
Original.Image {
|
||||
id: tooltipPic
|
||||
source: "../images/NoPictureProvided.svg"
|
||||
//anchors.fill: parent
|
||||
anchors.margins: 5
|
||||
verticalAlignment: Original.Image.AlignVCenter
|
||||
//horizontalAlignment: Image.AlignHCenter
|
||||
}
|
||||
|
||||
Text {
|
||||
id: textDescription
|
||||
//anchors.fill: parent
|
||||
anchors.margins: 5
|
||||
font.pixelSize: hifi.fonts.pixelSize / 2
|
||||
text: root.text
|
||||
wrapMode: Original.Text.WordWrap
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue