From 682f7e9703c2d7543456b0f5ce60a2c12b5e8eb8 Mon Sep 17 00:00:00 2001 From: Luis Bocanegra Date: Mon, 6 Jan 2025 04:38:05 -0600 Subject: [PATCH] feat: add project urls to about section --- .../contents/ui/FullRepresentation.qml | 20 +-- .../package/contents/ui/components/About.qml | 115 ++++++++++++++++++ 2 files changed, 117 insertions(+), 18 deletions(-) create mode 100644 src/plasmoid/package/contents/ui/components/About.qml diff --git a/src/plasmoid/package/contents/ui/FullRepresentation.qml b/src/plasmoid/package/contents/ui/FullRepresentation.qml index 4e6395a..66a904e 100644 --- a/src/plasmoid/package/contents/ui/FullRepresentation.qml +++ b/src/plasmoid/package/contents/ui/FullRepresentation.qml @@ -2058,6 +2058,7 @@ ColumnLayout { ColumnLayout { spacing: Kirigami.Units.mediumSpacing opacity: 0.9 + Layout.alignment: Qt.AlignHCenter PlasmaExtras.Heading { level: 2 text: "About " + Plasmoid.metaData.name @@ -2076,25 +2077,8 @@ ColumnLayout { Layout.alignment: Qt.AlignHCenter } - TextEdit { - text: "If you like the project you can leave a review in KDE Store or give it a star on Github. For bugs and feature requests please go to the issues page." - wrapMode: Text.WordWrap - readOnly: true - textFormat: TextEdit.RichText + Components.About { Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: mainLayout.width - horizontalAlignment: Text.AlignHCenter - - color: Kirigami.Theme.textColor - selectedTextColor: Kirigami.Theme.highlightedTextColor - selectionColor: Kirigami.Theme.highlightColor - - onLinkActivated: (url) => Qt.openUrlExternally(url) - - HoverHandler { - acceptedButtons: Qt.NoButton - cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor - } } } diff --git a/src/plasmoid/package/contents/ui/components/About.qml b/src/plasmoid/package/contents/ui/components/About.qml new file mode 100644 index 0000000..fd27548 --- /dev/null +++ b/src/plasmoid/package/contents/ui/components/About.qml @@ -0,0 +1,115 @@ +import QtCore +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import org.kde.kirigami as Kirigami +import org.kde.plasma.plasma5support as P5Support + +RowLayout { + id: root + readonly property string ghUser: "luisbocanegra" + readonly property string projectName: "kde-material-you-colors" + readonly property string ghRepo: "https://github.com/"+ghUser+"/"+projectName + readonly property string kofi: "https://ko-fi.com/luisbocanegra" + readonly property string paypal: "https://www.paypal.com/donate/?hosted_button_id=Y5TMH3Z4YZRDA" + readonly property string email: "mailto:luisbocanegra17b@gmail.com" + readonly property string projects: "https://github.com/"+ghUser+"?tab=repositories&q=&type=source&language=&sort=stargazers" + readonly property string kdeStore: "https://store.kde.org/p/2136963" + + Menu { + id: menu + y: linksButton.height + x: linksButton.x + Action { + text: "Changelog" + onTriggered: Qt.openUrlExternally(ghRepo+"/blob/main/CHANGELOG.md") + icon.name: "view-calendar-list-symbolic" + } + Action { + text: "Releases" + onTriggered: Qt.openUrlExternally(ghRepo+"/releases") + icon.name: "update-none-symbolic" + } + + MenuSeparator { } + + Menu { + title: "Project page" + icon.name: "globe" + Action { + text: "GitHub" + onTriggered: Qt.openUrlExternally(ghRepo) + } + Action { + text: "KDE Store" + onTriggered: Qt.openUrlExternally(kdeStore) + } + } + + Menu { + title: "Issues" + icon.name: "project-open-symbolic" + Action { + text: "Current issues" + onTriggered: Qt.openUrlExternally(ghRepo+"/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen") + } + Action { + text: "Report a bug" + onTriggered: Qt.openUrlExternally(ghRepo+"/issues/new?assignees=&labels=bug&projects=&template=bug_report.md&title=%5BBug%5D%3A+") + } + Action { + text: "Request a feature" + onTriggered: Qt.openUrlExternally(ghRepo+"/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.md&title=%5BFeature+Request%5D%3A+") + } + } + + Menu { + title: "Help" + icon.name: "question-symbolic" + Action { + text: "Discussions" + onTriggered: Qt.openUrlExternally(ghRepo+"/discussions") + } + Action { + text: "Send an email" + onTriggered: Qt.openUrlExternally(email) + } + } + + Menu { + title: "Donate" + icon.name: "love" + Action { + text: "Ko-fi" + onTriggered: Qt.openUrlExternally(kofi) + } + Action { + text: "Paypal" + onTriggered: Qt.openUrlExternally(paypal) + } + Action { + text: "GitHub sponsors" + onTriggered: Qt.openUrlExternally("https://github.com/sponsors/"+ghUser) + } + } + + MenuSeparator { } + + Action { + text: "More projects" + onTriggered: Qt.openUrlExternally(projects) + icon.name: "starred-symbolic" + } + } + ToolButton { + icon.name: "application-menu" + id: linksButton + onClicked: { + if (menu.opened) { + menu.close() + } else { + menu.open() + } + } + } +}