diff options
author | Lasse Räihä <lasse.raiha@digia.com> | 2013-05-03 11:09:41 +0300 |
---|---|---|
committer | Kimmo Ollila <kimmo.ollila@digia.com> | 2013-05-03 11:12:51 +0300 |
commit | 0cf25173faca7faa84b7535c0f38935abc5afb21 (patch) | |
tree | 0d67ff0f471f210d4c19e9344d1ae356f0bd2c7f | |
parent | 05d42902f7a124287d3456ef8801bd502c902b1b (diff) |
Fixed some scaling of the demos. Added Qt Blog in rssnews. Removed Quit-button from samegame-demo
Change-Id: I146dd60bb40f36452b97ab1732e8934238e41a73
Reviewed-by: Kimmo Ollila <kimmo.ollila@digia.com>
-rw-r--r-- | QtDemo/qml/QtDemo/Button.qml | 2 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/IslandElementContainer.qml | 13 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/NavigationPanel.qml | 16 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/Slide.qml | 11 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/WorldCanvas.qml | 2 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/demos/calqlatr/Calqlatr.qml | 3 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/demos/rssnews/content/RssFeeds.qml | 1 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/demos/rssnews/rssnews.qml | 4 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/demos/samegame/samegame.qml | 8 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/demos/tweetsearch/tweetsearch.qml | 3 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/main.qml | 3 |
11 files changed, 35 insertions, 31 deletions
diff --git a/QtDemo/qml/QtDemo/Button.qml b/QtDemo/qml/QtDemo/Button.qml index a4f886b..1d0216e 100644 --- a/QtDemo/qml/QtDemo/Button.qml +++ b/QtDemo/qml/QtDemo/Button.qml @@ -7,6 +7,7 @@ Rectangle { color: "transparent" property string imageSource : "" + property double rotation: 0 signal clicked() Image { @@ -15,6 +16,7 @@ Rectangle { anchors.margins: 0 source: root.imageSource opacity: 0.7 + rotation: root.rotation } MouseArea { diff --git a/QtDemo/qml/QtDemo/IslandElementContainer.qml b/QtDemo/qml/QtDemo/IslandElementContainer.qml index e0f651c..ae50f0f 100644 --- a/QtDemo/qml/QtDemo/IslandElementContainer.qml +++ b/QtDemo/qml/QtDemo/IslandElementContainer.qml @@ -9,8 +9,6 @@ Rectangle { color: "transparent" //border {width: 3; color: "red"} - onWidthChanged: print("width changed " + width) - property int place : 0 property int itemWidth : islandWidth * 0.07 property int islandWidth: 100 @@ -21,19 +19,8 @@ Rectangle { var count = Math.floor(Math.random()*2.9) var itemId = place == 2 ? Math.floor(Math.random()*2.9) : Math.floor(Math.random()*1.9); var step = place == 2 ? elementContainer.width / Math.max(count,1) : elementContainer.height / Math.max(count,1); - print("place: " + place) - print("elementContainer: " + elementContainer.width + " x " + elementContainer.height) - print("count: " + count); - print("itemId: " + itemId); - print("step: " + step); for (var i=0; i<count; i++) { - print("i: " + i) - if (place == 2) - print("posX: " + (step/2 + step*i)); - else - print("posY: " + (step/2 + step*i)); - var component = Qt.createComponent("Element.qml") if (component.status === Component.Ready) component.createObject(elementContainer, diff --git a/QtDemo/qml/QtDemo/NavigationPanel.qml b/QtDemo/qml/QtDemo/NavigationPanel.qml index fae4ffc..8ac6694 100644 --- a/QtDemo/qml/QtDemo/NavigationPanel.qml +++ b/QtDemo/qml/QtDemo/NavigationPanel.qml @@ -2,17 +2,27 @@ import QtQuick 2.0 Column{ - Button { - imageSource: "images/btn_previous.svg" - onClicked: canvas.goPrevious() + function rotateButtons(angle) + { + prevButton.rotation = angle + nextButton.rotation = angle + homeButton.rotation = angle } Button { + id: nextButton imageSource: "images/btn_next.svg" onClicked: canvas.goNext() } Button { + id: prevButton + imageSource: "images/btn_previous.svg" + onClicked: canvas.goPrevious() + } + + Button { + id: homeButton imageSource: "images/btn_home.svg" onClicked: canvas.goHome() } diff --git a/QtDemo/qml/QtDemo/Slide.qml b/QtDemo/qml/QtDemo/Slide.qml index d7f9380..b7d8b52 100644 --- a/QtDemo/qml/QtDemo/Slide.qml +++ b/QtDemo/qml/QtDemo/Slide.qml @@ -4,8 +4,8 @@ Rectangle { id: slide objectName: "slide" -// width: 867 -// height: 520 + width: 867 + height: 520 scale: 2 color: "transparent" @@ -97,8 +97,11 @@ Rectangle { } function loadDemo(){ - loadSplashScreen(); - loadTimer.start(); + if (!slide.loaded) + { + loadSplashScreen(); + loadTimer.start(); + } } function load() { diff --git a/QtDemo/qml/QtDemo/WorldCanvas.qml b/QtDemo/qml/QtDemo/WorldCanvas.qml index 4a1b5e7..9703eab 100644 --- a/QtDemo/qml/QtDemo/WorldCanvas.qml +++ b/QtDemo/qml/QtDemo/WorldCanvas.qml @@ -29,6 +29,7 @@ Item{ angle = 0; zoomInTarget = app.homeScaleFactor; + navigationPanel.rotateButtons(0); zoomAnimation.restart(); } function goTo(target) @@ -42,6 +43,7 @@ Item{ rotationOriginY = target.y; angle = -target.angle + target.targetAngle; zoomInTarget = target.targetScale; + navigationPanel.rotateButtons(target.targetAngle); } } diff --git a/QtDemo/qml/QtDemo/demos/calqlatr/Calqlatr.qml b/QtDemo/qml/QtDemo/demos/calqlatr/Calqlatr.qml index 894d0eb..7a0eb4c 100644 --- a/QtDemo/qml/QtDemo/demos/calqlatr/Calqlatr.qml +++ b/QtDemo/qml/QtDemo/demos/calqlatr/Calqlatr.qml @@ -45,8 +45,7 @@ import "content/calculator.js" as CalcEngine Rectangle { id: window - width: 320 - height: 480 + anchors.fill: parent focus: true color: "#272822" diff --git a/QtDemo/qml/QtDemo/demos/rssnews/content/RssFeeds.qml b/QtDemo/qml/QtDemo/demos/rssnews/content/RssFeeds.qml index a51b491..b4e4e8c 100644 --- a/QtDemo/qml/QtDemo/demos/rssnews/content/RssFeeds.qml +++ b/QtDemo/qml/QtDemo/demos/rssnews/content/RssFeeds.qml @@ -46,6 +46,7 @@ ListModel { ListElement { name: "Top Stories"; feed: "finance.yahoo.com/rss/topstories" } ListElement { name: "Popular Stories"; feed: "finance.yahoo.com/rss/popularstories" } + ListElement { name: "Qt Blog"; feed: "blog.qt.digia.com/feed/" } ListElement { name: "World"; feed: "rss.news.yahoo.com/rss/world" } ListElement { name: "Oceania"; feed: "rss.news.yahoo.com/rss/oceania" } ListElement { name: "U.S. National"; feed: "rss.news.yahoo.com/rss/us" } diff --git a/QtDemo/qml/QtDemo/demos/rssnews/rssnews.qml b/QtDemo/qml/QtDemo/demos/rssnews/rssnews.qml index 906577b..5aad0db 100644 --- a/QtDemo/qml/QtDemo/demos/rssnews/rssnews.qml +++ b/QtDemo/qml/QtDemo/demos/rssnews/rssnews.qml @@ -45,9 +45,9 @@ import "content" Rectangle { id: window - width: 688; height: 462 + anchors.fill: parent - property int listWidth: 220 + property int listWidth: window.width*0.35 property string currentFeed: "rss.news.yahoo.com/rss/topstories" property bool loading: feedModel.status == XmlListModel.Loading diff --git a/QtDemo/qml/QtDemo/demos/samegame/samegame.qml b/QtDemo/qml/QtDemo/demos/samegame/samegame.qml index 8712141..49eab55 100644 --- a/QtDemo/qml/QtDemo/demos/samegame/samegame.qml +++ b/QtDemo/qml/QtDemo/demos/samegame/samegame.qml @@ -46,7 +46,7 @@ import "content" Rectangle { id: root - width: 320; height: 480 + anchors.fill: parent property int acc: 0 @@ -294,20 +294,20 @@ Rectangle { source: "content/gfx/bar.png" y: parent.height - Settings.footerHeight; z: 2 - Button { + /*Button { id: quitButton height: Settings.toolButtonHeight imgSrc: "content/gfx/but-quit.png" onClicked: {Qt.quit(); } anchors { left: parent.left; verticalCenter: parent.verticalCenter; leftMargin: 11 } - } + }*/ Button { id: menuButton height: Settings.toolButtonHeight imgSrc: "content/gfx/but-menu.png" visible: (root.state == "in-game"); onClicked: {root.state = ""; Logic.cleanUp(); gameCanvas.mode = ""} - anchors { left: quitButton.right; verticalCenter: parent.verticalCenter; leftMargin: 0 } + anchors { left: parent.left; verticalCenter: parent.verticalCenter; leftMargin: 0 } } Button { id: againButton diff --git a/QtDemo/qml/QtDemo/demos/tweetsearch/tweetsearch.qml b/QtDemo/qml/QtDemo/demos/tweetsearch/tweetsearch.qml index d7e77ce..9bef779 100644 --- a/QtDemo/qml/QtDemo/demos/tweetsearch/tweetsearch.qml +++ b/QtDemo/qml/QtDemo/demos/tweetsearch/tweetsearch.qml @@ -43,8 +43,7 @@ import "content" Rectangle { id: main - width: 320 - height: 480 + anchors.fill: parent color: "#d6d6d6" property string searchTerms: "" diff --git a/QtDemo/qml/QtDemo/main.qml b/QtDemo/qml/QtDemo/main.qml index 69af48d..09adcd9 100644 --- a/QtDemo/qml/QtDemo/main.qml +++ b/QtDemo/qml/QtDemo/main.qml @@ -24,7 +24,7 @@ Rectangle{ app.homeCenterX = bbox.centerX; app.homeCenterY = bbox.centerY; app.minScaleFactor = app.homeScaleFactor / 10; - app.maxScaleFactor = app.homeScaleFactor * 10; + app.maxScaleFactor = app.homeScaleFactor * 20; Engine.updateObjectScales(app.width*0.8, app.width*0.8); //app.width, app.height); tapLimitX = Math.max(1,app.width * 0.02); tapLimitY = Math.max(1,app.height * 0.02); @@ -68,6 +68,7 @@ Rectangle{ WorldPinchArea { id: worldPinchArea } WorldCanvas { id:canvas } NavigationPanel{ + id: navigationPanel anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter anchors.rightMargin: app.width * 0.02 |