1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-09-03 02:42:52 +02:00

setupscreen layouted properly

This commit is contained in:
Michael Zanetti
2012-11-25 19:43:17 +01:00
parent 897984f2a1
commit 014f598dd2
4 changed files with 89 additions and 65 deletions

View File

@@ -63,8 +63,6 @@ PathView {
opacity: parent.itemOpacity opacity: parent.itemOpacity
z: coverView.width - x z: coverView.width - x
property int _origX
property int _origY
property int _origZ property int _origZ
onPlayClicked: { onPlayClicked: {
@@ -78,8 +76,6 @@ PathView {
onContainsMouseChanged: { onContainsMouseChanged: {
if (containsMouse) { if (containsMouse) {
_origX = x;
_origY = y;
_origZ = z; _origZ = z;
coverView.itemHovered = true coverView.itemHovered = true
} else { } else {

View File

@@ -48,18 +48,20 @@ Rectangle {
id: stationVisualModel id: stationVisualModel
Column { Item {
height: scene.height height: scene.height
width: scene.width width: scene.width
Grid {
Row { anchors.fill: parent
height: scene.height / 2 anchors.margins: spacing
width: scene.width
spacing: width * .1 spacing: width * .1
columns: 3
property int rowHeight: height / 2
Item { Item {
height: parent.height height: parent.rowHeight
width: (parent.width - orText.width - parent.spacing * 2 ) * 2 / 3 width: parent.width / 2
GridView { GridView {
id: gridView id: gridView
anchors.fill: parent anchors.fill: parent
@@ -85,39 +87,60 @@ Rectangle {
} }
} }
} }
Item {
} height: parent.rowHeight
width: orText.width
Row { Text {
height: scene.height / 2 id: orText
width: scene.width * .9 anchors.centerIn: parent
anchors.horizontalCenter: parent.horizontalCenter text: "or"
spacing: width * .1 color: "white"
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 }
} }
} }
Text { Item {
id: orText height: parent.rowHeight
text: "or" width: parent.width / 4
color: "white" InputField {
anchors.verticalCenter: parent.verticalCenter anchors.centerIn: parent
width: parent.width
}
} }
InputField {
anchors.verticalCenter: parent.verticalCenter Item {
width: (parent.width - orText.width - parent.spacing * 2 ) * 1 / 3 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 coverSize: Math.min(scene.height, scene.width) / 2
height: scene.height height: scene.height
width: scene.width width: scene.width
onConfigure: stationListView.incrementCurrentIndex();
} }
StationConfig {
height: scene.height
width: scene.width
onDone: stationListView.decrementCurrentIndex();
}
} }
ListView { ListView {

View File

@@ -6,9 +6,6 @@ Item {
id: root id: root
property int coverSize property int coverSize
signal configure()
Item { Item {
anchors { top: parent.top; left: parent.left; bottom: parent.bottom } anchors { top: parent.top; left: parent.left; bottom: parent.bottom }
anchors.margins: 50 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();
}
} }

View File

@@ -30,18 +30,45 @@ Item {
scale: itemScale scale: itemScale
Text { Text {
id: delegateText id: delegateText
color: "white" color: "gray"
//text: controlModel.controlAt( index ).summary //text: controlModel.controlAt( index ).summary
text: modelData text: modelData
font.pointSize: 16 font.pointSize: 16
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: tagCloud.randomNumber(0, 15) 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 { MouseArea {
id: cloudItemMouseArea
hoverEnabled: true hoverEnabled: true
anchors.fill: parent anchors.fill: parent
onClicked: tagCloud.tagClicked( modelData ) onClicked: tagCloud.tagClicked( modelData )
} }
Behavior on scale { Behavior on scale {