aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/shared/LauncherList.qml
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-01-15 17:10:57 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-17 13:56:21 +0100
commit9597ef65410aedf998d157681d327f590029d47f (patch)
treeb4e10fb39a883ebae969c5f3ad5640512b5fe0f9 /examples/quick/shared/LauncherList.qml
parentc8a04f9412c1e765a98be86387fd848ca7ea6993 (diff)
Improve the look and feel of our demo launcher
The existing demo launcher looks rather ugly. This does some visual tweaks to make it look better, including adding support for proper text wrapping. It was approved by our design lead Diana. Change-Id: I660764575a411f598c53c9c42e290a807e20c0cf Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'examples/quick/shared/LauncherList.qml')
-rw-r--r--examples/quick/shared/LauncherList.qml58
1 files changed, 52 insertions, 6 deletions
diff --git a/examples/quick/shared/LauncherList.qml b/examples/quick/shared/LauncherList.qml
index 8946e9ad93..20f9c2bee1 100644
--- a/examples/quick/shared/LauncherList.qml
+++ b/examples/quick/shared/LauncherList.qml
@@ -39,9 +39,11 @@
****************************************************************************/
import QtQuick 2.0
-Item {
+Rectangle {
//model is a list of {"name":"somename", "url":"file:///some/url/mainfile.qml"}
//function used to add to model A) to enforce scheme B) to allow Qt.resolveUrl in url assignments
+
+ color: "#eee"
function addExample(name, desc, url)
{
myModel.append({"name":name, "description":desc, "url":url})
@@ -63,7 +65,7 @@ Item {
visible: false
clip: true
property url exampleUrl
- onExampleUrlChanged: visible = (exampleUrl == '' ? false : true);//Setting exampleUrl automatically shows example
+ onExampleUrlChanged: visible = (exampleUrl == '' ? false : true); //Setting exampleUrl automatically shows example
anchors.fill: parent
anchors.bottomMargin: 40
Rectangle {
@@ -88,19 +90,63 @@ Item {
anchors.bottom: parent.bottom
width: parent.width
height: 40
+
+ Rectangle {
+ height: 1
+ color: "#ccc"
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ }
+
+ Rectangle {
+ height: 1
+ color: "#fff"
+ anchors.top: parent.top
+ anchors.topMargin: 1
+ anchors.left: parent.left
+ anchors.right: parent.right
+ }
+
+ gradient: Gradient {
+ GradientStop { position: 0 ; color: "#eee" }
+ GradientStop { position: 1 ; color: "#ccc" }
+ }
+
MouseArea{
anchors.fill: parent
enabled: ei.visible
//Eats mouse events
}
+
Image {
+ id: back
source: "images/back.png"
anchors.verticalCenter: parent.verticalCenter
- x: 4
+ anchors.verticalCenterOffset: 2
+ anchors.left: parent.left
+ anchors.leftMargin: 16
+
MouseArea {
- anchors.fill: parent
- anchors.margins: -10
- onClicked: ei.exampleUrl = "";
+ id: mouse
+ hoverEnabled: true
+ anchors.centerIn: parent
+ width: 38
+ height: 31
+ anchors.verticalCenterOffset: -1
+ onClicked: ei.exampleUrl = ""
+ Rectangle {
+ anchors.fill: parent
+ opacity: mouse.pressed ? 1 : 0
+ Behavior on opacity { NumberAnimation{ duration: 100 }}
+ gradient: Gradient {
+ GradientStop { position: 0 ; color: "#22000000" }
+ GradientStop { position: 0.2 ; color: "#11000000" }
+ }
+ border.color: "darkgray"
+ antialiasing: true
+ radius: 4
+ }
}
}
}