1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-07 22:15:38 -05:00

Fix launcher context menu sizing

This commit is contained in:
bbedward
2025-10-10 13:42:55 -04:00
parent bc6577fe18
commit ba49654a64
3 changed files with 19 additions and 12 deletions

View File

@@ -68,9 +68,11 @@ DankModal {
} }
} }
onOpened: { onOpened: {
Qt.callLater(function () {
modalFocusScope.forceActiveFocus() modalFocusScope.forceActiveFocus()
modalFocusScope.focus = true modalFocusScope.focus = true
shouldHaveFocus = true shouldHaveFocus = true
})
} }
modalFocusScope.Keys.onPressed: function (event) { modalFocusScope.Keys.onPressed: function (event) {
switch (event.key) { switch (event.key) {

View File

@@ -77,12 +77,14 @@ Popup {
spacing: 1 spacing: 1
Rectangle { Rectangle {
width: parent.width implicitWidth: pinRow.implicitWidth + Theme.spacingS * 2
width: implicitWidth
height: 32 height: 32
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: pinMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent" color: pinMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
Row { Row {
id: pinRow
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Theme.spacingS anchors.leftMargin: Theme.spacingS
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@@ -155,16 +157,16 @@ Popup {
model: contextMenu.currentApp && contextMenu.currentApp.desktopEntry && contextMenu.currentApp.desktopEntry.actions ? contextMenu.currentApp.desktopEntry.actions : [] model: contextMenu.currentApp && contextMenu.currentApp.desktopEntry && contextMenu.currentApp.desktopEntry.actions ? contextMenu.currentApp.desktopEntry.actions : []
Rectangle { Rectangle {
width: parent.width implicitWidth: actionRow.implicitWidth + Theme.spacingS * 2
width: implicitWidth
height: 32 height: 32
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: actionMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent" color: actionMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
Row { Row {
id: actionRow
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Theme.spacingS anchors.leftMargin: Theme.spacingS
anchors.right: parent.right
anchors.rightMargin: Theme.spacingS
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: Theme.spacingS spacing: Theme.spacingS
@@ -189,8 +191,6 @@ Popup {
color: Theme.surfaceText color: Theme.surfaceText
font.weight: Font.Normal font.weight: Font.Normal
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
elide: Text.ElideRight
width: parent.width - (modelData.icon && modelData.icon !== "" ? (Theme.iconSize - 2 + Theme.spacingS) : 0)
} }
} }
@@ -228,12 +228,14 @@ Popup {
} }
Rectangle { Rectangle {
width: parent.width implicitWidth: launchRow.implicitWidth + Theme.spacingS * 2
width: implicitWidth
height: 32 height: 32
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: launchMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent" color: launchMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
Row { Row {
id: launchRow
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Theme.spacingS anchors.leftMargin: Theme.spacingS
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@@ -288,12 +290,14 @@ Popup {
Rectangle { Rectangle {
visible: SessionService.hasPrimeRun visible: SessionService.hasPrimeRun
width: parent.width implicitWidth: primeRunRow.implicitWidth + Theme.spacingS * 2
width: implicitWidth
height: 32 height: 32
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: primeRunMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent" color: primeRunMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
Row { Row {
id: primeRunRow
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Theme.spacingS anchors.leftMargin: Theme.spacingS
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter

View File

@@ -800,12 +800,13 @@ DankPopout {
model: contextMenu.currentApp && contextMenu.currentApp.desktopEntry && contextMenu.currentApp.desktopEntry.actions ? contextMenu.currentApp.desktopEntry.actions : [] model: contextMenu.currentApp && contextMenu.currentApp.desktopEntry && contextMenu.currentApp.desktopEntry.actions ? contextMenu.currentApp.desktopEntry.actions : []
Rectangle { Rectangle {
width: parent.width width: Math.max(parent.width, actionRow.implicitWidth + Theme.spacingS * 2)
height: 32 height: 32
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: actionMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent" color: actionMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
Row { Row {
id: actionRow
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Theme.spacingS anchors.leftMargin: Theme.spacingS
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter