Commit f207d564 authored by LNJ's avatar LNJ Committed by Jonah Brüchert

Replace AboutPage with AboutSheet

Replace close button with round button; see #154.
parent 2cbb1282
......@@ -6,7 +6,7 @@
<file alias="qml/RosterRemoveContactSheet.qml">src/qml/RosterRemoveContactSheet.qml</file>
<file alias="qml/LoginPage.qml">src/qml/LoginPage.qml</file>
<file alias="qml/ChatPage.qml">src/qml/ChatPage.qml</file>
<file alias="qml/AboutPage.qml">src/qml/AboutPage.qml</file>
<file alias="qml/AboutSheet.qml">src/qml/AboutSheet.qml</file>
<file alias="qml/GlobalDrawer.qml">src/qml/GlobalDrawer.qml</file>
<file alias="qml/elements/RosterListItem.qml">src/qml/elements/RosterListItem.qml</file>
<file alias="qml/elements/MessageCounter.qml">src/qml/elements/MessageCounter.qml</file>
......
......@@ -2,6 +2,8 @@
* Kaidan - A user-friendly XMPP client for every device!
*
* Copyright (C) 2017 JBBgameich <jbb.mail@gmx.de>
* Copyright (C) 2017 Ilya Bizyaev <bizyaev@zoho.com>
* Copyright (C) 2017 LNJ <git@lnj.li>
*
* Kaidan is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -17,59 +19,66 @@
* along with Kaidan. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.1
import QtQuick 2.6
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.0 as Controls
import QtQuick.Controls 2.1 as Controls
import org.kde.kirigami 2.0 as Kirigami
Kirigami.Page {
id: aboutPage
title: qsTr("About")
Kirigami.OverlaySheet {
id: aboutSheet
Layout.alignment: Qt.AlignH | Qt.AlignTop
Column {
width: parent.width
ColumnLayout {
id: content
spacing: Kirigami.Units.gridUnit * 0.6
Layout.alignment: Qt.AlignHCenter
Image {
source: kaidan.getResourcePath("images/kaidan.svg")
height: aboutPage.height * 0.5
Layout.preferredHeight: Kirigami.Units.gridUnit * 15
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
fillMode: Image.PreserveAspectFit
anchors.horizontalCenter: parent.horizontalCenter
mipmap: true
sourceSize: Qt.size(width, height)
Controls.ToolButton {
anchors.right: parent.right
text: "\u2715" // Unicode MULTIPLICATION X
onClicked: aboutSheet.close()
}
}
Kirigami.Heading {
text: "Kaidan " + kaidan.getVersionString()
anchors.horizontalCenter: parent.horizontalCenter
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
}
Controls.Label {
text: qsTr("A simple, user-friendly Jabber/XMPP client")
anchors.horizontalCenter: parent.horizontalCenter
text: "<i>" + qsTr("A simple, user-friendly Jabber/XMPP client") + "</i>"
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
}
Controls.Label {
text: qsTr("License:") + " GPLv3+ / CC BY-SA 4.0"
anchors.horizontalCenter: parent.horizontalCenter
text: "<b>" + qsTr("License:") + "</b> GPLv3+ / CC BY-SA 4.0"
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
}
Controls.Label {
text: "Copyright (C) 2016-2017 Kaidan developers and contributors"
anchors.horizontalCenter: parent.horizontalCenter
text: "Copyright (C) 2016-2017\nKaidan developers and contributors"
wrapMode: Text.WordWrap
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
}
Controls.ToolButton {
text: qsTr("Sourcecode on Github")
text: qsTr("Source code on Github")
onClicked: Qt.openUrlExternally("https://github.com/KaidanIM/Kaidan")
anchors.horizontalCenter: parent.horizontalCenter
}
Controls.Button {
id: closeButton
text: qsTr("Close")
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
closeButton.enabled = false;
pageStack.pop();
}
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
}
}
}
......@@ -32,6 +32,10 @@ Kirigami.GlobalDrawer {
// show open button on the left side
handleVisible: true
AboutSheet {
id: aboutSheet
}
actions: [
Kirigami.Action {
text: qsTr("Add new contact")
......@@ -48,8 +52,7 @@ Kirigami.GlobalDrawer {
// disconnect normally, this will emit the
// disconncted signal and open the login page
kaidan.mainDisconnect();
}
else {
} else {
// emit the disconnect signal, to force
// the pages being popped and the login
// page pushed
......@@ -61,12 +64,8 @@ Kirigami.GlobalDrawer {
text: qsTr("About")
iconName: "help-about"
onTriggered: {
// prevent opening the about page multiple times
while (pageStack.depth > 1) {
pageStack.pop();
}
// open login page
pageStack.push(aboutPage);
// open about sheet
aboutSheet.open();
}
}
]
......
......@@ -46,7 +46,6 @@ Kirigami.ApplicationWindow {
Component {id: chatPage; ChatPage {}}
Component {id: loginPage; LoginPage {}}
Component {id: rosterPage; RosterPage {}}
Component {id: aboutPage; AboutPage {}}
Component.onCompleted: {
function handleDisconnect() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment