mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-09-02 02:12:47 +02:00
increase delegate size and add hover effect
This commit is contained in:
@@ -32,7 +32,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
width: defaultFontHeight * 15
|
width: defaultFontHeight * 30
|
||||||
height: artistInputField.height
|
height: artistInputField.height
|
||||||
spacing: defaultFontHeight
|
spacing: defaultFontHeight
|
||||||
|
|
||||||
@@ -50,9 +50,10 @@ Item {
|
|||||||
|
|
||||||
ArtistView {
|
ArtistView {
|
||||||
height: parent.height - headerText.height - artistInputField.height
|
height: parent.height - headerText.height - artistInputField.height
|
||||||
width: defaultFontHeight * 15
|
width: defaultFontHeight * 30
|
||||||
model: artistChartsModel
|
model: artistChartsModel
|
||||||
clip: true
|
clip: true
|
||||||
|
delegateHeight: defaultFontHeight * 6
|
||||||
|
|
||||||
onItemClicked: {
|
onItemClicked: {
|
||||||
mainView.startStationFromArtist(artistChartsModel.itemFromIndex(index).artistName)
|
mainView.startStationFromArtist(artistChartsModel.itemFromIndex(index).artistName)
|
||||||
|
@@ -4,19 +4,41 @@ import tomahawk 1.0
|
|||||||
ListView {
|
ListView {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
property int delegateHeight: defaultFontHeight * 3
|
||||||
|
|
||||||
signal itemClicked(int index)
|
signal itemClicked(int index)
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: defaultFontHeight * 3
|
height: root.delegateHeight
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: background
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: defaultFontHeight / 2
|
radius: defaultFontHeight / 2
|
||||||
|
opacity: 0.5
|
||||||
gradient: Gradient {
|
gradient: Gradient {
|
||||||
GradientStop { position: 0.0; color: "#00FFFFFF" }
|
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 {
|
Row {
|
||||||
@@ -24,6 +46,7 @@ ListView {
|
|||||||
spacing: defaultFontHeight
|
spacing: defaultFontHeight
|
||||||
|
|
||||||
CoverImage {
|
CoverImage {
|
||||||
|
id: coverImage
|
||||||
height: parent.height
|
height: parent.height
|
||||||
width: height
|
width: height
|
||||||
showLabels: false
|
showLabels: false
|
||||||
@@ -33,12 +56,16 @@ ListView {
|
|||||||
text: model.artistName
|
text: model.artistName
|
||||||
color: "white"
|
color: "white"
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: parent.width - coverImage.width - parent.spacing
|
||||||
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: root.itemClicked(index)
|
onClicked: root.itemClicked(index)
|
||||||
|
hoverEnabled: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user