opaque/TextField.qml

32 lines
690 B
QML
Raw Permalink Normal View History

2020-05-19 19:49:52 +00:00
import QtQuick 2.7
import QtQuick.Controls 2.13
2020-05-19 23:25:00 +00:00
import "theme"
2020-05-19 19:49:52 +00:00
2020-07-14 22:24:16 +00:00
/*!
\qmltype TextField
\inqmlmodule Opaque
\inherits QtQuick::Item
\index Index
\brief Basic single-line text input box.
2020-07-14 22:24:16 +00:00
For example:
2020-07-14 22:24:16 +00:00
*/
2020-05-19 19:49:52 +00:00
TextField {
property color errorColor: Theme.textfieldErrorColor
property bool error: false
color: error ? errorColor : Theme.textfieldTextColor
2020-12-17 16:10:21 +00:00
font.pointSize: Theme.textSmallPt
2020-05-19 19:49:52 +00:00
width: 100
// selectByMouse shouldn't be enabled on mobile
selectByMouse: gcd.os != "android" && !readOnly
2020-05-19 19:49:52 +00:00
background: Rectangle {
radius: 2
2020-08-28 22:08:33 +00:00
color: Theme.textfieldBackgroundColor
border.color: error ? errorColor : Theme.textfieldBorderColor
2020-05-19 19:49:52 +00:00
}
}