Initial UI
This commit is contained in:
1 parent
4d52c8cc60
commit
3c0037cfc9
29 files changed
+1367
-2
No files matched your search
@@ -0,0 +1,99 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Asteria
|
||||
|
||||
Rectangle {
|
||||
id: sidebar
|
||||
width: sidebarOpen ? Theme.sidebarWidth : 0
|
||||
clip: true
|
||||
color: Theme.surface
|
||||
|
||||
property bool sidebarOpen: false
|
||||
|
||||
signal closeDrawer()
|
||||
signal navigateTo(string page)
|
||||
signal openFile()
|
||||
|
||||
Behavior on width {
|
||||
NumberAnimation {
|
||||
duration: sidebarOpen ? Theme.animDurationOpen : Theme.animDurationClose
|
||||
easing.type: Easing.OutQuad
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 16
|
||||
y: Theme.headerHeight / 2 - height / 2
|
||||
text: "Asteria"
|
||||
font.pixelSize: 18
|
||||
font.bold: true
|
||||
color: Theme.uiText
|
||||
}
|
||||
|
||||
// Close button aligned with main header row
|
||||
Button {
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 12
|
||||
y: Theme.headerHeight / 2 - height / 2
|
||||
z: 1
|
||||
flat: true
|
||||
contentItem: Text {
|
||||
text: "\ue5cb"
|
||||
font.family: "Material Icons Outlined"
|
||||
font.pixelSize: 24
|
||||
color: Theme.sidebarButtonText
|
||||
}
|
||||
background: Item {}
|
||||
onClicked: sidebar.closeDrawer()
|
||||
}
|
||||
|
||||
Column {
|
||||
y: Theme.headerHeight
|
||||
width: Theme.sidebarWidth
|
||||
|
||||
SideBarButton {
|
||||
iconText: "\ue86d"
|
||||
title: "Book"
|
||||
onClicked: sidebar.navigateTo("reader")
|
||||
}
|
||||
|
||||
SideBarButton {
|
||||
iconText: "\ue30a"
|
||||
title: "Files"
|
||||
onClicked: sidebar.openFile()
|
||||
}
|
||||
|
||||
// Divider
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.divider
|
||||
}
|
||||
|
||||
SideBarButton {
|
||||
iconText: "\ue3a9"
|
||||
title: "Dark Theme"
|
||||
onClicked: {} // Non-functional
|
||||
}
|
||||
|
||||
SideBarButton {
|
||||
iconText: "\ue3a6"
|
||||
title: "Light Theme"
|
||||
onClicked: {} // Non-functional
|
||||
}
|
||||
|
||||
// Divider
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.divider
|
||||
}
|
||||
|
||||
SideBarButton {
|
||||
iconText: "\ue8b8"
|
||||
title: "Settings"
|
||||
onClicked: sidebar.navigateTo("settings")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user