1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

dock: hide pin to dock for internal windows

This commit is contained in:
bbedward
2025-11-23 22:55:47 -05:00
parent 2db79ef202
commit d3194e15e2
2 changed files with 21 additions and 13 deletions

View File

@@ -276,7 +276,8 @@ Item {
}
} else {
if (contextMenu) {
contextMenu.showForButton(root, appData, root.height + 25, true, cachedDesktopEntry, parentDockScreen);
const shouldHidePin = appData.appId === "org.quickshell";
contextMenu.showForButton(root, appData, root.height + 25, shouldHidePin, cachedDesktopEntry, parentDockScreen);
}
}
}
@@ -285,7 +286,8 @@ Item {
appData?.toplevel?.close();
} else if (appData?.type === "grouped") {
if (contextMenu) {
contextMenu.showForButton(root, appData, root.height, false, cachedDesktopEntry, parentDockScreen);
const shouldHidePin = appData.appId === "org.quickshell";
contextMenu.showForButton(root, appData, root.height, shouldHidePin, cachedDesktopEntry, parentDockScreen);
}
} else if (appData && appData.appId) {
const desktopEntry = cachedDesktopEntry;
@@ -302,7 +304,8 @@ Item {
}
} else if (mouse.button === Qt.RightButton) {
if (contextMenu && appData) {
contextMenu.showForButton(root, appData, root.height, false, cachedDesktopEntry, parentDockScreen);
const shouldHidePin = appData.appId === "org.quickshell";
contextMenu.showForButton(root, appData, root.height, shouldHidePin, cachedDesktopEntry, parentDockScreen);
} else {
console.warn("No context menu or appData available");
}

View File

@@ -18,6 +18,7 @@ PanelWindow {
property int margin: 10
property bool hidePin: false
property var desktopEntry: null
property bool isDmsWindow: appData?.appId === "org.quickshell"
function showForButton(button, data, dockHeight, hidePinOption, entry, dockScreen) {
if (dockScreen) {
@@ -351,7 +352,12 @@ PanelWindow {
}
Rectangle {
visible: root.desktopEntry && root.desktopEntry.actions && root.desktopEntry.actions.length > 0
visible: {
if (!root.desktopEntry?.actions || root.desktopEntry.actions.length === 0) {
return false
}
return !root.hidePin || (!root.isDmsWindow && root.desktopEntry && SessionService.hasPrimeRun)
}
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
@@ -398,14 +404,20 @@ PanelWindow {
}
Rectangle {
visible: (root.appData && root.appData.type === "window") || (root.desktopEntry && SessionService.hasPrimeRun)
visible: {
const hasPrimeRun = !root.isDmsWindow && root.desktopEntry && SessionService.hasPrimeRun
const hasWindow = root.appData && (root.appData.type === "window" || (root.appData.type === "grouped" && root.appData.windowCount > 0))
const hasPinOption = !root.hidePin
const hasContentAbove = hasPinOption || hasPrimeRun
return hasContentAbove && hasWindow
}
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
}
Rectangle {
visible: root.desktopEntry && SessionService.hasPrimeRun
visible: !root.isDmsWindow && root.desktopEntry && SessionService.hasPrimeRun
width: parent.width
height: 28
radius: Theme.cornerRadius
@@ -439,13 +451,6 @@ PanelWindow {
}
}
Rectangle {
visible: root.appData && (root.appData.type === "window" || (root.appData.type === "grouped" && root.appData.windowCount > 0))
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
}
Rectangle {
visible: root.appData && (root.appData.type === "window" || (root.appData.type === "grouped" && root.appData.windowCount > 0))
width: parent.width