Adjust CylinderGraph

This commit is contained in:
Anton Thomasson 2020-10-10 16:59:22 +02:00
parent dc89381374
commit 0da94cc3b3
2 changed files with 19 additions and 9 deletions

View file

@ -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)
}
}

View file

@ -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