diff --git a/src/Example/src/main.qml b/src/Example/src/main.qml index 72e9ee4..13f8a72 100644 --- a/src/Example/src/main.qml +++ b/src/Example/src/main.qml @@ -12,15 +12,25 @@ ApplicationWindow { Credits { state: "about" - developersList: [ + listCustomInfo: [ { - section: qsTr("## QuasarApp Core"), - sectionList: [ - "* Oleg-Disigner", - "* Yankovich Andrei" - ] + text: "## QuasarApp Developers: ", + align: Label.AlignHCenter, + color: "" + }, + { + text: "* [google](https://www.google.com/)", + align: Label.AlignHCenter, + color: "" + + }, + { + text: "* Yankovich Andrei", + align: Label.AlignHCenter, + color: "Red" } ] + } Credits { state: "minimal" @@ -46,14 +56,10 @@ ApplicationWindow { Credits { state: "full" - developersList: [ - { - section: qsTr("## QuasarApp Core"), - sectionList: [ - "* Oleg-Disigner", - "* Yankovich Andrei" - ] - } + listCustomInfo: [ + {text: "## QuasarApp Core"}, + {text: "* Oleg-Disigner"}, + {text: "* Yankovich Andrei"} ] } } diff --git a/src/Library/src/QuasarAppCreditsModule/Credits.qml b/src/Library/src/QuasarAppCreditsModule/Credits.qml index f6254a6..eff6dbd 100644 --- a/src/Library/src/QuasarAppCreditsModule/Credits.qml +++ b/src/Library/src/QuasarAppCreditsModule/Credits.qml @@ -10,24 +10,14 @@ Page { property bool showHeader: true property bool showPatreon: true property bool showBitcoin: true - property bool showPatrons: (showQR || showPatreon || showBitcoin) && patronsList.length + property bool showPatrons: (showQR || showPatreon || showBitcoin) // developersa and patronsList lists must be contain structure with a section amd sectionList fields. // The section it is section name // the sectionList it is list of section members. property string iconLogo: "" property int iconWidth: 250 - property var developersList: [] - property var versionList: [] - property var patronsList: [ - { - section: qsTr("## Silver Membership Patrons:"), - sectionList: [ - "* Rustem Husnutdinov", - "* Semih Ufuk Güler" - ] - } - ] + property var listCustomInfo: [] header: Image { fillMode: Image.PreserveAspectFit @@ -116,52 +106,10 @@ Page { } - Label { - text: qsTr("# Our patrons list:") - Layout.fillWidth: true - - textFormat: TextEdit.MarkdownText - visible: showPatrons - - - } - ListViewer { - model: patronsList + model: listCustomInfo - visible: showPatrons - } - - Label { - text: qsTr("# Developers list:") - Layout.fillWidth: true - - textFormat: TextEdit.MarkdownText - - visible: developersList.length - - } - - ListViewer { - model: developersList - - visible: developersList.length - } - - Label { - text: qsTr("# Version list:") - Layout.fillWidth: true - - textFormat: TextEdit.MarkdownText - - visible: versionList.length - - } - - ListViewer { - model: versionList - - visible: versionList.length + visible: listCustomInfo.length } } @@ -223,7 +171,6 @@ Page { showPatreon: false showBitcoin: false showPatrons: true - } }, @@ -235,8 +182,6 @@ Page { showHeader: false showPatreon: false showBitcoin: false - patronsList: [] - } } ] diff --git a/src/Library/src/QuasarAppCreditsModule/ListViewer.qml b/src/Library/src/QuasarAppCreditsModule/ListViewer.qml index ca78e3c..f91b89b 100644 --- a/src/Library/src/QuasarAppCreditsModule/ListViewer.qml +++ b/src/Library/src/QuasarAppCreditsModule/ListViewer.qml @@ -1,6 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 +import QtQuick.Controls.Material 2.15 // developersa and patronsList lists must be contain structure with a section amd sectionList fields. // The section it is section name @@ -8,36 +9,53 @@ import QtQuick.Layouts 1.15 // Example of the structure: //[ // { -// section: qsTr("## Silver Membership Patrons:"), -// sectionList: [ -// "* Rustem Husnutdinov", -// "* Semih Ufuk Güler" -// ] +// text: "## QuasarApp Developers: ", +// align: Label.AlignHCenter, +// color: "" +// }, +// { +// text: "* [Oleg-Disigner](https://www.google.com/)", +// align: Label.AlignHCenter, +// color: "" + +// }, +// { +// text: "* Yankovich Andrei", +// align: Label.AlignHCenter, +// color: "Red" // } //] -Repeater { - ColumnLayout { - Layout.fillWidth: true +ColumnLayout { + id: root + property var model: [] + Layout.fillWidth: true + + Repeater { + model: root.model Label { - text: modelData.section + id: lableSource + text: modelData.text Layout.fillWidth: true + horizontalAlignment: (modelData.align)? modelData.align : horizontalAlignment + color: (modelData.color && modelData.color.length)? modelData.color: color + wrapMode: Text.WordWrap textFormat: TextEdit.MarkdownText + linkColor: Material.accent + onLinkActivated: (link) => { + Qt.openUrlExternally(link) + } + onLinkHovered: (link) => { + if (link.length) { + lableSource.ToolTip.show(link) + } else { + lableSource.ToolTip.hide() + } + } } - Repeater { - model: modelData.sectionList - - Label { - text: modelData - Layout.fillWidth: true - - textFormat: TextEdit.MarkdownText - - } - - } } } +