diff options
Diffstat (limited to 'examples/declarative/border-image')
-rw-r--r-- | examples/declarative/border-image/animated.qml | 55 | ||||
-rw-r--r-- | examples/declarative/border-image/borders.qml | 18 | ||||
-rw-r--r-- | examples/declarative/border-image/content/MyBorderImage.qml | 37 | ||||
-rw-r--r-- | examples/declarative/border-image/content/bw.png | bin | 0 -> 1357 bytes | |||
-rw-r--r-- | examples/declarative/border-image/content/colors-round.sci | 7 | ||||
-rw-r--r-- | examples/declarative/border-image/content/colors-stretch.sci | 5 | ||||
-rw-r--r-- | examples/declarative/border-image/content/colors.png | bin | 0 -> 1655 bytes |
7 files changed, 122 insertions, 0 deletions
diff --git a/examples/declarative/border-image/animated.qml b/examples/declarative/border-image/animated.qml new file mode 100644 index 0000000..29c02b3 --- /dev/null +++ b/examples/declarative/border-image/animated.qml @@ -0,0 +1,55 @@ +import Qt 4.6 +import "content" + +Rectangle { + id: page + color: "white" + width: 1030; height: 540 + + MyBorderImage { + x: 20; y: 20; minWidth: 120; maxWidth: 240 + minHeight: 120; maxHeight: 240 + source: "content/colors.png"; margin: 30 + } + MyBorderImage { + x: 270; y: 20; minWidth: 120; maxWidth: 240 + minHeight: 120; maxHeight: 240 + source: "content/colors.png"; margin: 30 + horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat + } + MyBorderImage { + x: 520; y: 20; minWidth: 120; maxWidth: 240 + minHeight: 120; maxHeight: 240 + source: "content/colors.png"; margin: 30 + horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat + } + MyBorderImage { + x: 770; y: 20; minWidth: 120; maxWidth: 240 + minHeight: 120; maxHeight: 240 + source: "content/colors.png"; margin: 30 + horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round + } + MyBorderImage { + x: 20; y: 280; minWidth: 60; maxWidth: 200 + minHeight: 40; maxHeight: 200 + source: "content/bw.png"; margin: 10 + } + MyBorderImage { + x: 270; y: 280; minWidth: 60; maxWidth: 200 + minHeight: 40; maxHeight: 200 + source: "content/bw.png"; margin: 10 + horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat + } + MyBorderImage { + x: 520; y: 280; minWidth: 60; maxWidth: 200 + minHeight: 40; maxHeight: 200 + source: "content/bw.png"; margin: 10 + horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat + } + MyBorderImage { + x: 770; y: 280; minWidth: 60; maxWidth: 200 + minHeight: 40; maxHeight: 200 + source: "content/bw.png"; margin: 10 + horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round + } +} diff --git a/examples/declarative/border-image/borders.qml b/examples/declarative/border-image/borders.qml new file mode 100644 index 0000000..9879416 --- /dev/null +++ b/examples/declarative/border-image/borders.qml @@ -0,0 +1,18 @@ +import Qt 4.6 + +Rectangle { + id: page + color: "white" + width: 520; height: 280 + + BorderImage { + x: 20; y: 20; width: 230; height: 240 + smooth: true + source: "content/colors-stretch.sci" + } + BorderImage { + x: 270; y: 20; width: 230; height: 240 + smooth: true + source: "content/colors-round.sci" + } +} diff --git a/examples/declarative/border-image/content/MyBorderImage.qml b/examples/declarative/border-image/content/MyBorderImage.qml new file mode 100644 index 0000000..f0c3cfc --- /dev/null +++ b/examples/declarative/border-image/content/MyBorderImage.qml @@ -0,0 +1,37 @@ +import Qt 4.6 + +Item { + property alias horizontalMode: image.horizontalTileMode + property alias verticalMode: image.verticalTileMode + property alias source: image.source + + property int minWidth + property int minHeight + property int maxWidth + property int maxHeight + property int margin + + id: container + width: 240; height: 240 + + BorderImage { + id: image; x: container.width / 2 - width / 2; y: container.height / 2 - height / 2 + + SequentialAnimation on width { + loops: Animation.Infinite + NumberAnimation { from: container.minWidth; to: container.maxWidth; duration: 2000; easing.type: "InOutQuad"} + NumberAnimation { from: container.maxWidth; to: container.minWidth; duration: 2000; easing.type: "InOutQuad" } + } + + SequentialAnimation on height { + loops: Animation.Infinite + NumberAnimation { from: container.minHeight; to: container.maxHeight; duration: 2000; easing.type: "InOutQuad"} + NumberAnimation { from: container.maxHeight; to: container.minHeight; duration: 2000; easing.type: "InOutQuad" } + } + + border.top: container.margin + border.left: container.margin + border.bottom: container.margin + border.right: container.margin + } +} diff --git a/examples/declarative/border-image/content/bw.png b/examples/declarative/border-image/content/bw.png Binary files differnew file mode 100644 index 0000000..486eaae --- /dev/null +++ b/examples/declarative/border-image/content/bw.png diff --git a/examples/declarative/border-image/content/colors-round.sci b/examples/declarative/border-image/content/colors-round.sci new file mode 100644 index 0000000..506f6f5 --- /dev/null +++ b/examples/declarative/border-image/content/colors-round.sci @@ -0,0 +1,7 @@ +border.left:30 +border.top:30 +border.right:30 +border.bottom:30 +horizontalTileRule:Round +verticalTileRule:Round +source:colors.png diff --git a/examples/declarative/border-image/content/colors-stretch.sci b/examples/declarative/border-image/content/colors-stretch.sci new file mode 100644 index 0000000..e4989a7 --- /dev/null +++ b/examples/declarative/border-image/content/colors-stretch.sci @@ -0,0 +1,5 @@ +border.left:30 +border.top:30 +border.right:30 +border.bottom:30 +source:colors.png diff --git a/examples/declarative/border-image/content/colors.png b/examples/declarative/border-image/content/colors.png Binary files differnew file mode 100644 index 0000000..dfb62f3 --- /dev/null +++ b/examples/declarative/border-image/content/colors.png |