mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-01 19:18:28 -04:00
@@ -25,20 +25,19 @@ Item {
|
|||||||
required property var windowRuleModalLoader
|
required property var windowRuleModalLoader
|
||||||
|
|
||||||
function getPreferredBar(refPropertyName) {
|
function getPreferredBar(refPropertyName) {
|
||||||
if (!root.dankBarRepeater || root.dankBarRepeater.count === 0)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
const focusedScreenName = BarWidgetService.getFocusedScreenName();
|
const focusedScreenName = BarWidgetService.getFocusedScreenName();
|
||||||
|
|
||||||
const loaders = Array.from({
|
const bars = [];
|
||||||
length: root.dankBarRepeater.count
|
if (root.dankBarRepeater) {
|
||||||
}, (_, i) => root.dankBarRepeater.itemAt(i));
|
for (let i = 0; i < root.dankBarRepeater.count; i++)
|
||||||
|
bars.push(...(root.dankBarRepeater.itemAt(i)?.item?.barVariants?.instances || []));
|
||||||
|
}
|
||||||
|
const frameBars = BarWidgetService.frameHostedBars;
|
||||||
|
for (const screenName in frameBars)
|
||||||
|
bars.push(frameBars[screenName]);
|
||||||
|
|
||||||
let currentBar = null;
|
let currentBar = null;
|
||||||
|
for (const bar of bars) {
|
||||||
for (const loader of loaders) {
|
|
||||||
const instances = loader?.item?.barVariants?.instances || [];
|
|
||||||
for (const bar of instances) {
|
|
||||||
if (!bar)
|
if (!bar)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -52,7 +51,6 @@ Item {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return currentBar;
|
return currentBar;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user