From bb13065a75fd02d0732575b2c01cb3210ad96f32 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Fri, 24 Jan 2020 10:15:21 +0100 Subject: mobile-widgets/qml: add background color property Add property "colorBackground" to allow instances of templateLabel to have background color overwritten. Signed-off-by: jan Iversen Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/TemplateLabel.qml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mobile-widgets/qml/TemplateLabel.qml b/mobile-widgets/qml/TemplateLabel.qml index d022e2256..4754a8121 100644 --- a/mobile-widgets/qml/TemplateLabel.qml +++ b/mobile-widgets/qml/TemplateLabel.qml @@ -3,7 +3,16 @@ import QtQuick 2.11 import QtQuick.Controls 2.4 Label { + id: myLabel color: subsurfaceTheme.textColor font.pointSize: subsurfaceTheme.regularPointSize + property alias colorBackground: myLabelBackground.color + + background: Rectangle { + id: myLabelBackground + implicitWidth: myLabel.width + implicitHeight: myLabel.width + color: subsurfaceTheme.backgroundColor + } } -- cgit v1.2.3-70-g09d2