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
|
|
|
/*!
|
2020-08-24 21:51:37 +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
|
|
|
|
2020-08-24 21:51:37 +00:00
|
|
|
For example:
|
2020-07-14 22:24:16 +00:00
|
|
|
|
|
|
|
*/
|
2020-05-19 19:49:52 +00:00
|
|
|
TextField {
|
2020-10-19 22:20:38 +00:00
|
|
|
property color errorColor: Theme.textfieldErrorColor
|
|
|
|
property bool error: false
|
|
|
|
|
|
|
|
color: error ? errorColor : Theme.textfieldTextColor
|
2020-05-19 19:49:52 +00:00
|
|
|
font.pointSize: 10 * gcd.themeScale
|
|
|
|
width: 100
|
|
|
|
|
2020-09-03 22:40:44 +00:00
|
|
|
// 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
|
2020-10-19 22:20:38 +00:00
|
|
|
border.color: error ? errorColor : Theme.textfieldBorderColor
|
2020-05-19 19:49:52 +00:00
|
|
|
}
|
|
|
|
}
|