First commit.

This commit is contained in:
Black Hat
2018-02-23 22:39:14 +08:00
commit c2f01ec1c4
20 changed files with 988 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
import QtQuick 2.10
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.3
Item {
property int index
property alias contentItem: itemDelegate.contentItem
signal clicked
id: buttonDelegate
Layout.fillWidth: true
Layout.preferredHeight: width
Rectangle {
width: swipeView.currentIndex === index ? parent.width : 0
height: parent.height
anchors.bottom: itemDelegate.bottom
color: Qt.lighter(Material.accent)
Behavior on width {
PropertyAnimation { easing.type: Easing.InOutQuad; duration: 200 }
}
}
ItemDelegate {
id: itemDelegate
anchors.fill: parent
onClicked: {
swipeView.currentIndex = index
buttonDelegate.clicked()
}
}
}

View File

@@ -0,0 +1,34 @@
import QtQuick 2.10
import QtQuick.Controls 2.3
import QtGraphicalEffects 1.0
Image {
id: avatar
mipmap: true
layer.enabled: true
fillMode: Image.PreserveAspectCrop
layer.effect: OpacityMask {
maskSource: Item {
width: avatar.width
height: avatar.width
Rectangle {
anchors.centerIn: parent
width: avatar.width
height: avatar.width
radius: avatar.width / 2
}
}
}
Rectangle {
id: circle
width: avatar.width
height: avatar.width
radius: avatar.width / 2
color: "transparent"
border.color: "#4caf50"
border.width: 4
}
}

17
qml/component/SideNav.qml Normal file
View File

@@ -0,0 +1,17 @@
import QtQuick 2.10
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.3
Drawer {
property SwipeView swipeView
interactive: false
position: 1.0
visible: true
modal: false
background: Rectangle {
color: Material.accent
}
}