mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-12 00:32:17 -04:00
@@ -36,8 +36,17 @@ Item {
|
|||||||
return !hiddenTrayIds.includes(itemId.toLowerCase());
|
return !hiddenTrayIds.includes(itemId.toLowerCase());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
readonly property var mainBarItems: allTrayItems.filter(item => !SessionData.isHiddenTrayId(item?.id || ""))
|
function getTrayItemKey(item) {
|
||||||
readonly property var hiddenBarItems: allTrayItems.filter(item => SessionData.isHiddenTrayId(item?.id || ""))
|
const id = item?.id || "";
|
||||||
|
const tooltipTitle = item?.tooltipTitle || "";
|
||||||
|
if (!tooltipTitle || tooltipTitle === id) {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
return `${id}::${tooltipTitle}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property var mainBarItems: allTrayItems.filter(item => !SessionData.isHiddenTrayId(root.getTrayItemKey(item)))
|
||||||
|
readonly property var hiddenBarItems: allTrayItems.filter(item => SessionData.isHiddenTrayId(root.getTrayItemKey(item)))
|
||||||
readonly property bool hasHiddenItems: allTrayItems.length > mainBarItems.length
|
readonly property bool hasHiddenItems: allTrayItems.length > mainBarItems.length
|
||||||
readonly property int calculatedSize: {
|
readonly property int calculatedSize: {
|
||||||
if (allTrayItems.length === 0)
|
if (allTrayItems.length === 0)
|
||||||
@@ -1226,7 +1235,7 @@ Item {
|
|||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: Theme.spacingS
|
anchors.rightMargin: Theme.spacingS
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
name: SessionData.isHiddenTrayId(menuRoot.trayItem?.id || "") ? "visibility" : "visibility_off"
|
name: SessionData.isHiddenTrayId(root.getTrayItemKey(menuRoot.trayItem)) ? "visibility" : "visibility_off"
|
||||||
size: 16
|
size: 16
|
||||||
color: Theme.widgetTextColor
|
color: Theme.widgetTextColor
|
||||||
}
|
}
|
||||||
@@ -1237,13 +1246,13 @@ Item {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
const itemId = menuRoot.trayItem?.id || "";
|
const itemKey = root.getTrayItemKey(menuRoot.trayItem);
|
||||||
if (!itemId)
|
if (!itemKey)
|
||||||
return;
|
return;
|
||||||
if (SessionData.isHiddenTrayId(itemId)) {
|
if (SessionData.isHiddenTrayId(itemKey)) {
|
||||||
SessionData.showTrayId(itemId);
|
SessionData.showTrayId(itemKey);
|
||||||
} else {
|
} else {
|
||||||
SessionData.hideTrayId(itemId);
|
SessionData.hideTrayId(itemKey);
|
||||||
}
|
}
|
||||||
menuRoot.closeWithAction();
|
menuRoot.closeWithAction();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user