38 lines
1.1 KiB
QML
38 lines
1.1 KiB
QML
import QtQuick
|
|
import QtQuick.Templates as T
|
|
|
|
T.TextField {
|
|
id: control
|
|
background: Rectangle {
|
|
id: background
|
|
color: Colors.mantle
|
|
radius: Dimensions.radius
|
|
border.width: !control.focus ? 1 : 2
|
|
border.color: Colors.interactive
|
|
height: 47
|
|
}
|
|
|
|
color: Colors.foreground
|
|
implicitHeight: background.height
|
|
placeholderTextColor: Colors.interactive
|
|
font: Typography.body
|
|
padding: Dimensions.m
|
|
|
|
/**
|
|
* Placeholder
|
|
*/
|
|
Text {
|
|
x: control.leftPadding
|
|
y: control.topPadding
|
|
width: control.width - (control.leftPadding + control.rightPadding)
|
|
height: control.height - (control.topPadding + control.bottomPadding)
|
|
|
|
font: control.font
|
|
text: control.placeholderText
|
|
color: control.placeholderTextColor
|
|
verticalAlignment: control.verticalAlignment
|
|
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
|
|
elide: Text.ElideRight
|
|
renderType: control.renderType
|
|
}
|
|
} |