diff options
Diffstat (limited to 'demos')
-rw-r--r-- | demos/declarative/flickr/mobile/TitleBar.qml | 2 | ||||
-rw-r--r-- | demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml | 2 | ||||
-rw-r--r-- | demos/declarative/samegame/SamegameCore/Dialog.qml | 5 | ||||
-rw-r--r-- | demos/declarative/samegame/samegame.qml | 20 | ||||
-rw-r--r-- | demos/declarative/snake/content/HighScoreModel.qml | 2 | ||||
-rw-r--r-- | demos/declarative/snake/content/snake.js | 1 | ||||
-rw-r--r-- | demos/declarative/snake/snake.qml | 12 | ||||
-rw-r--r-- | demos/declarative/twitter/TwitterCore/HomeTitleBar.qml | 2 | ||||
-rw-r--r-- | demos/declarative/twitter/TwitterCore/TitleBar.qml | 2 | ||||
-rw-r--r-- | demos/declarative/twitter/twitter.qml | 5 | ||||
-rw-r--r-- | demos/declarative/webbrowser/content/Button.qml | 10 | ||||
-rw-r--r-- | demos/declarative/webbrowser/content/Header.qml | 22 | ||||
-rw-r--r-- | demos/declarative/webbrowser/content/UrlInput.qml | 11 | ||||
-rw-r--r-- | demos/declarative/webbrowser/content/pics/go-jump-locationbar.png | bin | 0 -> 714 bytes | |||
-rw-r--r-- | demos/declarative/webbrowser/webbrowser.qml | 1 |
15 files changed, 80 insertions, 17 deletions
diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml index da144d4..c7e1a53 100644 --- a/demos/declarative/flickr/mobile/TitleBar.qml +++ b/demos/declarative/flickr/mobile/TitleBar.qml @@ -118,7 +118,7 @@ Item { name: "Tags" PropertyChanges { target: container; x: -tagButton.x + 5 } PropertyChanges { target: tagButton; text: "OK" } - PropertyChanges { target: lineEdit; focus: true } + PropertyChanges { target: editor; focus: true } } transitions: Transition { diff --git a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml index e15adbc..6109535 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml @@ -77,6 +77,6 @@ Item { MouseArea { anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 } - onClicked: textInput.forceFocus() + onClicked: { textInput.forceFocus(); textInput.openSoftwareInputPanel(); } } } diff --git a/demos/declarative/samegame/SamegameCore/Dialog.qml b/demos/declarative/samegame/SamegameCore/Dialog.qml index 8dd12f6..c71a4b3 100644 --- a/demos/declarative/samegame/SamegameCore/Dialog.qml +++ b/demos/declarative/samegame/SamegameCore/Dialog.qml @@ -47,13 +47,14 @@ Rectangle { property Item text: dialogText signal closed - + signal opened function forceClose() { page.closed(); page.opacity = 0; } function show(txt) { + page.opened(); dialogText.text = txt; page.opacity = 1; } @@ -62,7 +63,7 @@ Rectangle { color: "white" border.width: 1 opacity: 0 - + visible: opacity > 0 Behavior on opacity { NumberAnimation { duration: 1000 } } diff --git a/demos/declarative/samegame/samegame.qml b/demos/declarative/samegame/samegame.qml index 54c18d6..9a721da 100644 --- a/demos/declarative/samegame/samegame.qml +++ b/demos/declarative/samegame/samegame.qml @@ -90,17 +90,31 @@ Rectangle { enabled: initialWidth != 0 } + onOpened: nameInputText.focus = true; + onClosed: { + nameInputText.focus = false; + if (nameInputText.text != "") + Logic.saveHighScore(nameInputText.text); + } Text { id: dialogText anchors { left: nameInputDialog.left; leftMargin: 20; verticalCenter: parent.verticalCenter } text: "You won! Please enter your name: " } + MouseArea { + anchors.fill: parent + onClicked: { + if (nameInputText.text == "") + nameInputText.openSoftwareInputPanel(); + else + nameInputDialog.forceClose(); + } + } TextInput { id: nameInputText anchors { verticalCenter: parent.verticalCenter; left: dialogText.right } - focus: true - + focus: false onTextChanged: { var newWidth = nameInputText.width + dialogText.width + 40; if ( (newWidth > nameInputDialog.width && newWidth < screen.width) @@ -108,8 +122,6 @@ Rectangle { nameInputDialog.width = newWidth; } onAccepted: { - if (nameInputDialog.opacity == 1 && nameInputText.text != "") - Logic.saveHighScore(nameInputText.text); nameInputDialog.forceClose(); } } diff --git a/demos/declarative/snake/content/HighScoreModel.qml b/demos/declarative/snake/content/HighScoreModel.qml index 99799c8..42482f8 100644 --- a/demos/declarative/snake/content/HighScoreModel.qml +++ b/demos/declarative/snake/content/HighScoreModel.qml @@ -106,7 +106,7 @@ ListModel { } if (rs.rows.length > maxScores) tx.executeSql("DELETE FROM HighScores WHERE game=? AND score <= ?", - [rs.rows.item(maxScores).score]); + [game, rs.rows.item(maxScores).score]); } } ) diff --git a/demos/declarative/snake/content/snake.js b/demos/declarative/snake/content/snake.js index 6f78b33..4d05e33 100644 --- a/demos/declarative/snake/content/snake.js +++ b/demos/declarative/snake/content/snake.js @@ -37,6 +37,7 @@ function startNewGame() startNewGameTimer.running = true; return; } + numRows = numRowsAvailable; numColumns = numColumnsAvailable; board = new Array(numRows * numColumns); diff --git a/demos/declarative/snake/snake.qml b/demos/declarative/snake/snake.qml index 565e92c..46114f5 100644 --- a/demos/declarative/snake/snake.qml +++ b/demos/declarative/snake/snake.qml @@ -86,7 +86,7 @@ Rectangle { onTriggered: { Logic.moveSkull() } } Timer { - + id: startNewGameTimer; interval: 700; onTriggered: { Logic.startNewGame(); } } @@ -177,7 +177,6 @@ Rectangle { id: progressIndicator color: "#221edd"; width: 0; - Behavior on width { NumberAnimation { duration: startHeartbeatTimer.running ? 1000 : 0}} height: 30; } } @@ -227,4 +226,13 @@ Rectangle { } ] + transitions: [ + Transition { + from: "*" + to: "starting" + NumberAnimation { target: progressIndicator; property: "width"; duration: 1000 } + + } + ] + } diff --git a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml index 3828a40..52164ed 100644 --- a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml @@ -148,7 +148,7 @@ Item { PropertyChanges { target: tagButton; text: "OK" } PropertyChanges { target: tagButton; width: 28 } PropertyChanges { target: tagButton; height: 24 } - PropertyChanges { target: txtEdit; focus: true } + PropertyChanges { target: editor; focus: true } } ] transitions: [ diff --git a/demos/declarative/twitter/TwitterCore/TitleBar.qml b/demos/declarative/twitter/TwitterCore/TitleBar.qml index 0cf79a3..6cd0a50 100644 --- a/demos/declarative/twitter/TwitterCore/TitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/TitleBar.qml @@ -107,7 +107,7 @@ Item { name: "Tags" PropertyChanges { target: container; x: -tagButton.x + 5 } PropertyChanges { target: tagButton; text: "OK" } - PropertyChanges { target: lineEdit; focus: true } + PropertyChanges { target: editor; focus: true } } transitions: Transition { diff --git a/demos/declarative/twitter/twitter.qml b/demos/declarative/twitter/twitter.qml index aa216cc..08cecb0 100644 --- a/demos/declarative/twitter/twitter.qml +++ b/demos/declarative/twitter/twitter.qml @@ -70,6 +70,11 @@ Item { Image { source: "TwitterCore/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 } + MouseArea { + anchors.fill: parent + onClicked: screen.focus = false; + } + Twitter.RssModel { id: rssModel } Twitter.Loading { anchors.centerIn: parent; visible: rssModel.status==XmlListModel.Loading && state!='unauthed'} Text { diff --git a/demos/declarative/webbrowser/content/Button.qml b/demos/declarative/webbrowser/content/Button.qml index 4642cc7..2a2e7ef 100644 --- a/demos/declarative/webbrowser/content/Button.qml +++ b/demos/declarative/webbrowser/content/Button.qml @@ -45,15 +45,21 @@ Item { property alias image: icon.source property variant action + signal clicked + width: 40; height: parent.height Image { id: icon; anchors.centerIn: parent - opacity: if(action != undefined) {action.enabled ? 1.0 : 0.4} else 0 + opacity: if (action != undefined) { action.enabled ? 1.0 : 0.4 } else 1 } MouseArea { anchors { fill: parent; topMargin: -10; bottomMargin: -10 } - onClicked: action.trigger() + onClicked: { + if (action != undefined) + action.trigger() + parent.clicked() + } } } diff --git a/demos/declarative/webbrowser/content/Header.qml b/demos/declarative/webbrowser/content/Header.qml index 2c9d0fb..5abf440 100644 --- a/demos/declarative/webbrowser/content/Header.qml +++ b/demos/declarative/webbrowser/content/Header.qml @@ -42,7 +42,10 @@ import Qt 4.7 Image { + id: header + property alias editUrl: urlInput.url + property bool urlChanged: false source: "pics/titlebar-bg.png"; fillMode: Image.TileHorizontally @@ -91,19 +94,34 @@ Image { onUrlEntered: { webBrowser.urlString = url webBrowser.focus = true + header.urlChanged = false } + onUrlChanged: header.urlChanged = true } Button { id: reloadButton anchors { right: parent.right; rightMargin: 4 } - action: webView.reload; image: "pics/view-refresh.png"; visible: webView.progress == 1.0 + action: webView.reload; image: "pics/view-refresh.png" + visible: webView.progress == 1.0 && !header.urlChanged } Button { id: stopButton anchors { right: parent.right; rightMargin: 4 } - action: webView.stop; image: "pics/edit-delete.png"; visible: webView.progress < 1.0 + action: webView.stop; image: "pics/edit-delete.png" + visible: webView.progress < 1.0 && !header.urlChanged + } + + Button { + id: goButton + anchors { right: parent.right; rightMargin: 4 } + onClicked: { + webBrowser.urlString = urlInput.url + webBrowser.focus = true + header.urlChanged = false + } + image: "pics/go-jump-locationbar.png"; visible: header.urlChanged } } } diff --git a/demos/declarative/webbrowser/content/UrlInput.qml b/demos/declarative/webbrowser/content/UrlInput.qml index 9ea1904..9992456 100644 --- a/demos/declarative/webbrowser/content/UrlInput.qml +++ b/demos/declarative/webbrowser/content/UrlInput.qml @@ -48,6 +48,7 @@ Item { property alias url: urlText.text signal urlEntered(string url) + signal urlChanged width: parent.height; height: parent.height @@ -69,14 +70,24 @@ Item { id: urlText horizontalAlignment: TextEdit.AlignLeft font.pixelSize: 14; focusOnPress: true + + onTextChanged: container.urlChanged() + Keys.onEscapePressed: { urlText.text = webView.url webView.focus = true } + + Keys.onEnterPressed: { + container.urlEntered(urlText.text) + webView.focus = true + } + Keys.onReturnPressed: { container.urlEntered(urlText.text) webView.focus = true } + anchors { left: parent.left; right: parent.right; leftMargin: 18; rightMargin: 18 verticalCenter: parent.verticalCenter diff --git a/demos/declarative/webbrowser/content/pics/go-jump-locationbar.png b/demos/declarative/webbrowser/content/pics/go-jump-locationbar.png Binary files differnew file mode 100644 index 0000000..636fe38 --- /dev/null +++ b/demos/declarative/webbrowser/content/pics/go-jump-locationbar.png diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml index a923c92..53ba6da 100644 --- a/demos/declarative/webbrowser/webbrowser.qml +++ b/demos/declarative/webbrowser/webbrowser.qml @@ -55,6 +55,7 @@ Rectangle { FlickableWebView { id: webView url: webBrowser.urlString + onProgressChanged: header.urlChanged = false anchors { top: headerSpace.bottom; left: parent.left; right: parent.right; bottom: parent.bottom } } |