Spectral/qml/component/SideNavButton.qml

26 lines
580 B
QML
Raw Normal View History

2018-07-12 01:44:41 +00:00
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.2
2018-03-21 11:13:47 +00:00
2018-09-10 00:06:32 +00:00
import "qrc:/js/util.js" as Util
2018-09-02 13:26:42 +00:00
ItemDelegate {
property var page
2018-09-11 05:14:56 +00:00
property bool selected: stackView.currentItem === page
2018-09-10 08:22:45 +00:00
property color highlightColor: Material.accent
2018-03-21 11:13:47 +00:00
Rectangle {
2018-09-02 13:26:42 +00:00
width: selected ? 4 : 0
2018-03-21 11:13:47 +00:00
height: parent.height
2018-09-02 13:26:42 +00:00
2018-09-10 08:22:45 +00:00
color: highlightColor
2018-03-21 11:13:47 +00:00
Behavior on width {
PropertyAnimation { easing.type: Easing.InOutCubic; duration: 200 }
}
}
2018-09-10 00:06:32 +00:00
onClicked: Util.pushToStack(stackView, page)
2018-03-21 11:13:47 +00:00
}