mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-28 16:20:01 +02:00
some more work on stations merged
This commit is contained in:
@@ -6,11 +6,11 @@ Item {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
|
||||
signal done()
|
||||
signal done(string text)
|
||||
|
||||
function createStation(artist) {
|
||||
mainView.startStationFromArtist(artist)
|
||||
root.done()
|
||||
root.done(artist)
|
||||
}
|
||||
|
||||
Column {
|
||||
|
@@ -6,11 +6,11 @@ Item {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
|
||||
signal done()
|
||||
signal done(string text)
|
||||
|
||||
function createStation(genre) {
|
||||
mainView.startStationFromGenre(genre)
|
||||
root.done()
|
||||
root.done(genre)
|
||||
}
|
||||
|
||||
ListModel {
|
||||
|
79
data/qml/stations/CreateByYear.qml
Normal file
79
data/qml/stations/CreateByYear.qml
Normal file
@@ -0,0 +1,79 @@
|
||||
import QtQuick 1.1
|
||||
import tomahawk 1.0
|
||||
import "../tomahawkimports"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
|
||||
signal done(string text)
|
||||
|
||||
function createStation(artist) {
|
||||
mainView.startStationFromArtist(artist)
|
||||
root.done(artist)
|
||||
}
|
||||
|
||||
Column {
|
||||
id: upperColumn
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
height: parent.height
|
||||
width: defaultFontHeight * 30
|
||||
anchors.bottomMargin: defaultFontHeight
|
||||
spacing: defaultFontHeight
|
||||
|
||||
HeaderLabel {
|
||||
id: headerText
|
||||
text: "Create station by year..."
|
||||
}
|
||||
|
||||
Row {
|
||||
height: artistInputField.height
|
||||
width: parent.width
|
||||
spacing: defaultFontHeight * 0.5
|
||||
|
||||
InputField {
|
||||
id: artistInputField
|
||||
width: parent.width - createFromInputButton.width - parent.spacing
|
||||
|
||||
onAccepted: createStation(text)
|
||||
}
|
||||
|
||||
PushButton {
|
||||
id: createFromInputButton
|
||||
text: "Go!"
|
||||
enabled: artistInputField.text.length > 2
|
||||
onClicked: createStation(artistInputField.text)
|
||||
}
|
||||
}
|
||||
|
||||
// Item {
|
||||
// height: parent.height - headerText.height - artistInputField.height - parent.spacing * 3
|
||||
// width: parent.width
|
||||
// ArtistView {
|
||||
// id: artistView
|
||||
// height: parent.height
|
||||
// width: parent.width
|
||||
// model: artistChartsModel
|
||||
// clip: true
|
||||
// delegateHeight: defaultFontHeight * 6
|
||||
|
||||
// onItemClicked: {
|
||||
// createStation(artistChartsModel.itemFromIndex(index).artistName);
|
||||
// }
|
||||
// }
|
||||
// ScrollBar {
|
||||
// listView: artistView
|
||||
// }
|
||||
// }
|
||||
|
||||
DoubleSlider {
|
||||
width: parent.width
|
||||
height: defaultFontHeight * 2
|
||||
min: 1960
|
||||
max: new Date().getFullYear()
|
||||
lowerSliderPos: 1990
|
||||
upperSliderPos: 2010
|
||||
minMaxLabelsVisible: false
|
||||
}
|
||||
}
|
||||
}
|
@@ -8,7 +8,7 @@ Item {
|
||||
property int margins: defaultFontHeight * 2
|
||||
property alias content: contentLoader.source
|
||||
|
||||
signal next()
|
||||
signal next(string text)
|
||||
|
||||
Loader {
|
||||
id: contentLoader
|
||||
@@ -19,7 +19,7 @@ Item {
|
||||
Connections {
|
||||
target: contentLoader.item
|
||||
|
||||
onDone: root.next()
|
||||
onDone: root.next(text)
|
||||
}
|
||||
|
||||
}
|
||||
|
73
data/qml/stations/StationItem.qml
Normal file
73
data/qml/stations/StationItem.qml
Normal file
@@ -0,0 +1,73 @@
|
||||
import QtQuick 1.1
|
||||
import tomahawk 1.0
|
||||
import "../tomahawkimports"
|
||||
|
||||
Item {
|
||||
id: stationItem
|
||||
|
||||
CoverFlip {
|
||||
id: coverView
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
height: parent.height
|
||||
width: parent.width
|
||||
interactive: false
|
||||
|
||||
backgroundColor: scene.color
|
||||
|
||||
model: dynamicModel
|
||||
currentIndex: currentlyPlayedIndex
|
||||
|
||||
onItemPlayPauseClicked: {
|
||||
mainView.playItem(index)
|
||||
}
|
||||
|
||||
onItemClicked: {
|
||||
mainView.playItem(index)
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "empty"; when: mainView.loading
|
||||
PropertyChanges {
|
||||
target: coverView
|
||||
anchors.rightMargin: -coverView.width
|
||||
anchors.topMargin: - coverView.height
|
||||
scale: 0
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "empty"
|
||||
to: "*"
|
||||
NumberAnimation {
|
||||
properties: "anchors.topMargin,anchors.rightMargin,scale"
|
||||
duration: 1000
|
||||
easing.type: Easing.OutQuad
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
// Behavior on anchors.topMargin {
|
||||
// NumberAnimation { duration: 500 }
|
||||
// }
|
||||
// Behavior on anchors.rightMargin {
|
||||
// NumberAnimation { duration: 500 }
|
||||
// }
|
||||
// Behavior on scale {
|
||||
// NumberAnimation { duration: 500 }
|
||||
// }
|
||||
|
||||
}
|
||||
BusyIndicator {
|
||||
id: busyIndicator
|
||||
anchors.centerIn: parent
|
||||
height: defaultFontHeight * 4
|
||||
width: height
|
||||
|
||||
opacity: mainView.loading ? 1 : 0
|
||||
running: mainView.loading
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user