mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-15 15:54:00 -04:00
settings: add a link to the source code in plugin details (#3690)
* settings: add a link to the source code in plugin details * style: remove unnecessary whitespace, add empty line * show link to the plugin source instead of explanation * fix: check for empty string instead of undefined
This commit is contained in:
@@ -22,6 +22,7 @@ FocusScope {
|
||||
readonly property bool hasSettings: !!pluginData?.settings && !isDesktopPlugin
|
||||
readonly property bool isSystemPlugin: pluginData?.source === "system"
|
||||
readonly property string pluginName: pluginData?.name || pluginId
|
||||
readonly property string pluginRepo: DMSService.installedPlugins.find(entry => entry.id === pluginId)?.repo ?? ""
|
||||
readonly property string requiresDms: pluginData?.requires_dms || ""
|
||||
readonly property bool meetsRequirements: requiresDms ? PluginService.checkPluginCompatibility(requiresDms) : true
|
||||
readonly property var permissions: Array.isArray(pluginData?.permissions) ? pluginData.permissions : []
|
||||
@@ -239,6 +240,22 @@ FocusScope {
|
||||
visible: subtitle !== ""
|
||||
}
|
||||
|
||||
SettingsRow {
|
||||
iconName: "code"
|
||||
title: I18n.tr("Plugin Source Code", "plugin settings page, plugin details")
|
||||
subtitle: I18n.tr("Opens %1", "plugin settings page, plugin details, %1 is the link to the plugin source code").arg(root.pluginRepo)
|
||||
clickable: true
|
||||
visible: root.pluginRepo !== ""
|
||||
onClicked: Qt.openUrlExternally(root.pluginRepo)
|
||||
|
||||
DankIcon {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
name: "open_in_browser"
|
||||
size: Theme.iconSizeMedium
|
||||
color: Theme.primary
|
||||
}
|
||||
}
|
||||
|
||||
SettingsRow {
|
||||
visible: root.permissions.length > 0
|
||||
body: Flow {
|
||||
|
||||
Reference in New Issue
Block a user