diff --git a/matrique.pro b/matrique.pro index 4111400..6b466e2 100644 --- a/matrique.pro +++ b/matrique.pro @@ -69,19 +69,19 @@ mac { ICON = asset/img/icon.icns } -DISTFILES += \ - ChatForm.qml \ - LoginForm.qml \ - main.qml \ - Home.qml \ - Login.qml \ - ImageStatus.qml \ - ButtonDelegate.qml \ - SideNav.qml \ - RoomListForm.qml \ - Room.qml \ - Setting.qml \ - qml/js/md.js \ +#DISTFILES += \ +# ChatForm.qml \ +# LoginForm.qml \ +# main.qml \ +# Home.qml \ +# Login.qml \ +# ImageStatus.qml \ +# ButtonDelegate.qml \ +# SideNav.qml \ +# RoomListForm.qml \ +# Room.qml \ +# Setting.qml \ +# qml/js/md.js \ HEADERS += \ src/controller.h \ diff --git a/qml/Setting.qml b/qml/Setting.qml index 95ec054..017e622 100644 --- a/qml/Setting.qml +++ b/qml/Setting.qml @@ -28,7 +28,13 @@ Page { id: accountSettingsListView + boundsBehavior: Flickable.DragOverBounds + + clip: true + delegate: Column { + property bool expanded: false + spacing: 16 SwipeDelegate { @@ -79,23 +85,25 @@ Page { SwipeDelegate.onClicked: matriqueController.logout(connection) } - onClicked: accountSettingsListView.currentIndex == index ? accountSettingsListView.currentIndex = -1 : accountSettingsListView.currentIndex = index + onClicked: expanded = !expanded } ColumnLayout { - visible: accountSettingsListView.currentIndex == index width: parent.width - 32 + height: expanded ? implicitHeight : 0 anchors.horizontalCenter: parent.horizontalCenter spacing: 0 + clip: true + ListView { Layout.fillWidth: true Layout.preferredHeight: 32 orientation: ListView.Horizontal - model: ["#498882", "#2196F3"] + model: ["#498882", "#42a5f5", "#5c6bc0", "#7e57c2", "#ab47bc", "#ff7043"] delegate: Rectangle { width: parent.height @@ -155,6 +163,10 @@ Page { readOnly: true } } + + Behavior on height { + PropertyAnimation { easing.type: Easing.InOutCubic; duration: 200 } + } } } } diff --git a/qml/component/SideNavButton.qml b/qml/component/SideNavButton.qml index 9ec0978..78fab83 100644 --- a/qml/component/SideNavButton.qml +++ b/qml/component/SideNavButton.qml @@ -8,12 +8,13 @@ import "qrc:/js/util.js" as Util ItemDelegate { property var page readonly property bool selected: stackView.currentItem === page + property color highlightColor: Material.accent Rectangle { width: selected ? 4 : 0 height: parent.height - color: Material.accent + color: highlightColor Behavior on width { PropertyAnimation { easing.type: Easing.InOutCubic; duration: 200 } diff --git a/qml/main.qml b/qml/main.qml index fc18f03..b9b5842 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -117,6 +117,8 @@ ApplicationWindow { spacing: 0 + clip: true + delegate: SideNavButton { width: parent.width height: width @@ -130,6 +132,8 @@ ApplicationWindow { defaultColor: Material.accent } + highlightColor: matriqueController.color(user.id) + page: roomPage onClicked: accountListView.currentConnection = connection