mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-09-03 10:53:39 +02:00
Lots of cleanups
Add button capabilities to header make use of header in stationview
This commit is contained in:
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