Commit 44b94dc4 authored by Ilya Bizyaev's avatar Ilya Bizyaev 📱 Committed by LNJ

New About dialog

The About dialog change fixes bigger logo display. It replaces
an OverlaySheet, which was used in a way conflicting with
Kirigami HIG. As a bonus, it is able to change layout direction
depending on screen size.
parent 4cfa0115
......@@ -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/AboutSheet.qml">src/qml/AboutSheet.qml</file>
<file alias="qml/AboutDialog.qml">src/qml/AboutDialog.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>
......
......@@ -33,64 +33,76 @@ import QtQuick.Layouts 1.2
import QtQuick.Controls 2.1 as Controls
import org.kde.kirigami 2.0 as Kirigami
Kirigami.OverlaySheet {
id: aboutSheet
Controls.Dialog {
id: aboutDialog
modal: true
standardButtons: Controls.Dialog.Ok
onAccepted: close()
ColumnLayout {
id: content
spacing: Kirigami.Units.gridUnit * 0.6
Layout.alignment: Qt.AlignHCenter
GridLayout {
anchors.fill: parent
flow: root.width > root.height ? GridLayout.LeftToRight : GridLayout.TopToBottom
columnSpacing: 20
rowSpacing: 20
Image {
source: kaidan.getResourcePath("images/kaidan.svg")
Layout.preferredHeight: Kirigami.Units.gridUnit * 15
Layout.preferredWidth: Kirigami.Units.gridUnit * 9
Layout.preferredHeight: Kirigami.Units.gridUnit * 9
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
Layout.fillHeight: true
Layout.alignment: Qt.AlignCenter
fillMode: Image.PreserveAspectFit
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()
textFormat: Text.PlainText
ColumnLayout {
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
}
Layout.fillHeight: true
spacing: Kirigami.gridUnit * 0.6
Controls.Label {
text: "<i>" + qsTr("A simple, user-friendly Jabber/XMPP client") + "</i>"
textFormat: Text.RichText
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
}
Kirigami.Heading {
text: "Kaidan " + kaidan.getVersionString()
textFormat: Text.PlainText
wrapMode: Text.WordWrap
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
}
Controls.Label {
text: "<b>" + qsTr("License:") + "</b> GPLv3+ / CC BY-SA 4.0"
textFormat: Text.RichText
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
}
Controls.Label {
text: "<i>" + qsTr("A simple, user-friendly Jabber/XMPP client") + "</i>"
textFormat: Text.RichText
wrapMode: Text.WordWrap
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
}
Controls.Label {
text: "Copyright © 2016-2018\nKaidan developers and contributors"
textFormat: Text.PlainText
wrapMode: Text.WordWrap
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
}
Controls.Label {
text: "<b>" + qsTr("License:") + "</b> GPLv3+ / CC BY-SA 4.0"
textFormat: Text.RichText
wrapMode: Text.WordWrap
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
}
Controls.ToolButton {
text: qsTr("Source code on GitHub")
onClicked: Qt.openUrlExternally("https://github.com/KaidanIM/Kaidan")
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Controls.Label {
text: "Copyright © 2016-2018\nKaidan developers and contributors"
textFormat: Text.PlainText
wrapMode: Text.WordWrap
Layout.fillWidth: true
Layout.preferredWidth: contentWidth
horizontalAlignment: Qt.AlignHCenter
}
Controls.ToolButton {
text: qsTr("Source code on GitHub")
onClicked: Qt.openUrlExternally("https://github.com/KaidanIM/Kaidan")
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
}
}
}
}
......@@ -43,10 +43,6 @@ Kirigami.GlobalDrawer {
// show open button on the left side
handleVisible: true
AboutSheet {
id: aboutSheet
}
actions: [
Kirigami.Action {
text: qsTr("Log out")
......@@ -61,7 +57,7 @@ Kirigami.GlobalDrawer {
iconName: "help-about"
onTriggered: {
// open about sheet
aboutSheet.open();
aboutDialog.open();
}
}
]
......
......@@ -54,6 +54,13 @@ Kirigami.ApplicationWindow {
id: contextDrawer
}
AboutDialog {
id: aboutDialog
focus: true
x: (parent.width - width) / 2
y: (parent.height - height) / 2
}
// when the window was closed, disconnect from jabber server
onClosing: {
kaidan.mainDisconnect();
......
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