From 0da94cc3b36cebbf0d57a30175aec2d578094080 Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Sat, 10 Oct 2020 16:59:22 +0200 Subject: [PATCH] Adjust CylinderGraph --- qml/components/CylinderGraph.qml | 22 ++++++++++++++++------ qml/components/SupplyItem.qml | 6 +++--- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/qml/components/CylinderGraph.qml b/qml/components/CylinderGraph.qml index 99194d6..2e95584 100644 --- a/qml/components/CylinderGraph.qml +++ b/qml/components/CylinderGraph.qml @@ -14,8 +14,8 @@ Item { z: 1 anchors.centerIn: parent - width: Theme.itemSizeSmall*0.66 - height: Theme.itemSizeSmall/3*0.66 + width: Theme.itemSizeExtraSmall + height: Theme.itemSizeExtraSmall/3 rotation: 90 transformOrigin: Item.Center @@ -29,16 +29,26 @@ Item { } } Rectangle { - width: Theme.itemSizeSmall*0.66*parent.value - height: Theme.itemSizeSmall/3*0.66 + width: Theme.itemSizeExtraSmall*parent.value + height: (Theme.itemSizeExtraSmall/3) rotation: 90 transformOrigin: Item.Center + gradient: Gradient { + GradientStop { position: 0.0; color: withOpacity(0.2, cylinderGraph.color)} + GradientStop { position: 0.1; color: cylinderGraph.color} + GradientStop { position: 0.9; color: cylinderGraph.color} + GradientStop { position: 1.0; color: withOpacity(0.2, cylinderGraph.color)} + } + anchors.horizontalCenter: effect.horizontalCenter anchors.bottom: effect.bottom - anchors.bottomMargin: -1*(Theme.itemSizeSmall*0.66-width)/2 - color: cylinderGraph.color + anchors.bottomMargin: -1*(Theme.itemSizeExtraSmall-Theme.itemSizeExtraSmall*parent.value)/2 +// color: cylinderGraph.color // opacity: 0.7 } + function withOpacity(opacity, color) { + Qt.rgba(color.r, color.g, color.b, opacity) + } } diff --git a/qml/components/SupplyItem.qml b/qml/components/SupplyItem.qml index 49b3f7b..29749eb 100644 --- a/qml/components/SupplyItem.qml +++ b/qml/components/SupplyItem.qml @@ -24,14 +24,14 @@ import "../components" Label { anchors.verticalCenter: parent.verticalCenter - width: Theme.itemSizeSmall + width: Theme.itemSizeExtraSmall text: ""+(100*level/high_level)+"%" color: Theme.highlightColor + font.pixelSize: Theme.fontSizeExtraSmall } Column { - leftPadding: Theme.paddingMedium - + anchors.verticalCenter: parent.verticalCenter Label { text: name