Merge PR #57: add a glow around lights icons for better visiblity

This commit is contained in:
Jenkins 2018-10-19 13:02:25 +02:00
commit 3fa733bc55

View File

@ -2,6 +2,7 @@ import QtQuick 2.5
import QtQuick.Controls 2.1 import QtQuick.Controls 2.1
import QtQuick.Controls.Material 2.1 import QtQuick.Controls.Material 2.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import Nymea 1.0 import Nymea 1.0
import "../components" import "../components"
@ -81,16 +82,39 @@ DeviceListPageBase {
id: nameRow id: nameRow
z: 2 // make sure the switch in here is on top of the slider, given we cheated a bit and made them overlap z: 2 // make sure the switch in here is on top of the slider, given we cheated a bit and made them overlap
spacing: app.margins spacing: app.margins
ColorIcon { Item {
Layout.preferredHeight: app.iconSize Layout.preferredHeight: app.iconSize
Layout.preferredWidth: height Layout.preferredWidth: height
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
color: itemDelegate.connectedState !== null && itemDelegate.connectedState.value === false ?
"red" // DropShadow {
: itemDelegate.colorStateType ? itemDelegate.colorState.value : "#00000000" // anchors.fill: icon
name: itemDelegate.connectedState !== null && itemDelegate.connectedState.value === false ? // horizontalOffset: 0
"../images/dialog-warning-symbolic.svg" // verticalOffset: 0
: itemDelegate.powerState.value === true ? "../images/light-on.svg" : "../images/light-off.svg" // radius: 2.0
// samples: 17
// color: app.foregroundColor
// source: icon
// }
Glow {
anchors.fill: icon
radius: 1
samples: 17
color: app.foregroundColor
source: icon
}
ColorIcon {
id: icon
anchors.fill: parent
color: itemDelegate.connectedState !== null && itemDelegate.connectedState.value === false ?
"red"
: itemDelegate.colorStateType ? itemDelegate.colorState.value : "#00000000"
name: itemDelegate.connectedState !== null && itemDelegate.connectedState.value === false ?
"../images/dialog-warning-symbolic.svg"
: itemDelegate.powerState.value === true ? "../images/light-on.svg" : "../images/light-off.svg"
}
} }
Label { Label {