mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-09-02 10:24:01 +02:00
hooked up TagCloud again
made the input fields works
This commit is contained in:
@@ -6,8 +6,8 @@ Item {
|
||||
id: root
|
||||
|
||||
property int margins: defaultFontHeight * 2
|
||||
|
||||
property alias content: contentLoader.source
|
||||
property bool nextEnabled: false
|
||||
|
||||
signal back()
|
||||
signal next()
|
||||
@@ -34,11 +34,25 @@ Item {
|
||||
text: "<"
|
||||
height: defaultFontHeight * 4
|
||||
anchors {
|
||||
left:parent.left
|
||||
left: parent.left
|
||||
bottom: parent.bottom
|
||||
margins: root.margins
|
||||
}
|
||||
|
||||
onClicked: root.back()
|
||||
}
|
||||
|
||||
RoundedButton {
|
||||
id: nextButton
|
||||
text: ">"
|
||||
height: defaultFontHeight * 4
|
||||
visible: root.nextEnabled
|
||||
anchors {
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
margins: root.margins
|
||||
}
|
||||
|
||||
onClicked: root.next()
|
||||
}
|
||||
}
|
||||
|
@@ -11,34 +11,10 @@ Rectangle {
|
||||
ListModel {
|
||||
id: modeModel
|
||||
ListElement { label: "By Artist"; image: "../images/artist-placeholder-grid.png"; creatorContent: "stations/CreateByArtist.qml" }
|
||||
ListElement { label: "By Genre"; image: "../images/album-placeholder-grid.png"; creatorContent: "genre" }
|
||||
ListElement { label: "By Genre"; image: "../images/album-placeholder-grid.png"; creatorContent: "stations/CreateByGenre.qml" }
|
||||
ListElement { label: "By Year"; image: "image://albumart/foobar"; creatorContent: "year" }
|
||||
}
|
||||
|
||||
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" }
|
||||
}
|
||||
|
||||
VisualItemModel {
|
||||
id: stationVisualModel
|
||||
|
||||
@@ -57,6 +33,7 @@ Rectangle {
|
||||
id: stationCreator
|
||||
height: scene.height
|
||||
width: scene.width
|
||||
nextEnabled: rootView.configured
|
||||
|
||||
onBack: stationListView.decrementCurrentIndex()
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
86
data/qml/stations/CreateByGenre.qml
Normal file
86
data/qml/stations/CreateByGenre.qml
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -6,7 +6,7 @@ Rectangle {
|
||||
border.color: "black"
|
||||
border.width: 2
|
||||
|
||||
height: textInput.height + 4
|
||||
height: textInput.height * 1.2
|
||||
width: 300
|
||||
|
||||
property alias text: textInput.text
|
||||
@@ -15,7 +15,7 @@ Rectangle {
|
||||
|
||||
TextInput {
|
||||
id: textInput
|
||||
width: parent.width
|
||||
width: parent.width - defaultFontHeight
|
||||
anchors.centerIn: parent
|
||||
|
||||
onAccepted: root.accepted( text );
|
||||
|
@@ -2,15 +2,17 @@ import QtQuick 1.1
|
||||
import tomahawk 1.0
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
border.width: 4
|
||||
border.color: "white"
|
||||
border.color: enabled ? "white" : "grey"
|
||||
radius: height / 2
|
||||
color: buttonMouseArea.containsMouse ? "#22ffffff" : "black"
|
||||
color: (buttonMouseArea.containsMouse && enabled) ? "#22ffffff" : "black"
|
||||
|
||||
height: defaultFontHeight * 2
|
||||
width: height
|
||||
|
||||
property string text
|
||||
property bool enabled: true
|
||||
|
||||
signal clicked()
|
||||
|
||||
@@ -21,7 +23,7 @@ Rectangle {
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: parent.text
|
||||
color: "white"
|
||||
color: root.border.color
|
||||
font.pixelSize: parent.height * .75
|
||||
font.bold: true
|
||||
}
|
||||
@@ -29,6 +31,7 @@ Rectangle {
|
||||
id: buttonMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
enabled: root.enabled
|
||||
onClicked: parent.clicked()
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ Item {
|
||||
|
||||
property variant model: 10
|
||||
|
||||
signal tagClicked( string item )
|
||||
signal tagClicked( string tag )
|
||||
|
||||
function randomNumber(min, max) {
|
||||
var date = new Date();
|
Reference in New Issue
Block a user