C
Qt Quick Ultralite Automotive Cluster Demo
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial
import QtQuick 2.15
import QtQuickUltralite.Extras 2.0
import Automotive 1.0
Item {
id: indicator
height: 28;
width: image.width + 15;
property alias source: image.source;
property bool active: false;
property color activeColor: Style.highlighterGreen
property color inactiveColor: Style.darkBlue;
property alias opacity: image.opacity;
property alias blinking: indicatorBlinkAnimation.running
ColorizedImage {
id: image;
color: parent.active ? parent.activeColor : parent.inactiveColor;
anchors.horizontalCenter: parent.horizontalCenter;
anchors.verticalCenter: parent.verticalCenter;
Behavior on color { ColorAnimation {
duration: 150;
easing.type: Easing.InOutQuad;
}}
Behavior on opacity { NumberAnimation {
easing.type: Easing.InOutQuad;
duration: TellTalesModel.opacityChangeDuration;
}}
}
SequentialAnimation {
id: indicatorBlinkAnimation
loops: Animation.Infinite
alwaysRunToEnd: true
ScriptAction {
script: indicator.active = true;
}
PauseAnimation {
duration: 400
}
ScriptAction {
script: indicator.active = false;
}
PauseAnimation {
duration: 300
}
}
}