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

hooked up TagCloud again

made the input fields works
This commit is contained in:
Michael Zanetti
2012-12-02 22:51:47 +01:00
parent 3f7f1df61f
commit af05ce243d
10 changed files with 134 additions and 46 deletions

View File

@@ -8,16 +8,9 @@ Item {
signal done()
ListModel {
id: dummyArtistModel
ListElement { modelData: "Pink Floyd" }
ListElement { modelData: "Tool" }
ListElement { modelData: "Cake" }
ListElement { modelData: "Metallica" }
ListElement { modelData: "Red Hot Chili Peppers" }
ListElement { modelData: "Korn" }
ListElement { modelData: "Prodigy" }
ListElement { modelData: "Otto Waalkes" }
function createStation(artist) {
mainView.startStationFromArtist(artist)
root.done()
}
Column {
@@ -39,12 +32,16 @@ Item {
InputField {
id: artistInputField
width: parent.width - createFromInputButton.width - parent.spacing
onAccepted: createStation(text)
}
RoundedButton {
id: createFromInputButton
text: ">"
height: artistInputField.height
enabled: artistInputField.text.length > 2
onClicked: createStation(artistInputField.text)
}
}
@@ -56,8 +53,7 @@ Item {
delegateHeight: defaultFontHeight * 6
onItemClicked: {
mainView.startStationFromArtist(artistChartsModel.itemFromIndex(index).artistName)
root.done()
createStation(artistChartsModel.itemFromIndex(index).artistName);
}
}
}

View File

@@ -0,0 +1,86 @@
import QtQuick 1.1
import tomahawk 1.0
import "../tomahawkimports"
Item {
id: root
anchors.fill: parent
signal done()
function createStation(genre) {
mainView.startStationFromArtist(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
text: "Create station by genre..."
}
Row {
width: defaultFontHeight * 30
height: artistInputField.height
spacing: defaultFontHeight
InputField {
id: genreInputField
width: parent.width - createFromInputButton.width - parent.spacing
onAccepted: createStation(text);
}
RoundedButton {
id: createFromInputButton
text: ">"
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);
}
}
}
}
}