mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-07 22:15:38 -05:00
dock: hide pin to dock for internal windows
This commit is contained in:
@@ -276,7 +276,8 @@ Item {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (contextMenu) {
|
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();
|
appData?.toplevel?.close();
|
||||||
} else if (appData?.type === "grouped") {
|
} else if (appData?.type === "grouped") {
|
||||||
if (contextMenu) {
|
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) {
|
} else if (appData && appData.appId) {
|
||||||
const desktopEntry = cachedDesktopEntry;
|
const desktopEntry = cachedDesktopEntry;
|
||||||
@@ -302,7 +304,8 @@ Item {
|
|||||||
}
|
}
|
||||||
} else if (mouse.button === Qt.RightButton) {
|
} else if (mouse.button === Qt.RightButton) {
|
||||||
if (contextMenu && appData) {
|
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 {
|
} else {
|
||||||
console.warn("No context menu or appData available");
|
console.warn("No context menu or appData available");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ PanelWindow {
|
|||||||
property int margin: 10
|
property int margin: 10
|
||||||
property bool hidePin: false
|
property bool hidePin: false
|
||||||
property var desktopEntry: null
|
property var desktopEntry: null
|
||||||
|
property bool isDmsWindow: appData?.appId === "org.quickshell"
|
||||||
|
|
||||||
function showForButton(button, data, dockHeight, hidePinOption, entry, dockScreen) {
|
function showForButton(button, data, dockHeight, hidePinOption, entry, dockScreen) {
|
||||||
if (dockScreen) {
|
if (dockScreen) {
|
||||||
@@ -351,7 +352,12 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
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
|
width: parent.width
|
||||||
height: 1
|
height: 1
|
||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
||||||
@@ -398,14 +404,20 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
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
|
width: parent.width
|
||||||
height: 1
|
height: 1
|
||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
visible: root.desktopEntry && SessionService.hasPrimeRun
|
visible: !root.isDmsWindow && root.desktopEntry && SessionService.hasPrimeRun
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 28
|
height: 28
|
||||||
radius: Theme.cornerRadius
|
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 {
|
Rectangle {
|
||||||
visible: root.appData && (root.appData.type === "window" || (root.appData.type === "grouped" && root.appData.windowCount > 0))
|
visible: root.appData && (root.appData.type === "window" || (root.appData.type === "grouped" && root.appData.windowCount > 0))
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
Reference in New Issue
Block a user