From abf015424bf5d5c28612e7b473b2b52878626326 Mon Sep 17 00:00:00 2001 From: IgorekLoschinin <igor.loschinin2014@yandex.ru> Date: Tue, 19 Oct 2021 22:04:32 +0300 Subject: [PATCH 1/6] change list viewer and credits --- src/Example/src/main.qml | 25 +++----- .../src/QuasarAppCreditsModule/Credits.qml | 61 ++----------------- .../src/QuasarAppCreditsModule/ListViewer.qml | 25 +++----- 3 files changed, 22 insertions(+), 89 deletions(-) diff --git a/src/Example/src/main.qml b/src/Example/src/main.qml index 72e9ee4..e445a8d 100644 --- a/src/Example/src/main.qml +++ b/src/Example/src/main.qml @@ -12,15 +12,12 @@ ApplicationWindow { Credits { state: "about" - developersList: [ - { - section: qsTr("## QuasarApp Core"), - sectionList: [ - "* Oleg-Disigner", - "* Yankovich Andrei" - ] - } + listCustomInfo: [ + "## QuasarApp Developers:", + "* Oleg-Disigner", + "* Yankovich Andrei" ] + } Credits { state: "minimal" @@ -46,14 +43,10 @@ ApplicationWindow { Credits { state: "full" - developersList: [ - { - section: qsTr("## QuasarApp Core"), - sectionList: [ - "* Oleg-Disigner", - "* Yankovich Andrei" - ] - } + listCustomInfo: [ + "## QuasarApp Core", + "* Oleg-Disigner", + "* Yankovich Andrei" ] } } diff --git a/src/Library/src/QuasarAppCreditsModule/Credits.qml b/src/Library/src/QuasarAppCreditsModule/Credits.qml index f6254a6..0f16409 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) && listCustomInfo.length // 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,54 +106,12 @@ 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 - } - } anchors.fill: parent @@ -223,7 +171,6 @@ Page { showPatreon: false showBitcoin: false showPatrons: true - } }, @@ -235,7 +182,7 @@ Page { showHeader: false showPatreon: false showBitcoin: false - patronsList: [] + listCustomInfo: [] } } diff --git a/src/Library/src/QuasarAppCreditsModule/ListViewer.qml b/src/Library/src/QuasarAppCreditsModule/ListViewer.qml index ca78e3c..1d512ce 100644 --- a/src/Library/src/QuasarAppCreditsModule/ListViewer.qml +++ b/src/Library/src/QuasarAppCreditsModule/ListViewer.qml @@ -15,29 +15,22 @@ import QtQuick.Layouts 1.15 // ] // } //] -Repeater { - ColumnLayout { - Layout.fillWidth: true +ColumnLayout { + property var model: [] + Layout.fillWidth: true + + Repeater { + model: model Label { - text: modelData.section + text: modelData Layout.fillWidth: true textFormat: TextEdit.MarkdownText - } - - Repeater { - model: modelData.sectionList - - Label { - text: modelData - Layout.fillWidth: true - - textFormat: TextEdit.MarkdownText - - } } + } } + From 00490f91293e897e3dd1ea8fad72e032ff718c7b Mon Sep 17 00:00:00 2001 From: IgorekLoschinin <igor.loschinin2014@yandex.ru> Date: Tue, 19 Oct 2021 22:35:47 +0300 Subject: [PATCH 2/6] fix lstviewer --- src/Library/src/QuasarAppCreditsModule/Credits.qml | 6 ++---- src/Library/src/QuasarAppCreditsModule/ListViewer.qml | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Library/src/QuasarAppCreditsModule/Credits.qml b/src/Library/src/QuasarAppCreditsModule/Credits.qml index 0f16409..eff6dbd 100644 --- a/src/Library/src/QuasarAppCreditsModule/Credits.qml +++ b/src/Library/src/QuasarAppCreditsModule/Credits.qml @@ -10,7 +10,7 @@ Page { property bool showHeader: true property bool showPatreon: true property bool showBitcoin: true - property bool showPatrons: (showQR || showPatreon || showBitcoin) && listCustomInfo.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 @@ -109,7 +109,7 @@ Page { ListViewer { model: listCustomInfo - visible: showPatrons + visible: listCustomInfo.length } } @@ -182,8 +182,6 @@ Page { showHeader: false showPatreon: false showBitcoin: false - listCustomInfo: [] - } } ] diff --git a/src/Library/src/QuasarAppCreditsModule/ListViewer.qml b/src/Library/src/QuasarAppCreditsModule/ListViewer.qml index 1d512ce..6f0c093 100644 --- a/src/Library/src/QuasarAppCreditsModule/ListViewer.qml +++ b/src/Library/src/QuasarAppCreditsModule/ListViewer.qml @@ -17,11 +17,12 @@ import QtQuick.Layouts 1.15 //] ColumnLayout { + id: root property var model: [] Layout.fillWidth: true Repeater { - model: model + model: root.model Label { text: modelData From 86896d7cc0e878c5760c0ef6138da7a05a9e0d2d Mon Sep 17 00:00:00 2001 From: IgorekLoschinin <igor.loschinin2014@yandex.ru> Date: Tue, 19 Oct 2021 23:38:02 +0300 Subject: [PATCH 3/6] fixing: added settings for text and lable --- src/Example/src/main.qml | 19 +++++++++-- .../src/QuasarAppCreditsModule/ListViewer.qml | 33 +++++++++++++++---- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/src/Example/src/main.qml b/src/Example/src/main.qml index e445a8d..c846f90 100644 --- a/src/Example/src/main.qml +++ b/src/Example/src/main.qml @@ -13,9 +13,22 @@ ApplicationWindow { Credits { state: "about" listCustomInfo: [ - "## QuasarApp Developers:", - "* Oleg-Disigner", - "* Yankovich Andrei" + { + 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" + } ] } diff --git a/src/Library/src/QuasarAppCreditsModule/ListViewer.qml b/src/Library/src/QuasarAppCreditsModule/ListViewer.qml index 6f0c093..3cd8d20 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,11 +9,20 @@ 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" // } //] @@ -25,11 +35,20 @@ ColumnLayout { model: root.model Label { - text: modelData + id: lableSource + text: modelData.text Layout.fillWidth: true + horizontalAlignment: (modelData.align)? modelData.align : horizontalAlignment + color: (modelData.color && modelData.color.length)? modelData.color: color textFormat: TextEdit.MarkdownText - + linkColor: Material.accent + onLinkActivated: (link) => { + Qt.openUrlExternally(link) + } + onLinkHovered: (link) => { + lableSource.ToolTip.show(link) + } } } From 9fc5ec86f421900503e5959deb77abbecef336f4 Mon Sep 17 00:00:00 2001 From: Igor loschinin <igor.loschinin2014@yandex.ru> Date: Tue, 19 Oct 2021 23:40:18 +0300 Subject: [PATCH 4/6] Update src/Example/src/main.qml Co-authored-by: Andrei Yankovich <EndrIIMail@gmail.com> --- src/Example/src/main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Example/src/main.qml b/src/Example/src/main.qml index c846f90..f5cb2cf 100644 --- a/src/Example/src/main.qml +++ b/src/Example/src/main.qml @@ -19,7 +19,7 @@ ApplicationWindow { color: "" }, { - text: "* [Oleg-Disigner](https://www.google.com/)", + text: "* [google](https://www.google.com/)", align: Label.AlignHCenter, color: "" From cf9a7b15b91f866b9fad3893900610d2f7a1a891 Mon Sep 17 00:00:00 2001 From: IgorekLoschinin <igor.loschinin2014@yandex.ru> Date: Tue, 19 Oct 2021 23:48:42 +0300 Subject: [PATCH 5/6] fixing ennds --- src/Example/src/main.qml | 6 +++--- src/Library/src/QuasarAppCreditsModule/ListViewer.qml | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Example/src/main.qml b/src/Example/src/main.qml index c846f90..bf37403 100644 --- a/src/Example/src/main.qml +++ b/src/Example/src/main.qml @@ -57,9 +57,9 @@ ApplicationWindow { Credits { state: "full" listCustomInfo: [ - "## QuasarApp Core", - "* Oleg-Disigner", - "* Yankovich Andrei" + {text: "## QuasarApp Core"}, + {text: "* Oleg-Disigner"}, + {text: "* Yankovich Andrei"} ] } } diff --git a/src/Library/src/QuasarAppCreditsModule/ListViewer.qml b/src/Library/src/QuasarAppCreditsModule/ListViewer.qml index 3cd8d20..1aaa11c 100644 --- a/src/Library/src/QuasarAppCreditsModule/ListViewer.qml +++ b/src/Library/src/QuasarAppCreditsModule/ListViewer.qml @@ -47,7 +47,11 @@ ColumnLayout { Qt.openUrlExternally(link) } onLinkHovered: (link) => { - lableSource.ToolTip.show(link) + if (link.length) { + lableSource.ToolTip.show(link) + } else { + lableSource.ToolTip.hide() + } } } From 731f9a5c73c063673506ed0d56b759eb0f59fa51 Mon Sep 17 00:00:00 2001 From: Andrei Yankovich <EndrIIMail@gmail.com> Date: Wed, 20 Oct 2021 00:26:20 +0300 Subject: [PATCH 6/6] Update ListViewer.qml --- src/Library/src/QuasarAppCreditsModule/ListViewer.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Library/src/QuasarAppCreditsModule/ListViewer.qml b/src/Library/src/QuasarAppCreditsModule/ListViewer.qml index 1aaa11c..f91b89b 100644 --- a/src/Library/src/QuasarAppCreditsModule/ListViewer.qml +++ b/src/Library/src/QuasarAppCreditsModule/ListViewer.qml @@ -40,6 +40,7 @@ ColumnLayout { 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