First commit
There was history before but now there is no more.
This commit is contained in:
commit
8d57bfb1ae
35 changed files with 2231 additions and 0 deletions
50
Fields/Text.qml
Normal file
50
Fields/Text.qml
Normal file
|
@ -0,0 +1,50 @@
|
|||
// SPDX-License-Identifier: Unlicense
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.13
|
||||
|
||||
Label {
|
||||
id: control
|
||||
|
||||
property var definition
|
||||
property alias value: control.text
|
||||
|
||||
Keys.onPressed: {
|
||||
if (event.text === definition.key) {
|
||||
popup.open()
|
||||
event.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
function set(val) { value = val || '' }
|
||||
|
||||
elide: Text.ElideRight
|
||||
|
||||
Popup {
|
||||
id: popup
|
||||
|
||||
width: control.width
|
||||
height: control.height
|
||||
padding: 0
|
||||
|
||||
onOpened: {
|
||||
input.text = value
|
||||
input.forceActiveFocus()
|
||||
}
|
||||
|
||||
TextInput {
|
||||
id: input
|
||||
|
||||
clip: true
|
||||
padding: 2
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
width: parent.width
|
||||
|
||||
onAccepted: {
|
||||
value = input.text.trim()
|
||||
popup.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue