Changeset View
Changeset View
Standalone View
Standalone View
applets/systemmonitor/common/contents/ui/DoublePlotter.qml
Context not available. | |||||
32 | Layout.fillHeight: true | 32 | Layout.fillHeight: true | ||
---|---|---|---|---|---|
33 | horizontalGridLineCount: 0 | 33 | horizontalGridLineCount: 0 | ||
34 | 34 | | |||
35 | function formatLabel(data1, data2) { | | |||
36 | return i18nc("%1 and %3 are data values, %2 and %4 are unit datatypes", "%1 %2 | %3 %4", data1.value, data1.units, | | |||
37 | data2.value, data2.units); | | |||
38 | } | | |||
39 | | ||||
40 | function cycle(color, degrees) { | 35 | function cycle(color, degrees) { | ||
41 | var min = Math.min(color.r, Math.min(color.g, color.b)); | 36 | var min = Math.min(color.r, Math.min(color.g, color.b)); | ||
42 | var max = Math.max(color.r, Math.max(color.g, color.b)); | 37 | var max = Math.max(color.r, Math.max(color.g, color.b)); | ||
Context not available. | |||||
69 | ] | 64 | ] | ||
70 | 65 | | |||
71 | PlasmaComponents.Label { | 66 | PlasmaComponents.Label { | ||
67 | id: nameLabel | ||||
72 | anchors { | 68 | anchors { | ||
73 | left: parent.left | 69 | left: parent.left | ||
74 | top: parent.top | 70 | top: parent.top | ||
75 | } | 71 | } | ||
76 | text: plotter.sensorName | | |||
77 | } | 72 | } | ||
78 | 73 | | |||
79 | PlasmaComponents.Label { | 74 | PlasmaComponents.Label { | ||
80 | id: speedLabel | 75 | id: speedLabel | ||
81 | wrapMode: Text.WordWrap | 76 | wrapMode: Text.WordWrap | ||
77 | visible: plasmoid.formFactor != PlasmaCore.Types.Vertical | ||||
82 | anchors { | 78 | anchors { | ||
83 | right: parent.right | 79 | right: parent.right | ||
84 | } | 80 | } | ||
Context not available. | |||||
101 | 97 | | |||
102 | plotter.addSample([data1.value, data2.value]); | 98 | plotter.addSample([data1.value, data2.value]); | ||
103 | 99 | | |||
104 | speedLabel.text = formatLabel(data1, data2); | 100 | if (plasmoid.formFactor != PlasmaCore.Types.Vertical) { | ||
101 | nameLabel.text = plotter.sensorName | ||||
102 | speedLabel.text = formatData(data1) + " | " + formatData(data2) | ||||
103 | } else { | ||||
104 | nameLabel.text = plotter.sensorName+ "\n" + formatData(data1) + "\n" + formatData(data2) | ||||
105 | speedLabel.text = "" | ||||
106 | } | ||||
105 | } | 107 | } | ||
106 | } | 108 | } | ||
107 | } | 109 | } | ||
Context not available. |