plasma-framework/tests/tooltip.qml
David Edmundson 78684c46cd Remove unnecessary placeholder
Text.implicitWidth holds the size the text would be if it wasn't
truncated
2014-05-28 16:24:50 +02:00

72 lines
1.4 KiB
QML

import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
Rectangle {
color: "white"
width: 600
height: 800
Column {
anchors.centerIn: parent
spacing: 4
PlasmaCore.ToolTipArea {
width: 300
height: 50
mainText: "This is some really really really really long text that should be truncated"
subText: "subtext"
Rectangle {
color: "red"
anchors.fill: parent
}
Text {
anchors.fill: parent
text: "long tooltip"
}
}
PlasmaCore.ToolTipArea {
width: 300
height: 50
mainText: "A"
subText: "B"
Rectangle {
color: "red"
anchors.fill: parent
}
Text {
anchors.fill: parent
text: "short tooltip"
}
}
PlasmaCore.ToolTipArea {
width: 300
height: 50
mainText: "A"
subText: "Lorem ipsum dolor sit amet, consectetur adipiscing spaghetti italiano random cheesecake blah blah"
Rectangle {
color: "red"
anchors.fill: parent
}
Text {
anchors.fill: parent
text: "long subtext"
}
}
}
}