components mobile scaling

This commit is contained in:
Jaquee
2017-08-07 15:47:56 +02:00
parent 66bb3fe7ac
commit 9e0db8f4ff
12 changed files with 124 additions and 125 deletions

View File

@@ -36,13 +36,13 @@ Item {
property alias readOnly : input.readOnly
property alias cursorPosition: input.cursorPosition
property alias echoMode: input.echoMode
property int fontSize: 18
property int fontSize: 18 * scaleRatio
property bool error: false
signal editingFinished()
signal accepted();
signal textUpdated();
height: 37
height: 37 * scaleRatio
function getColor(error) {
if (error)
@@ -53,14 +53,14 @@ Item {
Rectangle {
anchors.fill: parent
anchors.bottomMargin: 1
anchors.bottomMargin: 1 * scaleRatio
color: "#DBDBDB"
//radius: 4
}
Rectangle {
anchors.fill: parent
anchors.topMargin: 1
anchors.topMargin: 1 * scaleRatio
color: getColor(error)
//radius: 4
}
@@ -68,8 +68,8 @@ Item {
Input {
id: input
anchors.fill: parent
anchors.leftMargin: 4
anchors.rightMargin: 30
anchors.leftMargin: 4 * scaleRatio
anchors.rightMargin: 30 * scaleRatio
font.pixelSize: parent.fontSize
onEditingFinished: item.editingFinished()
onAccepted: item.accepted();