mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 08:49:05 +02: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 Hifi 1.0 as Hifi
|
||||||
import QtQuick 2.3 as Original
|
import QtQuick 2.3 as Original
|
||||||
|
import QtQuick.Layouts 1.1
|
||||||
import "controls"
|
import "controls"
|
||||||
import "styles"
|
import "styles"
|
||||||
|
|
||||||
Hifi.Tooltip {
|
Hifi.Tooltip {
|
||||||
id: root
|
id: root
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
x: (lastMousePosition.x > surfaceSize.width/2) ? lastMousePosition.x - root.width : lastMousePosition.x + 20
|
x: (lastMousePosition.x > surfaceSize.width/2) ? lastMousePosition.x - root.width : lastMousePosition.x
|
||||||
y: (lastMousePosition.y > surfaceSize.height/2) ? lastMousePosition.y - root.height : lastMousePosition.y + 5
|
y: (lastMousePosition.y > surfaceSize.height/2) ? lastMousePosition.y - root.height : lastMousePosition.y
|
||||||
implicitWidth: border.implicitWidth
|
implicitWidth: border.implicitWidth
|
||||||
implicitHeight: border.implicitHeight
|
implicitHeight: border.implicitHeight
|
||||||
|
|
||||||
|
@ -18,29 +19,44 @@ Hifi.Tooltip {
|
||||||
//implicitHeight: Math.max(text.implicitHeight, 64)
|
//implicitHeight: Math.max(text.implicitHeight, 64)
|
||||||
implicitHeight: tooltipBackground.implicitHeight
|
implicitHeight: tooltipBackground.implicitHeight
|
||||||
|
|
||||||
/*
|
Original.Image {
|
||||||
Text {
|
|
||||||
id: text
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: 16
|
|
||||||
font.pixelSize: hifi.fonts.pixelSize / 2
|
|
||||||
text: root.text
|
|
||||||
wrapMode: Original.Text.WordWrap
|
|
||||||
}*/
|
|
||||||
|
|
||||||
Image {
|
|
||||||
id: tooltipBackground
|
id: tooltipBackground
|
||||||
source: "../images/NoPictureProvided.svg"
|
source: "../images/tooltip_container.svg"
|
||||||
width: 323
|
width: 323
|
||||||
height: 423
|
height: 423
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
/*
|
ColumnLayout {
|
||||||
Image {
|
spacing: 5
|
||||||
id: tooltipBackground
|
|
||||||
source: "../images/NoPictureProvided.svg"
|
Text {
|
||||||
anchors.fill: parent
|
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