From 81e6171345403727944fa2b65dcafec611758e05 Mon Sep 17 00:00:00 2001 From: Mike Trahearn Date: Thu, 12 Dec 2024 14:05:27 +1000 Subject: [PATCH] Add StatusBarAlarmIndicator to the StatusBar Part of #1492 --- CMakeLists.txt | 1 + components/StatusBar.qml | 2 ++ components/StatusBarAlarmIndicator.qml | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 components/StatusBarAlarmIndicator.qml diff --git a/CMakeLists.txt b/CMakeLists.txt index f044eaa4a..7502d93b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -254,6 +254,7 @@ set (VENUS_QML_MODULE_SOURCES components/SolarYieldModel.qml components/SplashView.qml components/StatusBar.qml + components/StatusBarAlarmIndicator.qml components/SwipePageModel.qml components/SwipeViewPage.qml components/SystemReason.qml diff --git a/components/StatusBar.qml b/components/StatusBar.qml index 70dabf372..84c9e4a16 100644 --- a/components/StatusBar.qml +++ b/components/StatusBar.qml @@ -265,4 +265,6 @@ Rectangle { onClicked: Global.screenBlanker.setDisplayOff() } } + + StatusBarAlarmIndicator { } } diff --git a/components/StatusBarAlarmIndicator.qml b/components/StatusBarAlarmIndicator.qml new file mode 100644 index 000000000..49a0a60f7 --- /dev/null +++ b/components/StatusBarAlarmIndicator.qml @@ -0,0 +1,21 @@ +/* +** Copyright (C) 2023 Victron Energy B.V. +** See LICENSE.txt for license information. +*/ + +import QtQuick +import Victron.VenusOS + +Rectangle { + + width: parent.width + height: 5 + color: Theme.color_critical + opacity: Global.notifications.alarm ? 1 : 0 + + Behavior on opacity { + OpacityAnimator { + duration: Theme.animation_page_fade_duration + } + } +}