From 325cb42fbb73340da3f40842d3295c499a9e2e12 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 11 May 2020 06:41:11 -0700 Subject: [PATCH] mobile: add smaller, vertically dense template label By default single line text has too much white space around it. This smaller, denser label works well to more efficiently use screen real estate, I think. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/TemplateLabelSmall.qml | 19 +++++++++++++++++++ mobile-widgets/qml/mobile-resources.qrc | 1 + 2 files changed, 20 insertions(+) create mode 100644 mobile-widgets/qml/TemplateLabelSmall.qml diff --git a/mobile-widgets/qml/TemplateLabelSmall.qml b/mobile-widgets/qml/TemplateLabelSmall.qml new file mode 100644 index 000000000..af8c23d9e --- /dev/null +++ b/mobile-widgets/qml/TemplateLabelSmall.qml @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0 +import QtQuick 2.11 +import QtQuick.Controls 2.4 + +Label { + id: myLabel + color: subsurfaceTheme.textColor + font.pointSize: subsurfaceTheme.smallPointSize + lineHeight: 0.6 + property alias colorBackground: myLabelBackground.color + + background: Rectangle { + id: myLabelBackground + implicitWidth: myLabel.width + implicitHeight: myLabel.width + color: subsurfaceTheme.backgroundColor + } +} + diff --git a/mobile-widgets/qml/mobile-resources.qrc b/mobile-widgets/qml/mobile-resources.qrc index c76e4b7de..4462ab1c8 100644 --- a/mobile-widgets/qml/mobile-resources.qrc +++ b/mobile-widgets/qml/mobile-resources.qrc @@ -5,6 +5,7 @@ TemplateCheckBox.qml TemplateComboBox.qml TemplateLabel.qml + TemplateLabelSmall.qml TemplateLine.qml TemplateRadioButton.qml TemplatePage.qml