mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 18:54:02 +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;
|
||||
// Workaround for no max length on TextAreas
|
||||
onTextChanged: {
|
||||
optionalMessageCharacterCount.text = optionalMessage.text.length + "/" + optionalMessage.maximumLength;
|
||||
if (text.length > maximumLength) {
|
||||
var cursor = cursorPosition;
|
||||
text = previousText;
|
||||
|
@ -845,6 +846,20 @@ Item {
|
|||
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 {
|
||||
|
|
Loading…
Reference in a new issue