mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-09-01 18:04:05 +02:00
increase delegate size and add hover effect
This commit is contained in:
@@ -32,7 +32,7 @@ Item {
|
||||
}
|
||||
|
||||
Row {
|
||||
width: defaultFontHeight * 15
|
||||
width: defaultFontHeight * 30
|
||||
height: artistInputField.height
|
||||
spacing: defaultFontHeight
|
||||
|
||||
@@ -50,9 +50,10 @@ Item {
|
||||
|
||||
ArtistView {
|
||||
height: parent.height - headerText.height - artistInputField.height
|
||||
width: defaultFontHeight * 15
|
||||
width: defaultFontHeight * 30
|
||||
model: artistChartsModel
|
||||
clip: true
|
||||
delegateHeight: defaultFontHeight * 6
|
||||
|
||||
onItemClicked: {
|
||||
mainView.startStationFromArtist(artistChartsModel.itemFromIndex(index).artistName)
|
||||
|
@@ -4,19 +4,41 @@ import tomahawk 1.0
|
||||
ListView {
|
||||
id: root
|
||||
|
||||
property int delegateHeight: defaultFontHeight * 3
|
||||
|
||||
signal itemClicked(int index)
|
||||
|
||||
delegate: Item {
|
||||
width: parent.width
|
||||
height: defaultFontHeight * 3
|
||||
height: root.delegateHeight
|
||||
|
||||
Rectangle {
|
||||
id: background
|
||||
anchors.fill: parent
|
||||
radius: defaultFontHeight / 2
|
||||
opacity: 0.5
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0.0; color: "#00FFFFFF" }
|
||||
GradientStop { position: 1.0; color: "#55FFFFFF" }
|
||||
GradientStop { position: 1.0; color: "#AAFFFFFF" }
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "hovered"; when: mouseArea.containsMouse
|
||||
PropertyChanges { target: background; opacity: 1 }
|
||||
}
|
||||
]
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "*"; to: "hovered"
|
||||
NumberAnimation { properties: "opacity"; duration: 100 }
|
||||
},
|
||||
Transition {
|
||||
from: "hovered"; to: "*"
|
||||
NumberAnimation { properties: "opacity"; duration: 600 }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Row {
|
||||
@@ -24,6 +46,7 @@ ListView {
|
||||
spacing: defaultFontHeight
|
||||
|
||||
CoverImage {
|
||||
id: coverImage
|
||||
height: parent.height
|
||||
width: height
|
||||
showLabels: false
|
||||
@@ -33,12 +56,16 @@ ListView {
|
||||
text: model.artistName
|
||||
color: "white"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.width - coverImage.width - parent.spacing
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
onClicked: root.itemClicked(index)
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user