C

Qt Quick Ultralite Thermostat Demo

/****************************************************************************** ** ** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Ultralite module. ** ** $QT_BEGIN_LICENSE:COMM$ ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** $QT_END_LICENSE$ ** ******************************************************************************/
import QtQuick 2.15 import QtQuick.Templates 2.15 import Thermo 1.0 RadioButton { id: control implicitWidth: background.implicitWidth implicitHeight: background.implicitHeight spacing: 10 property alias flag: flagIndicator.source indicator: Image { y: control.topPadding + (control.availableHeight - height) / 2 source: control.checked ? (control.down ? "radiobutton-checked-pressed.png" : "radiobutton-checked.png") : (control.down ? "radiobutton-pressed.png" : "radiobutton.png") } background: Item { implicitWidth: control.contentItem.implicitWidth implicitHeight: Theme.dialogButtonHeight } // Text has no padding properties in UL, so we use Row with an Item for the spacing. contentItem: Row { anchors.verticalCenter: background.verticalCenter Item { implicitWidth: control.indicator.width + control.spacing } Image { id: flagIndicator anchors.verticalCenter: parent.verticalCenter } Item { implicitWidth: control.spacing } Text { text: control.text color: ColorStyle.greyDark4 anchors.verticalCenter: parent.verticalCenter font.pixelSize: Theme.bottomBarFontSize } } }