mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 15:32:50 -05:00
Fix variant plugins in center section
This commit is contained in:
@@ -308,8 +308,10 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For plugin components, get from PluginService
|
// For plugin components, get from PluginService
|
||||||
let pluginMap = PluginService.getWidgetComponents()
|
var parts = widgetId.split(":")
|
||||||
return pluginMap[widgetId] || null
|
var pluginId = parts[0]
|
||||||
|
let pluginComponents = PluginService.getWidgetComponents()
|
||||||
|
return pluginComponents[pluginId] || null
|
||||||
}
|
}
|
||||||
|
|
||||||
height: parent.height
|
height: parent.height
|
||||||
@@ -397,8 +399,18 @@ Item {
|
|||||||
|
|
||||||
// Inject PluginService for plugin widgets
|
// Inject PluginService for plugin widgets
|
||||||
if (item.pluginService !== undefined) {
|
if (item.pluginService !== undefined) {
|
||||||
|
var parts = model.widgetId.split(":")
|
||||||
|
var pluginId = parts[0]
|
||||||
|
var variantId = parts.length > 1 ? parts[1] : null
|
||||||
|
|
||||||
if (item.pluginId !== undefined) {
|
if (item.pluginId !== undefined) {
|
||||||
item.pluginId = model.widgetId
|
item.pluginId = pluginId
|
||||||
|
}
|
||||||
|
if (item.variantId !== undefined) {
|
||||||
|
item.variantId = variantId
|
||||||
|
}
|
||||||
|
if (item.variantData !== undefined && variantId) {
|
||||||
|
item.variantData = PluginService.getPluginVariantData(pluginId, variantId)
|
||||||
}
|
}
|
||||||
item.pluginService = PluginService
|
item.pluginService = PluginService
|
||||||
}
|
}
|
||||||
@@ -430,8 +442,8 @@ Item {
|
|||||||
// Force refresh of component lookups
|
// Force refresh of component lookups
|
||||||
for (var i = 0; i < centerRepeater.count; i++) {
|
for (var i = 0; i < centerRepeater.count; i++) {
|
||||||
var item = centerRepeater.itemAt(i)
|
var item = centerRepeater.itemAt(i)
|
||||||
if (item && item.widgetId === pluginId) {
|
if (item && item.widgetId.startsWith(pluginId)) {
|
||||||
item.sourceComponent = root.getWidgetComponent(pluginId)
|
item.sourceComponent = root.getWidgetComponent(item.widgetId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -439,8 +451,8 @@ Item {
|
|||||||
// Force refresh of component lookups
|
// Force refresh of component lookups
|
||||||
for (var i = 0; i < centerRepeater.count; i++) {
|
for (var i = 0; i < centerRepeater.count; i++) {
|
||||||
var item = centerRepeater.itemAt(i)
|
var item = centerRepeater.itemAt(i)
|
||||||
if (item && item.widgetId === pluginId) {
|
if (item && item.widgetId.startsWith(pluginId)) {
|
||||||
item.sourceComponent = root.getWidgetComponent(pluginId)
|
item.sourceComponent = root.getWidgetComponent(item.widgetId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user