diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2012-03-07 17:10:14 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-09 11:03:23 +0100 |
commit | 576fb7a8c9e15052f8662e3fcbe03a87c8316939 (patch) | |
tree | 365b607d0b7c33eddfb5b3110d047d23ace6daea /examples/quick/righttoleft/textalignment/textalignment.qml | |
parent | 4b56661fd27cf6ce0c9410759fbd5c390e41dd69 (diff) |
Update righttoleft examples to new form factor
Change-Id: I2591f45a91da8bad90c5f3b9c963199c57bcf74d
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
Diffstat (limited to 'examples/quick/righttoleft/textalignment/textalignment.qml')
-rw-r--r-- | examples/quick/righttoleft/textalignment/textalignment.qml | 72 |
1 files changed, 42 insertions, 30 deletions
diff --git a/examples/quick/righttoleft/textalignment/textalignment.qml b/examples/quick/righttoleft/textalignment/textalignment.qml index ef5b97bb1a..3302ce5873 100644 --- a/examples/quick/righttoleft/textalignment/textalignment.qml +++ b/examples/quick/righttoleft/textalignment/textalignment.qml @@ -43,10 +43,13 @@ import QtQuick 2.0 Rectangle { id: root color: "white" - width: containerColumn.width - height: containerColumn.height + containerColumn.anchors.topMargin + //width: containerColumn.width + //height: containerColumn.height + containerColumn.anchors.topMargin + width: 320 + height: 480 property bool mirror: false + property int pxSz: 18 property variant horizontalAlignment: undefined property variant editorType: ["Plain Text", "Styled Text", "Plain Rich Text", "Italic Rich Text", "Plain TextEdit", "Italic TextEdit", "TextInput"] @@ -76,30 +79,32 @@ Rectangle { spacing: 10 width: editorTypeRow.width anchors { top: parent.top; topMargin: 5 } - Row { + ListView { + width: 320 + height: 320 id: editorTypeRow - Repeater { - model: editorType.length - Item { - width: editorColumn.width - height: editorColumn.height + model: editorType.length + orientation: ListView.Horizontal + cacheBuffer: 1000//Load the really expensive ones async if possible + delegate: Item { + width: editorColumn.width + height: editorColumn.height + Column { + id: editorColumn + spacing: 5 + width: textColumn.width+10 + Text { + text: root.editorType[index] + font.pixelSize: 16 + anchors.horizontalCenter: parent.horizontalCenter + } Column { - id: editorColumn + id: textColumn spacing: 5 - width: textColumn.width+10 - Text { - text: root.editorType[index] - font.pixelSize: 16 - anchors.horizontalCenter: parent.horizontalCenter - } - Column { - id: textColumn - spacing: 5 - anchors.horizontalCenter: parent.horizontalCenter - Repeater { - model: textComponents.length - delegate: textComponents[index] - } + anchors.horizontalCenter: parent.horizontalCenter + Repeater { + model: textComponents.length + delegate: textComponents[index] } } } @@ -190,7 +195,7 @@ Rectangle { Text { width: 180 text: root.text[index] - font.pixelSize: 24 + font.pixelSize: pxSz wrapMode: Text.WordWrap horizontalAlignment: root.horizontalAlignment LayoutMirroring.enabled: root.mirror @@ -204,6 +209,7 @@ Rectangle { text: root.description[index] color: Qt.rgba(1,1,1,1.0) anchors.centerIn: parent + font.pixelSize: pxSz - 2 Rectangle { z: -1 color: Qt.rgba(0.3, 0, 0, 0.3) @@ -223,7 +229,7 @@ Rectangle { Text { width: 180 text: root.text[index] - font.pixelSize: 24 + font.pixelSize: pxSz wrapMode: Text.WordWrap horizontalAlignment: root.horizontalAlignment LayoutMirroring.enabled: root.mirror @@ -239,6 +245,7 @@ Rectangle { text: root.description[index] color: Qt.rgba(1,1,1,1.0) anchors.centerIn: parent + font.pixelSize: pxSz - 2 Rectangle { z: -1 color: Qt.rgba(0.3, 0, 0, 0.3) @@ -258,7 +265,7 @@ Rectangle { Text { width: 180 text: root.text[index] - font.pixelSize: 24 + font.pixelSize: pxSz wrapMode: Text.WordWrap horizontalAlignment: root.horizontalAlignment LayoutMirroring.enabled: root.mirror @@ -272,6 +279,7 @@ Rectangle { text: root.description[index] color: Qt.rgba(1,1,1,1.0) anchors.centerIn: parent + font.pixelSize: pxSz - 2 Rectangle { z: -1 color: Qt.rgba(0.3, 0, 0, 0.3) @@ -291,7 +299,7 @@ Rectangle { Text { width: 180 text: "<i>" + root.text[index] + "</i>" - font.pixelSize: 24 + font.pixelSize: pxSz wrapMode: Text.WordWrap horizontalAlignment: root.horizontalAlignment LayoutMirroring.enabled: root.mirror @@ -306,6 +314,7 @@ Rectangle { text: root.description[index] color: Qt.rgba(1,1,1,1.0) anchors.centerIn: parent + font.pixelSize: pxSz - 2 Rectangle { z: -1 color: Qt.rgba(0.3, 0, 0, 0.3) @@ -325,7 +334,7 @@ Rectangle { TextEdit { width: 180 text: root.text[index] - font.pixelSize: 24 + font.pixelSize: pxSz cursorVisible: true wrapMode: TextEdit.WordWrap horizontalAlignment: root.horizontalAlignment @@ -339,6 +348,7 @@ Rectangle { text: root.description[index] color: Qt.rgba(1,1,1,1.0) anchors.centerIn: parent + font.pixelSize: pxSz - 2 Rectangle { z: -1 color: Qt.rgba(0.3, 0, 0, 0.3) @@ -358,7 +368,7 @@ Rectangle { TextEdit { width: 180 text: "<i>" + root.text[index] + "<i>" - font.pixelSize: 24 + font.pixelSize: pxSz cursorVisible: true wrapMode: TextEdit.WordWrap textFormat: TextEdit.RichText @@ -373,6 +383,7 @@ Rectangle { text: root.description[index] color: Qt.rgba(1,1,1,1.0) anchors.centerIn: parent + font.pixelSize: pxSz - 2 Rectangle { z: -1 color: Qt.rgba(0.3, 0, 0, 0.3) @@ -396,7 +407,7 @@ Rectangle { id: textInput width: 180 text: root.text[index] - font.pixelSize: 24 + font.pixelSize: pxSz cursorVisible: true horizontalAlignment: root.horizontalAlignment LayoutMirroring.enabled: root.mirror @@ -409,6 +420,7 @@ Rectangle { text: root.description[index] color: Qt.rgba(1,1,1,1.0) anchors.centerIn: parent + font.pixelSize: pxSz - 2 Rectangle { z: -1 color: Qt.rgba(0.3, 0, 0, 0.3) |