aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/text/fonts
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2012-03-02 14:30:51 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-09 11:03:23 +0100
commit4b56661fd27cf6ce0c9410759fbd5c390e41dd69 (patch)
treedc27d3cd25f308100d8176d371a3748f2abbf65e /examples/quick/text/fonts
parent356bdc098d6f120003db227416c788bd9d51048d (diff)
Update text examples to new guidelines
Change-Id: I6bbf414f3734bc2f29a7182746c5df158a5924da Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
Diffstat (limited to 'examples/quick/text/fonts')
-rw-r--r--examples/quick/text/fonts/availableFonts.qml4
-rw-r--r--examples/quick/text/fonts/banner.qml2
-rw-r--r--examples/quick/text/fonts/fonts.qml30
-rw-r--r--examples/quick/text/fonts/hello.qml6
4 files changed, 22 insertions, 20 deletions
diff --git a/examples/quick/text/fonts/availableFonts.qml b/examples/quick/text/fonts/availableFonts.qml
index 0b87259556..63a74d269b 100644
--- a/examples/quick/text/fonts/availableFonts.qml
+++ b/examples/quick/text/fonts/availableFonts.qml
@@ -41,7 +41,7 @@
import QtQuick 2.0
Rectangle {
- width: 480; height: 640; color: "steelblue"
+ width: 320; height: 480; color: "steelblue"
ListView {
anchors.fill: parent; model: Qt.fontFamilies()
@@ -50,7 +50,7 @@ Rectangle {
height: 40; width: ListView.view.width
Text {
anchors.centerIn: parent
- text: modelData; font.family: modelData; font.pixelSize: 24; color: "white"
+ text: modelData; font.family: modelData; font.pixelSize: 20; color: "white"
}
}
}
diff --git a/examples/quick/text/fonts/banner.qml b/examples/quick/text/fonts/banner.qml
index 6c9aa25fa1..7f690c24c3 100644
--- a/examples/quick/text/fonts/banner.qml
+++ b/examples/quick/text/fonts/banner.qml
@@ -47,7 +47,7 @@ Rectangle {
property color textColor: "lightsteelblue"
property string text: "Hello world! "
- width: 640; height: 320
+ width: 320; height: 480
color: "steelblue"
Row {
diff --git a/examples/quick/text/fonts/fonts.qml b/examples/quick/text/fonts/fonts.qml
index 78cef25eae..f0e9b60bc5 100644
--- a/examples/quick/text/fonts/fonts.qml
+++ b/examples/quick/text/fonts/fonts.qml
@@ -43,7 +43,7 @@ import QtQuick 2.0
Rectangle {
property string myText: "The quick brown fox jumps over the lazy dog."
- width: 800; height: 480
+ width: 320; height: 480
color: "steelblue"
FontLoader { id: fixedFont; name: "Courier" }
@@ -51,43 +51,45 @@ Rectangle {
FontLoader { id: webFont; source: "http://www.princexml.com/fonts/steffmann/Starburst.ttf" }
Column {
- anchors { fill: parent; leftMargin: 10; rightMargin: 10 }
+ anchors { fill: parent; leftMargin: 10; rightMargin: 10; topMargin: 10 }
spacing: 15
Text {
text: myText
color: "lightsteelblue"
width: parent.width
- elide: Text.ElideRight
- font.family: "Times"; font.pointSize: 42
+ wrapMode: Text.WordWrap
+ font.family: "Times"; font.pixelSize: 20
}
Text {
text: myText
color: "lightsteelblue"
width: parent.width
- elide: Text.ElideLeft
- font { family: "Times"; pointSize: 42; capitalization: Font.AllUppercase }
+ wrapMode: Text.WordWrap
+ horizontalAlignment: Text.AlignHCenter
+ font { family: "Times"; pixelSize: 20; capitalization: Font.AllUppercase }
}
Text {
text: myText
color: "lightsteelblue"
width: parent.width
- elide: Text.ElideMiddle
- font { family: fixedFont.name; pointSize: 42; weight: Font.Bold; capitalization: Font.AllLowercase }
+ horizontalAlignment: Text.AlignRight
+ wrapMode: Text.WordWrap
+ font { family: fixedFont.name; pixelSize: 20; weight: Font.Bold; capitalization: Font.AllLowercase }
}
Text {
text: myText
color: "lightsteelblue"
width: parent.width
- elide: Text.ElideRight
- font { family: fixedFont.name; pointSize: 42; italic: true; capitalization: Font.SmallCaps }
+ wrapMode: Text.WordWrap
+ font { family: fixedFont.name; pixelSize: 20; italic: true; capitalization: Font.SmallCaps }
}
Text {
text: myText
color: "lightsteelblue"
width: parent.width
- elide: Text.ElideLeft
- font { family: localFont.name; pointSize: 42; capitalization: Font.Capitalize }
+ wrapMode: Text.WordWrap
+ font { family: localFont.name; pixelSize: 20; capitalization: Font.Capitalize }
}
Text {
text: {
@@ -97,8 +99,8 @@ Rectangle {
}
color: "lightsteelblue"
width: parent.width
- elide: Text.ElideMiddle
- font.family: webFont.name; font.pointSize: 42
+ wrapMode: Text.WordWrap
+ font.family: webFont.name; font.pixelSize: 20
}
}
}
diff --git a/examples/quick/text/fonts/hello.qml b/examples/quick/text/fonts/hello.qml
index d9479fb208..8920329ddb 100644
--- a/examples/quick/text/fonts/hello.qml
+++ b/examples/quick/text/fonts/hello.qml
@@ -43,7 +43,7 @@ import QtQuick 2.0
Rectangle {
id: screen
- width: 800; height: 480
+ width: 320; height: 480
color: "black"
Item {
@@ -55,12 +55,12 @@ Rectangle {
anchors.centerIn: parent
color: "white"
text: "Hello world!"
- font.pixelSize: 60
+ font.pixelSize: 32
smooth: true
SequentialAnimation on font.letterSpacing {
loops: Animation.Infinite;
- NumberAnimation { from: 0; to: 150; easing.type: Easing.InQuad; duration: 3000 }
+ NumberAnimation { from: 0; to: 50; easing.type: Easing.InQuad; duration: 3000 }
ScriptAction {
script: {
container.y = (screen.height / 4) + (Math.random() * screen.height / 2)