Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:epopov:branches:openSUSE:Factory
libksysguard6
2002-line-chart.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2002-line-chart.patch of Package libksysguard6
diff --git a/faces/facepackages/linechart/contents/ui/FullRepresentation.qml b/faces/facepackages/linechart/contents/ui/FullRepresentation.qml index 0a51156b26e3c137fb353a466bea0bb5b206035b..24d3929c86c46a38dfd75a24d4c6df029abaf80e 100644 --- a/faces/facepackages/linechart/contents/ui/FullRepresentation.qml +++ b/faces/facepackages/linechart/contents/ui/FullRepresentation.qml @@ -106,14 +106,76 @@ Faces.SensorFace { } } - Faces.ExtendedLegend { + Item { Layout.fillWidth: true - Layout.minimumHeight: implicitHeight - visible: root.showLegend - chart: compactRepresentation - sourceModel: root.showLegend ? compactRepresentation.sensorsModel : null - sensorIds: root.showLegend ? root.controller.lowPrioritySensorIds : [] - updateRateLimit: root.controller.updateRateLimit + Layout.preferredHeight: legend.implicitHeight + + RowLayout { + id: legend + anchors.left: parent.left + width: Math.min(parent.width, implicitWidth) + spacing: Kirigami.Units.gridUnit + visible: root.showLegend + + readonly property real maximumCellWidth: (parent.width - spacing * (legendDelegateRepeater.count - 1)) / legendDelegateRepeater.count + + Repeater { + id: legendDelegateRepeater + model: root.showLegend ? root.controller.highPrioritySensorIds : [] + + RowLayout { + id: legendDelegate + Layout.fillWidth: true + Layout.maximumWidth: sensorColor.Layout.preferredWidth + sensorName.Layout.preferredWidth + sensorValue.Layout.preferredWidth + 2 * spacing + spacing: Kirigami.Units.smallSpacing + + readonly property QtObject sensor: Sensors.Sensor { + sensorId: modelData + updateRateLimit: root.controller.updateRateLimit + } + + Rectangle { + id: sensorColor + Layout.fillHeight: true + Layout.preferredWidth: height / 3 + radius: width / 2 + color: root.controller.sensorColors[sensor.sensorId] || "white" + } + + QQC2.Label { + id: sensorName + Layout.preferredWidth: implicitWidth + text: "%1:".arg(root.controller.sensorLabels[sensor.sensorId] || sensor.name) + visible: legendDelegate.Layout.maximumWidth <= legend.maximumCellWidth + } + + QQC2.Label { + id: sensorValue + Layout.fillWidth: true + Layout.preferredWidth: Math.max(Formatter.Formatter.maximumLength(sensor.unit, font), implicitWidth) + text: sensor.formattedValue + } + } + } + } + + HoverHandler { + id: legendHoverHandler + } + + QQC2.ToolTip { + id: legendToolTip + visible: legendHoverHandler.hovered + text: legend.visibleChildren.reduce((text, child) => { + if (child instanceof RowLayout) { + if (text.length > 0) { + text += "\n"; + } + text += "%1: %2".arg(child.sensor.name).arg(child.sensor.formattedValue); + } + return text; + }, "") + } } } }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor