Files
StandBatteryView/Qml/Controls/TextField.qml
2025-07-02 18:00:35 +09:00

56 lines
1.2 KiB
QML

import QtQuick 2.12
import QtQuick.Controls 2.12 as Controls
import Palette 1.0
Controls.TextField {
id: control
readOnly: true
selectByMouse: true
implicitHeight: 34
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
topPadding: 6
bottomPadding: 6
leftPadding: 12
rightPadding: 12 + Math.ceil(indicatorLabel.width) + (indicatorLabel.visible ? 12 : 0)
font.family: "Roboto"
font.pixelSize: 22
font.weight: Font.Bold
color: Palette.labelTextColor
property string indicatorText
background: Rectangle {
radius: 8
color: Palette.controlBackgroundColor
border.width: 1
border.color: Palette.borderColor
width: control.width
height: control.height
Controls.Label {
id: indicatorLabel
visible: control.indicatorText.length > 0
text: control.indicatorText
anchors.right: parent.right
anchors.rightMargin: 12
anchors.bottom: parent.bottom
anchors.bottomMargin: 6
font.family: "Roboto"
font.pixelSize: 17
font.weight: Font.Normal
color: Palette.descriptionTextColor
}
}
}