2020-08-21 11:23:47 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2020-09-17 15:08:02 +00:00
|
|
|
import "../../imports"
|
2020-09-17 19:45:57 +00:00
|
|
|
import "../../shared"
|
2020-08-21 11:23:47 +00:00
|
|
|
|
|
|
|
ToolTip {
|
|
|
|
id: tooltip
|
2021-02-10 16:25:54 +00:00
|
|
|
property int maxWidth: 400
|
|
|
|
implicitWidth: Math.min(maxWidth, textContent.implicitWidth + Style.current.bigPadding)
|
2021-02-10 00:17:09 +00:00
|
|
|
leftPadding: Style.current.smallPadding
|
|
|
|
rightPadding: Style.current.smallPadding
|
2020-08-21 11:23:47 +00:00
|
|
|
topPadding: Style.current.smallPadding
|
|
|
|
bottomPadding: Style.current.smallPadding
|
|
|
|
delay: 200
|
|
|
|
background: Item {
|
|
|
|
id: tooltipBg
|
|
|
|
Rectangle {
|
|
|
|
id: tooltipContentBg
|
2021-01-19 15:26:34 +00:00
|
|
|
color: Style.current.tooltipBackgroundColor
|
2020-08-21 11:23:47 +00:00
|
|
|
radius: Style.current.radius
|
|
|
|
anchors.fill: parent
|
2021-02-10 00:17:09 +00:00
|
|
|
anchors.bottomMargin: Style.current.smallPadding
|
2020-08-21 11:23:47 +00:00
|
|
|
}
|
|
|
|
Rectangle {
|
|
|
|
color: tooltipContentBg.color
|
|
|
|
height: 24
|
|
|
|
width: 24
|
|
|
|
rotation: 135
|
|
|
|
radius: 1
|
|
|
|
x: tooltipBg.width / 2 - width / 2
|
|
|
|
anchors.top: tooltipContentBg.bottom
|
|
|
|
anchors.topMargin: -20
|
|
|
|
}
|
|
|
|
}
|
|
|
|
contentItem: StyledText {
|
|
|
|
id: textContent
|
|
|
|
text: tooltip.text
|
2021-01-19 15:26:34 +00:00
|
|
|
color: Style.current.tooltipForegroundColor
|
2020-08-21 11:23:47 +00:00
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.pixelSize: 13
|
2021-01-25 20:50:42 +00:00
|
|
|
font.weight: Font.Medium
|
2020-08-21 11:23:47 +00:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2021-02-10 00:17:09 +00:00
|
|
|
bottomPadding: Style.current.smallPadding
|
2020-08-21 11:23:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|