Page MenuHomePhorge

No OneTemporary

Size
14 KB
Referenced Files
None
Subscribers
None
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..694a1af
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*~
+\#*
+.#*
+build
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..33e5136
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,32 @@
+cmake_minimum_required(VERSION 3.13)
+
+project(kazv)
+
+include(FeatureSummary)
+
+set(QT5_MIN_VERSION 5.12)
+set(KF5_MIN_VERSION 5.65)
+
+find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
+
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
+
+include(KDEInstallDirs)
+include(KDECMakeSettings)
+include(KDECompilerSettings NO_POLICY_SCOPE)
+include(ECMSetupVersion)
+include(ECMGenerateHeaders)
+include(ECMPoQmTools)
+
+find_package(Qt5 ${QT5_MIN_VERSION} REQUIRED COMPONENTS Core Gui Qml QuickControls2 Svg)
+# Sql Quick QuickControls2 Network DBus Xml)
+find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 I18n)
+# Notifications Config Service KIO)
+#find_package(MauiKit REQUIRED)
+
+add_subdirectory(src)
+
+install(PROGRAMS moe.kazv.mxc.kazv.desktop DESTINATION ${KDE_INSTALL_APPDIR})
+install(FILES moe.kazv.mxc.kazv.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
+
+feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..512facf
--- /dev/null
+++ b/README.md
@@ -0,0 +1,16 @@
+# License
+
+Copyright (C) 2020 Tusooa Zhu <tusooa@vista.aero>
+
+kazv is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+kazv is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with kazv. If not, see <https://www.gnu.org/licenses/>.
diff --git a/moe.kazv.mxc.kazv.appdata.xml b/moe.kazv.mxc.kazv.appdata.xml
new file mode 100644
index 0000000..bccec3e
--- /dev/null
+++ b/moe.kazv.mxc.kazv.appdata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component type="desktop-application">
+ <id>moe.kazv.mxc.kazv</id>
+ <name>kazv</name>
+ <summary>A matrix client</summary>
+ <metadata_license>FSFAP</metadata_license>
+ <project_license>AGPL-3+</project_license>
+ <developer_name>The Kazv Project</developer_name>
+ <description>
+ <p>A matrix client built with libkazv and Kirigami.</p>
+ </description>
+</component>
diff --git a/moe.kazv.mxc.kazv.desktop b/moe.kazv.mxc.kazv.desktop
new file mode 100644
index 0000000..fb143a1
--- /dev/null
+++ b/moe.kazv.mxc.kazv.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=kazv
+Comment=Matrix client built with Kirigami
+Version=1.0
+Exec=kazv
+Icon=applications-development
+Type=Application
+Terminal=false
+Categories=Qt;KDE;
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..1116367
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,8 @@
+set(kazv_SRCS
+ main.cpp
+ resources.qrc
+ )
+
+add_executable(kazv ${kazv_SRCS})
+target_link_libraries(kazv Qt5::Core Qt5::Gui Qt5::Qml Qt5::Quick Qt5::QuickControls2 Qt5::Svg KF5::I18n)
+install(TARGETS kazv ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
diff --git a/src/contents/ui/LoginPage.qml b/src/contents/ui/LoginPage.qml
new file mode 100644
index 0000000..7ef9949
--- /dev/null
+++ b/src/contents/ui/LoginPage.qml
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2020 Tusooa Zhu <tusooa@vista.aero>
+ *
+ * This file is part of kazv.
+ *
+ * kazv is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * kazv is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with kazv. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 2.15
+import org.kde.kirigami 2.8 as Kirigami
+
+Kirigami.Page {
+ title: i18n("Log in")
+
+ ColumnLayout {
+ width: parent.width
+ spacing: Kirigami.Units.largeSpacing
+
+ Label {
+ text: i18n("User id:")
+ }
+ TextField {
+ Layout.fillWidth: true
+ placeholderText: i18n("E.g.: @foo:example.org")
+ }
+ Label {
+ text: i18n("Password:")
+ }
+ Kirigami.PasswordField {
+ id: passwordField
+ Layout.fillWidth: true
+// onAccepted: // check if passwordField.text is valid
+ }
+ Button {
+ text: i18n("Log in")
+ Layout.fillWidth: true
+ onClicked: pageStack.replace(Qt.resolvedUrl("MainPage.qml"))
+ }
+
+ }
+
+}
diff --git a/src/contents/ui/MainPage.qml b/src/contents/ui/MainPage.qml
new file mode 100644
index 0000000..f3186d5
--- /dev/null
+++ b/src/contents/ui/MainPage.qml
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2020 Tusooa Zhu <tusooa@vista.aero>
+ *
+ * This file is part of kazv.
+ *
+ * kazv is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * kazv is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with kazv. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.2
+import QtQuick.Layouts 1.15
+import QtQuick.Controls 2.15
+
+import org.kde.kirigami 2.13 as Kirigami
+import org.kde.mauikit 1.2 as Maui
+import '.' as Kazv
+
+Kazv.TabView {
+ controlAtBottom: false
+ title: i18n("kazv")
+
+ Kazv.Tab {
+ iconName: "clock"
+ title: i18n("Recent")
+ Label {
+ text: "recent"
+ }
+ }
+ Kazv.Tab {
+ iconName: "user-identity"
+ title: i18n("People")
+ Label {
+ text: "people"
+ }
+ }
+ Kazv.Tab {
+ iconName: "comment-symbolic"
+ title: i18n("Rooms")
+ Label {
+ text: "rooms"
+ }
+ }
+}
diff --git a/src/contents/ui/Tab.qml b/src/contents/ui/Tab.qml
new file mode 100644
index 0000000..2526ad5
--- /dev/null
+++ b/src/contents/ui/Tab.qml
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2020 Tusooa Zhu <tusooa@vista.aero>
+ *
+ * This file is part of kazv.
+ *
+ * kazv is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * kazv is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with kazv. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.2
+import QtQuick.Layouts 1.15
+import QtQuick.Controls 2.15
+
+import org.kde.kirigami 2.13 as Kirigami
+import org.kde.mauikit 1.2 as Maui
+import '.' as Kazv
+
+Item {
+ property string iconName
+ property string title
+}
diff --git a/src/contents/ui/TabView.qml b/src/contents/ui/TabView.qml
new file mode 100644
index 0000000..596458f
--- /dev/null
+++ b/src/contents/ui/TabView.qml
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2020 Tusooa Zhu <tusooa@vista.aero>
+ *
+ * This file is part of kazv.
+ *
+ * kazv is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * kazv is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with kazv. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.2
+import QtQuick.Layouts 1.15
+import QtQuick.Controls 2.15
+
+import org.kde.kirigami 2.13 as Kirigami
+import org.kde.mauikit 1.2 as Maui
+
+import '.' as Kazv
+
+
+Kirigami.ScrollablePage {
+ id: page
+
+ default property list<Item> tabs
+
+ property var controlAtBottom: true
+
+ ColumnLayout {
+ id: view
+ width: parent.width
+ height: parent.height
+
+ readonly property var screens: StackLayout {
+ Layout.fillHeight: true
+ currentIndex: bar.currentIndex
+ Repeater {
+ model: page.tabs
+ delegate: Item {
+ Layout.fillHeight: true
+ data: modelData
+ }
+ }
+ }
+
+ data: screens
+
+ }
+
+ readonly property var control: RowLayout {
+ id: bar
+ Layout.fillWidth: true
+ Layout.fillHeight: false
+ property int currentIndex: 0
+
+ property Component delegate: ToolButton {
+ Layout.fillWidth: true
+ text: modelData.title
+ icon.name: modelData.iconName
+ autoExclusive: true
+ onClicked: {
+ bar.currentIndex = index
+ }
+ display: AbstractButton.TextUnderIcon
+ checkable: true
+ checked: index == bar.currentIndex
+ }
+
+ Repeater {
+ model: tabs
+ delegate: bar.delegate
+ }
+ }
+
+
+ footer: page.controlAtBottom ? control : null
+ header: page.controlAtBottom ? null : control
+}
diff --git a/src/contents/ui/main.qml b/src/contents/ui/main.qml
new file mode 100644
index 0000000..ed8bfcd
--- /dev/null
+++ b/src/contents/ui/main.qml
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2020 Tusooa Zhu <tusooa@vista.aero>
+ *
+ * This file is part of kazv.
+ *
+ * kazv is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * kazv is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with kazv. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.1
+import org.kde.kirigami 2.4 as Kirigami
+import QtQuick.Controls 2.0 as Controls
+
+Kirigami.ApplicationWindow {
+ id: root
+
+ title: i18n("kazv")
+
+ globalDrawer: Kirigami.GlobalDrawer {
+ title: i18n("kazv")
+ titleIcon: "applications-graphics"
+ actions: [
+ Kirigami.Action {
+ text: i18n("View")
+ iconName: "view-list-icons"
+ Kirigami.Action {
+ text: i18n("View Action 1")
+ onTriggered: showPassiveNotification(i18n("View Action 1 clicked"))
+ }
+ Kirigami.Action {
+ text: i18n("View Action 2")
+ onTriggered: showPassiveNotification(i18n("View Action 2 clicked"))
+ }
+ },
+ Kirigami.Action {
+ text: i18n("Action 1")
+ onTriggered: showPassiveNotification(i18n("Action 1 clicked"))
+ },
+ Kirigami.Action {
+ text: i18n("Action 2")
+ onTriggered: showPassiveNotification(i18n("Action 2 clicked"))
+ }
+ ]
+ }
+
+ contextDrawer: Kirigami.ContextDrawer {
+ id: contextDrawer
+ }
+
+ pageStack.initialPage: Qt.resolvedUrl("LoginPage.qml")
+
+}
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..a718332
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2020 Tusooa Zhu <tusooa@vista.aero>
+ *
+ * This file is part of kazv.
+ *
+ * kazv is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * kazv is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with kazv. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include <QApplication>
+#include <QQmlApplicationEngine>
+#include <QtQml>
+#include <QUrl>
+#include <KLocalizedContext>
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QApplication app(argc, argv);
+ QCoreApplication::setOrganizationName("The Kazv Project");
+ QCoreApplication::setOrganizationDomain("kazv.moe");
+ QCoreApplication::setApplicationName("kazv");
+
+ QQmlApplicationEngine engine;
+
+ engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
+ engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
+
+ if (engine.rootObjects().isEmpty()) {
+ return -1;
+ }
+
+ return app.exec();
+}
diff --git a/src/resources.qrc b/src/resources.qrc
new file mode 100644
index 0000000..e150e2c
--- /dev/null
+++ b/src/resources.qrc
@@ -0,0 +1,9 @@
+<RCC>
+ <qresource prefix="/">
+ <file alias="main.qml">contents/ui/main.qml</file>
+ <file alias="LoginPage.qml">contents/ui/LoginPage.qml</file>
+ <file alias="MainPage.qml">contents/ui/MainPage.qml</file>
+ <file alias="TabView.qml">contents/ui/TabView.qml</file>
+ <file alias="Tab.qml">contents/ui/Tab.qml</file>
+ </qresource>
+</RCC>

File Metadata

Mime Type
text/x-diff
Expires
Fri, Oct 9, 11:22 PM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1784938
Default Alt Text
(14 KB)

Event Timeline