Warning, /rolisteam/rolisteam/src/libraries/charactersheet/qml/Rolisteam/TextInputFieldv1.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.0
0002 import QtQuick 2.4
0003 import QtQuick.Controls 1.3
0004 
0005 Rectangle {
0006     id:root
0007     property alias text : textInput.text
0008     property alias textColor: textInput.color
0009     property alias hAlign: textInput.horizontalAlignment
0010     property alias vAlign: textInput.verticalAlignment
0011     property alias font : textInput.font
0012     property alias wrapMode : textInput.wrapMode
0013     property bool clippedText: false
0014     property bool readOnly: false
0015     TextInput {//textInput.textColor
0016         id: textInput
0017         anchors.fill: parent
0018         selectByMouse: true
0019         readOnly: root.readOnly
0020         onWidthChanged: {
0021             computeSizeFont();
0022         }
0023         function computeSizeFont()
0024         {
0025             if(parent.clippedText)
0026             {
0027                 while((contentWidth>root.width)&&(font.pointSize>1)&&(root.width>0))
0028                 {
0029                     font.pointSize-=1
0030                 }
0031                 while((contentWidth+2<width)&&(contentHeight+2<height))
0032                 {
0033                     font.pointSize+=1
0034                 }
0035             }
0036         }
0037     }
0038 }