From e0e717e9c591d12e58e9f8be8a1d2baad8b722d1 Mon Sep 17 00:00:00 2001 From: Louis-Joseph Fournier Date: Sun, 3 Jan 2016 14:50:55 +0100 Subject: [PATCH] Screen: leds width border --- qml/Led.qml | 29 ++++++++++++++++++++--------- qml/TunerScreen.qml | 4 ++-- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/qml/Led.qml b/qml/Led.qml index 6fe8fbb..2aef846 100644 --- a/qml/Led.qml +++ b/qml/Led.qml @@ -5,16 +5,27 @@ import QtGraphicalEffects 1.0 * Led: a circle color */ -RadialGradient { +Rectangle { property color led_color: "red" - gradient: Gradient { - GradientStop { - position: 0.0 - color: led_color - } - GradientStop { - position: 0.5 - color: "transparent" + property bool on: false + + radius: width / 2 + border.width: 1 + border.color: "#80888888" + color: "#20888888" + + RadialGradient { + anchors.fill: parent + visible: parent.on + gradient: Gradient { + GradientStop { + position: 0.0 + color: led_color + } + GradientStop { + position: 0.5 + color: "transparent" + } } } } diff --git a/qml/TunerScreen.qml b/qml/TunerScreen.qml index 23663ec..570458c 100644 --- a/qml/TunerScreen.qml +++ b/qml/TunerScreen.qml @@ -33,7 +33,7 @@ Item { width: meter.width / 12 height: width led_color: dev_is_ok ? led_green : led_red - visible: tuner.found && (dev_is_ok || tuner.deviation < 0) + on: tuner.found && (dev_is_ok || tuner.deviation < 0) } Led { @@ -44,7 +44,7 @@ Item { width: meter.width / 12 height: width led_color: dev_is_ok ? led_green : led_red - visible: tuner.found && (dev_is_ok || tuner.deviation > 0) + on: tuner.found && (dev_is_ok || tuner.deviation > 0) } CircleMeter {