mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-16 11:04:01 +02:00
* Imported QML resources.
This commit is contained in:
committed by
Michael Zanetti
parent
09c272a07c
commit
17eeae9a8f
69
data/qml/stations/CreateByArtist.qml
Normal file
69
data/qml/stations/CreateByArtist.qml
Normal file
@@ -0,0 +1,69 @@
|
||||
import QtQuick 1.1
|
||||
import tomahawk 1.0
|
||||
import "../tomahawkimports"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
|
||||
signal done()
|
||||
|
||||
function createStation(artist) {
|
||||
mainView.startStationFromArtist(artist)
|
||||
root.done()
|
||||
}
|
||||
|
||||
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 artist..."
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
88
data/qml/stations/CreateByGenre.qml
Normal file
88
data/qml/stations/CreateByGenre.qml
Normal file
@@ -0,0 +1,88 @@
|
||||
import QtQuick 1.1
|
||||
import tomahawk 1.0
|
||||
import "../tomahawkimports"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
|
||||
signal done()
|
||||
|
||||
function createStation(genre) {
|
||||
mainView.startStationFromGenre(genre)
|
||||
root.done()
|
||||
}
|
||||
|
||||
ListModel {
|
||||
id: styleModel
|
||||
ListElement { modelData: "acoustic" }
|
||||
ListElement { modelData: "alternative" }
|
||||
ListElement { modelData: "alternative rock" }
|
||||
ListElement { modelData: "classic" }
|
||||
ListElement { modelData: "folk" }
|
||||
ListElement { modelData: "indie" }
|
||||
ListElement { modelData: "pop" }
|
||||
ListElement { modelData: "rock" }
|
||||
ListElement { modelData: "hip-hop" }
|
||||
ListElement { modelData: "punk" }
|
||||
ListElement { modelData: "grunge" }
|
||||
ListElement { modelData: "indie" }
|
||||
ListElement { modelData: "electronic" }
|
||||
ListElement { modelData: "country" }
|
||||
ListElement { modelData: "jazz" }
|
||||
ListElement { modelData: "psychodelic" }
|
||||
ListElement { modelData: "soundtrack" }
|
||||
ListElement { modelData: "reggae" }
|
||||
ListElement { modelData: "house" }
|
||||
ListElement { modelData: "drum and base" }
|
||||
}
|
||||
|
||||
Column {
|
||||
id: upperColumn
|
||||
anchors.fill: parent
|
||||
anchors.bottomMargin: defaultFontHeight
|
||||
spacing: defaultFontHeight
|
||||
|
||||
HeaderLabel {
|
||||
id: headerText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: "Create station by genre..."
|
||||
}
|
||||
|
||||
Row {
|
||||
width: defaultFontHeight * 30
|
||||
height: genreInputField.height
|
||||
spacing: defaultFontHeight * 0.5
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
InputField {
|
||||
id: genreInputField
|
||||
width: parent.width - createFromInputButton.width - parent.spacing
|
||||
|
||||
onAccepted: createStation(text);
|
||||
}
|
||||
|
||||
PushButton {
|
||||
id: createFromInputButton
|
||||
text: "Go!"
|
||||
height: genreInputField.height
|
||||
enabled: genreInputField.text.length > 2
|
||||
onClicked: createStation(genreInputField.text)
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
height: parent.height - headerText.height - genreInputField.height
|
||||
width: parent.width
|
||||
TagCloud {
|
||||
anchors.fill: parent
|
||||
anchors.margins: parent.width / 6
|
||||
model: styleModel
|
||||
|
||||
onTagClicked: {
|
||||
root.createStation(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
79
data/qml/stations/StationConfig.qml
Normal file
79
data/qml/stations/StationConfig.qml
Normal file
@@ -0,0 +1,79 @@
|
||||
import QtQuick 1.1
|
||||
import tomahawk 1.0
|
||||
import "tomahawkimports"
|
||||
|
||||
Item {
|
||||
id: fineTuneView
|
||||
|
||||
property color textColor: "white"
|
||||
|
||||
signal done();
|
||||
|
||||
Grid {
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.margins: 50
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: scene.width / 2
|
||||
spacing: 50
|
||||
columns: 2
|
||||
|
||||
Text {
|
||||
color: fineTuneView.textColor
|
||||
text: "Name:"
|
||||
|
||||
}
|
||||
InputField {
|
||||
text: echonestStation.name
|
||||
|
||||
onAccepted: {
|
||||
print("text changed!!!")
|
||||
echonestStation.name = text;
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: tempoText
|
||||
text: "Tempo:"
|
||||
color: "white"
|
||||
}
|
||||
DoubleSlider {
|
||||
width: 500
|
||||
height: tempoText.height
|
||||
min: 0
|
||||
max: 500
|
||||
lowerSliderPos: echonestStation.minTempo
|
||||
upperSliderPos: echonestStation.maxTempo
|
||||
onValueChanged: echonestStation.setTempo( lowerSliderPos, upperSliderPos )
|
||||
}
|
||||
|
||||
Text {
|
||||
id: hotnessText
|
||||
text: "Hotness:"
|
||||
color: "white"
|
||||
}
|
||||
DoubleSlider {
|
||||
width: 500
|
||||
height: hotnessText.height
|
||||
min: 0
|
||||
max: 100
|
||||
minLabel: "Less"
|
||||
maxLabel: "More"
|
||||
showFloatingLabel: false
|
||||
lowerSliderPos: echonestStation.minHotttness * 100
|
||||
upperSliderPos: echonestStation.maxHotttness * 100
|
||||
onValueChanged: echonestStation.setHotttness( 1.0 * lowerSliderPos / 100, 1.0 * upperSliderPos / 100 )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Button {
|
||||
id: configureButton
|
||||
onClicked: fineTuneView.done();
|
||||
text: "configure"
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 20
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
}
|
64
data/qml/stations/StationCreatorPage1.qml
Normal file
64
data/qml/stations/StationCreatorPage1.qml
Normal file
@@ -0,0 +1,64 @@
|
||||
import QtQuick 1.1
|
||||
import tomahawk 1.0
|
||||
import "../tomahawkimports"
|
||||
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property alias model: gridView.model
|
||||
property int spacing: 10
|
||||
|
||||
signal itemClicked(int index)
|
||||
|
||||
GridView {
|
||||
id: gridView
|
||||
anchors.centerIn: parent
|
||||
width: root.width * 9 / 10
|
||||
height: cellHeight
|
||||
|
||||
cellWidth: (width - 1) / 3
|
||||
cellHeight: cellWidth //* 10 / 16
|
||||
|
||||
delegate: Image {
|
||||
width: gridView.cellWidth - root.spacing
|
||||
height: gridView.cellHeight - root.spacing
|
||||
source: image
|
||||
smooth: true
|
||||
|
||||
Rectangle {
|
||||
id: textBackground
|
||||
anchors {
|
||||
left: parent.left
|
||||
bottom: parent.bottom
|
||||
right: parent.right
|
||||
}
|
||||
height: parent.height / 5
|
||||
color: "black"
|
||||
opacity: .5
|
||||
|
||||
}
|
||||
Text {
|
||||
anchors.centerIn: textBackground
|
||||
text: label
|
||||
color: "white"
|
||||
font.bold: true
|
||||
}
|
||||
Rectangle {
|
||||
id: hoverShade
|
||||
anchors.fill: parent
|
||||
color: "white"
|
||||
opacity: mouseArea.containsMouse ? .2 : 0
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation { easing.type: Easing.Linear; duration: 300 }
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: root.itemClicked(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
25
data/qml/stations/StationCreatorPage2.qml
Normal file
25
data/qml/stations/StationCreatorPage2.qml
Normal file
@@ -0,0 +1,25 @@
|
||||
import QtQuick 1.1
|
||||
import tomahawk 1.0
|
||||
import "../tomahawkimports"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property int margins: defaultFontHeight * 2
|
||||
property alias content: contentLoader.source
|
||||
|
||||
signal next()
|
||||
|
||||
Loader {
|
||||
id: contentLoader
|
||||
anchors.fill: parent
|
||||
anchors.margins: root.margins
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: contentLoader.item
|
||||
|
||||
onDone: root.next()
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user