mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-17 19:37:09 +02:00
* Imported QML resources.
This commit is contained in:
committed by
Michael Zanetti
parent
09c272a07c
commit
17eeae9a8f
34
data/qml/tomahawkimports/ToggleViewButtons.qml
Normal file
34
data/qml/tomahawkimports/ToggleViewButtons.qml
Normal file
@@ -0,0 +1,34 @@
|
||||
import QtQuick 1.1
|
||||
import tomahawk 1.0
|
||||
|
||||
Row {
|
||||
id: root
|
||||
width: repeater.width
|
||||
|
||||
property alias model: repeater.model
|
||||
property int currentIndex: 0
|
||||
|
||||
Repeater {
|
||||
id: repeater
|
||||
height: root.height
|
||||
width: count * height
|
||||
|
||||
|
||||
delegate: Image {
|
||||
height: repeater.height
|
||||
width: height
|
||||
|
||||
source: "../../images/view-toggle-" + (index === root.currentIndex ? "active-" : "inactive-" ) + (index === 0 ? "left" : ( index === repeater.count - 1 ? "right" : "centre" )) + ".svg"
|
||||
smooth: true
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
source: "../../images/" + modelData + (index === root.currentIndex ? "-active.svg" : "-inactive.svg")
|
||||
}
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
onClicked: root.currentIndex = index
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user