diff --git a/NERODesign/content/Battery.qml b/NERODesign/content/Battery.qml index 19c276f..6d9d507 100644 --- a/NERODesign/content/Battery.qml +++ b/NERODesign/content/Battery.qml @@ -11,29 +11,51 @@ Item { Rectangle { id: topOutlet x: parent.width / 2 - parent.width / 4 - width: parent.width / 2 + width: parent.width / 4.5 height: parent.height - color: "white" + radius: 30 + color: battery.value > 70 ? "#55FF00" : battery.value > 40 ? "orange" : "red" anchors.centerIn: parent } Rectangle { id: mainContainer - width: parent.width + y: 48 + width: parent.width / 2.15 height: parent.height - parent.height / 10 - color: "white" + radius: 30 + color: battery.value > 70 ? "#55FF00" : battery.value > 40 ? "orange" : "red" anchors.bottom: parent.bottom + anchors.bottomMargin: 0 + anchors.horizontalCenterOffset: 0 anchors.horizontalCenter: parent.horizontalCenter Rectangle { - id: fillContainer - width: parent.width - (battery.horizontalFillMargin * 2) - height: (parent.height - (battery.verticalFillMargin * 2)) - * (battery.value / battery.maxValue) - color: battery.value > 70 ? "#55FF00" : battery.value > 40 ? "orange" : "red" + id: emptyContainer + y: 123 + width: parent.width - (battery.horizontalFillMargin * 1.5) + height: (parent.height - (battery.verticalFillMargin * 3)) + radius: 30 + color: "black" anchors.bottom: parent.bottom + anchors.bottomMargin: 36 + anchors.horizontalCenterOffset: 0 anchors.horizontalCenter: parent.horizontalCenter - anchors.bottomMargin: battery.verticalFillMargin + + Rectangle { + id: fillContainer + y: 136 + width: parent.width + height: (parent.height * (battery.value / battery.maxValue)) + gradient: Gradient { + GradientStop { position: 0.0; color: battery.value > 70 ? "#55FF00" : battery.value > 40 ? "orange" : "red" } + GradientStop { position: 1.0; color: "black" } + } + anchors.bottom: parent.bottom + anchors.bottomMargin: 0 + anchors.horizontalCenterOffset: 0 + anchors.horizontalCenter: parent.horizontalCenter + } } } }