added two new themes, reworked Crypto.qml and Stats.qml, standardized the buttons for the modules, added a new Sidebar widget which contains new 3 modules
This commit is contained in:
49
widgets/sidebar/mpris/MediaSlider.qml
Normal file
49
widgets/sidebar/mpris/MediaSlider.qml
Normal file
@@ -0,0 +1,49 @@
|
||||
import QtQuick
|
||||
import "../../../config" as Cfg
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property real fraction: 0
|
||||
property bool interactive: true
|
||||
signal seeked(real fraction)
|
||||
|
||||
readonly property var t: Cfg.Config.theme
|
||||
|
||||
implicitHeight: 14
|
||||
|
||||
function seek(posX) {
|
||||
seeked(Math.max(0, Math.min(1, posX / width)))
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.width
|
||||
height: 3
|
||||
radius: 2
|
||||
color: root.t.mprisTrackColor
|
||||
|
||||
Rectangle {
|
||||
width: parent.width * root.fraction
|
||||
height: parent.height
|
||||
radius: parent.radius
|
||||
color: root.t.mprisAccent
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
x: Math.max(0, Math.min(parent.width - width, (parent.width - width) * root.fraction))
|
||||
width: 10
|
||||
height: 10
|
||||
radius: 5
|
||||
color: root.t.mprisAccent
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: root.interactive ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
onPressed: pos => root.seek(pos.x)
|
||||
onPositionChanged: pos => { if (pressed) root.seek(pos.x) }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user