Changeset View
Changeset View
Standalone View
Standalone View
applets/systemmonitor/common/contents/ui/SinglePlotter.qml
Context not available. | |||||
35 | Layout.preferredHeight: parent.height | 35 | Layout.preferredHeight: parent.height | ||
---|---|---|---|---|---|
36 | horizontalGridLineCount: 0 | 36 | horizontalGridLineCount: 0 | ||
37 | 37 | | |||
38 | function formatLabel(data) { | | |||
39 | return i18nc("%1 is data value, %2 is unit datatype", "%1 %2", data.value, data.units); | | |||
40 | } | | |||
41 | | ||||
42 | dataSets: [ | 38 | dataSets: [ | ||
43 | KQuickAddons.PlotData { | 39 | KQuickAddons.PlotData { | ||
44 | color: theme.highlightColor | 40 | color: theme.highlightColor | ||
Context not available. | |||||
46 | ] | 42 | ] | ||
47 | 43 | | |||
48 | PlasmaComponents.Label { | 44 | PlasmaComponents.Label { | ||
45 | id: nameLabel | ||||
49 | anchors { | 46 | anchors { | ||
50 | left: parent.left | 47 | left: parent.left | ||
51 | top: parent.top | 48 | top: parent.top | ||
52 | } | 49 | } | ||
53 | text: plotter.sensorName | | |||
54 | } | 50 | } | ||
55 | 51 | | |||
56 | PlasmaComponents.Label { | 52 | PlasmaComponents.Label { | ||
57 | id: speedLabel | 53 | id: speedLabel | ||
58 | wrapMode: Text.WordWrap | 54 | wrapMode: Text.WordWrap | ||
55 | visible: plasmoid.formFactor != PlasmaCore.Types.Vertical | ||||
59 | anchors { | 56 | anchors { | ||
60 | right: parent.right | 57 | right: parent.right | ||
61 | } | 58 | } | ||
Context not available. | |||||
76 | 73 | | |||
77 | plotter.addSample([data1.value]); | 74 | plotter.addSample([data1.value]); | ||
78 | 75 | | |||
79 | speedLabel.text = formatLabel(data1); | 76 | if (plasmoid.formFactor != PlasmaCore.Types.Vertical) { | ||
77 | nameLabel.text = plotter.sensorName | ||||
78 | speedLabel.text = formatData(data1) | ||||
79 | } else { | ||||
80 | nameLabel.text = plotter.sensorName+ "\n" + formatData(data1) | ||||
81 | speedLabel.text = "" | ||||
82 | } | ||||
80 | } | 83 | } | ||
81 | } | 84 | } | ||
82 | } | 85 | } | ||
Context not available. |