From 014f598dd2985fdce3b8ff9ddfe311d6f3096f68 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 25 Nov 2012 19:43:17 +0100 Subject: [PATCH] setupscreen layouted properly --- data/qml/CoverFlip.qml | 4 -- data/qml/StationScene.qml | 106 +++++++++++++++++++++----------------- data/qml/StationView.qml | 13 ----- data/qml/TagCloud.qml | 31 ++++++++++- 4 files changed, 89 insertions(+), 65 deletions(-) diff --git a/data/qml/CoverFlip.qml b/data/qml/CoverFlip.qml index 9c25d61e2..4b1120776 100644 --- a/data/qml/CoverFlip.qml +++ b/data/qml/CoverFlip.qml @@ -63,8 +63,6 @@ PathView { opacity: parent.itemOpacity z: coverView.width - x - property int _origX - property int _origY property int _origZ onPlayClicked: { @@ -78,8 +76,6 @@ PathView { onContainsMouseChanged: { if (containsMouse) { - _origX = x; - _origY = y; _origZ = z; coverView.itemHovered = true } else { diff --git a/data/qml/StationScene.qml b/data/qml/StationScene.qml index 4c1342606..953362e92 100644 --- a/data/qml/StationScene.qml +++ b/data/qml/StationScene.qml @@ -48,18 +48,20 @@ Rectangle { id: stationVisualModel - Column { + Item { height: scene.height width: scene.width - - Row { - height: scene.height / 2 - width: scene.width + Grid { + anchors.fill: parent + anchors.margins: spacing spacing: width * .1 + columns: 3 + + property int rowHeight: height / 2 Item { - height: parent.height - width: (parent.width - orText.width - parent.spacing * 2 ) * 2 / 3 + height: parent.rowHeight + width: parent.width / 2 GridView { id: gridView anchors.fill: parent @@ -85,39 +87,60 @@ Rectangle { } } } - - } - - Row { - height: scene.height / 2 - width: scene.width * .9 - anchors.horizontalCenter: parent.horizontalCenter - spacing: width * .1 - - TagCloud { - height: parent.height - width: (parent.width - orText.width - parent.spacing * 2 ) * 2 / 3 - model: styleModel//generator.styles() - opacity: echonestStation.configured ? 0 : 1 - - onTagClicked: { - echonestStation.setMainControl( EchonestStation.StationTypeStyle, item ); - stationListView.incrementCurrentIndex(); - } - - Behavior on opacity { - NumberAnimation { duration: 300 } + Item { + height: parent.rowHeight + width: orText.width + Text { + id: orText + anchors.centerIn: parent + text: "or" + color: "white" } } - Text { - id: orText - text: "or" - color: "white" - anchors.verticalCenter: parent.verticalCenter + Item { + height: parent.rowHeight + width: parent.width / 4 + InputField { + anchors.centerIn: parent + width: parent.width + } } - InputField { - anchors.verticalCenter: parent.verticalCenter - width: (parent.width - orText.width - parent.spacing * 2 ) * 1 / 3 + + Item { + height: parent.rowHeight + width: parent.width / 2 + + TagCloud { + anchors.fill: parent + model: styleModel//generator.styles() + opacity: echonestStation.configured ? 0 : 1 + + onTagClicked: { + echonestStation.setMainControl( EchonestStation.StationTypeStyle, item ); + stationListView.incrementCurrentIndex(); + } + + Behavior on opacity { + NumberAnimation { duration: 300 } + } + } + } + Item { + height: parent.rowHeight + width: orText.width + Text { + text: "or" + color: "white" + anchors.verticalCenter: parent.verticalCenter + } + } + Item { + height: parent.rowHeight + width: parent.width / 4 + InputField { + anchors.centerIn: parent + width: parent.width + } } } } @@ -126,17 +149,8 @@ Rectangle { coverSize: Math.min(scene.height, scene.width) / 2 height: scene.height width: scene.width - - onConfigure: stationListView.incrementCurrentIndex(); } - - StationConfig { - height: scene.height - width: scene.width - - onDone: stationListView.decrementCurrentIndex(); - } } ListView { diff --git a/data/qml/StationView.qml b/data/qml/StationView.qml index 8ccb38f06..196bc29af 100644 --- a/data/qml/StationView.qml +++ b/data/qml/StationView.qml @@ -6,9 +6,6 @@ Item { id: root property int coverSize - signal configure() - - Item { anchors { top: parent.top; left: parent.left; bottom: parent.bottom } anchors.margins: 50 @@ -89,15 +86,5 @@ Item { } } - - Button { - id: configureButton - anchors.bottom: parent.bottom - anchors.bottomMargin: 20 - anchors.horizontalCenter: parent.horizontalCenter - text: "configure" - onClicked: root.configure(); - } - } diff --git a/data/qml/TagCloud.qml b/data/qml/TagCloud.qml index e6d81ee42..5f025bbff 100644 --- a/data/qml/TagCloud.qml +++ b/data/qml/TagCloud.qml @@ -30,18 +30,45 @@ Item { scale: itemScale Text { id: delegateText - color: "white" + color: "gray" //text: controlModel.controlAt( index ).summary text: modelData font.pointSize: 16 anchors.verticalCenter: parent.verticalCenter anchors.verticalCenterOffset: tagCloud.randomNumber(0, 15) + + states: [ + State { + name: "hovered"; when: cloudItemMouseArea.containsMouse + PropertyChanges { + target: delegateText + color: "white" + } + } + ] + transitions: [ + Transition { + from: "*" + to: "hovered" + ColorAnimation { + duration: 200 + } + }, + Transition { + from: "hovered" + to: "*" + ColorAnimation { + duration: 1000 + } + } + ] + } MouseArea { + id: cloudItemMouseArea hoverEnabled: true anchors.fill: parent onClicked: tagCloud.tagClicked( modelData ) - } Behavior on scale {