Skip to content

Commit

Permalink
feat: add project urls to about section
Browse files Browse the repository at this point in the history
  • Loading branch information
luisbocanegra committed Jan 6, 2025
1 parent c9f8393 commit 682f7e9
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/plasmoid/package/contents/ui/FullRepresentation.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -2076,25 +2077,8 @@ ColumnLayout {
Layout.alignment: Qt.AlignHCenter
}

TextEdit {
text: "If you like the project you can leave a review in <a href='https://store.kde.org/p/2136963'>KDE Store</a> or give it a star on <a href='https://github.com/luisbocanegra/kde-material-you-colors'>Github</a>. For bugs and feature requests please go to the <a href='https://github.com/luisbocanegra/kde-material-you-colors/issues'>issues page</a>."
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
}
}
}

Expand Down
115 changes: 115 additions & 0 deletions src/plasmoid/package/contents/ui/components/About.qml
Original file line number Diff line number Diff line change
@@ -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:[email protected]"
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()
}
}
}
}

0 comments on commit 682f7e9

Please sign in to comment.