mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-28 22:12:10 -04:00
plugins: fix plugin browser parentWindow and add similar support
This commit is contained in:
@@ -18,7 +18,7 @@ FloatingWindow {
|
||||
property bool keyboardNavigationActive: false
|
||||
property bool isLoading: false
|
||||
property var parentModal: null
|
||||
parentWindow: null
|
||||
parentWindow: parentModal
|
||||
property bool pendingInstallHandled: false
|
||||
property string typeFilter: ""
|
||||
property string categoryFilter: "all"
|
||||
@@ -126,6 +126,25 @@ FloatingWindow {
|
||||
}
|
||||
}
|
||||
|
||||
function relatedNames(plugin) {
|
||||
if (!plugin || !plugin.similar || plugin.similar.length === 0)
|
||||
return [];
|
||||
|
||||
var names = [];
|
||||
for (var i = 0; i < plugin.similar.length; i++) {
|
||||
var id = plugin.similar[i];
|
||||
var name = id;
|
||||
for (var j = 0; j < allPlugins.length; j++) {
|
||||
if (allPlugins[j].id === id) {
|
||||
name = allPlugins[j].name || id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
names.push(name);
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
function comparePluginAuthor(a, b) {
|
||||
var authorA = (a.author || "").toLowerCase() || "zzz";
|
||||
var authorB = (b.author || "").toLowerCase() || "zzz";
|
||||
@@ -1076,6 +1095,15 @@ FloatingWindow {
|
||||
propagateComposedEvents: true
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
visible: root.relatedNames(modelData).length > 0
|
||||
text: I18n.tr("Related: %1", "related plugins").arg(root.relatedNames(modelData).join(", "))
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.outline
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
||||
Reference in New Issue
Block a user