28 lines
784 B
QML
28 lines
784 B
QML
/*
|
|
* Plain text display mode — colored price text.
|
|
* Pure QtQuick on purpose: no Plasma imports, so it can be loaded
|
|
* and tested outside the plasmoid shell.
|
|
*/
|
|
|
|
import QtQuick 2.15
|
|
|
|
Text {
|
|
id: root
|
|
|
|
// wired by the parent loader: the formatted price string
|
|
property string display: "--"
|
|
// trend color (green/red/grey) from the widget root
|
|
property color trendColor: "#9e9e9e"
|
|
|
|
text: root.display
|
|
color: root.trendColor
|
|
textFormat: Text.PlainText
|
|
elide: Text.ElideRight
|
|
horizontalAlignment: Text.AlignHCenter
|
|
verticalAlignment: Text.AlignVCenter
|
|
font.family: Qt.application.font.family
|
|
font.pixelSize: root.height > 0
|
|
? Math.round(root.height * 0.82)
|
|
: Qt.application.font.pixelSize
|
|
}
|