mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 12:18:36 +02:00
Add character count :)
This commit is contained in:
parent
260aee42a8
commit
b3e3af4ee7
1 changed files with 15 additions and 0 deletions
|
@ -833,6 +833,7 @@ Item {
|
||||||
activeFocusOnTab: true;
|
activeFocusOnTab: true;
|
||||||
// Workaround for no max length on TextAreas
|
// Workaround for no max length on TextAreas
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
|
optionalMessageCharacterCount.text = optionalMessage.text.length + "/" + optionalMessage.maximumLength;
|
||||||
if (text.length > maximumLength) {
|
if (text.length > maximumLength) {
|
||||||
var cursor = cursorPosition;
|
var cursor = cursorPosition;
|
||||||
text = previousText;
|
text = previousText;
|
||||||
|
@ -845,6 +846,20 @@ Item {
|
||||||
previousText = text;
|
previousText = text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
RalewaySemiBold {
|
||||||
|
id: optionalMessageCharacterCount;
|
||||||
|
// Anchors
|
||||||
|
anchors.top: optionalMessage.bottom;
|
||||||
|
anchors.topMargin: 2;
|
||||||
|
anchors.right: optionalMessage.right;
|
||||||
|
height: paintedHeight;
|
||||||
|
// Text size
|
||||||
|
size: 16;
|
||||||
|
// Style
|
||||||
|
color: hifi.colors.baseGray;
|
||||||
|
verticalAlignment: Text.AlignTop;
|
||||||
|
horizontalAlignment: Text.AlignRight;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
Loading…
Reference in a new issue