1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-05-15 08:42:47 -04:00

modals: fix sub-modals and power menu keyboard focus in connected mode

fixes #2346
This commit is contained in:
bbedward
2026-05-04 10:38:49 -04:00
parent 31e60a3df5
commit cc47703d48
2 changed files with 13 additions and 9 deletions
@@ -38,7 +38,7 @@ Item {
readonly property string resolvedConnectedBarSide: frameConnectedMode ? preferredConnectedBarSide : "" readonly property string resolvedConnectedBarSide: frameConnectedMode ? preferredConnectedBarSide : ""
readonly property bool frameOwnsConnectedChrome: frameConnectedMode && resolvedConnectedBarSide !== "" readonly property bool frameOwnsConnectedChrome: frameConnectedMode && resolvedConnectedBarSide !== "" && !allowStacking
function _dockOccupiesSide(side) { function _dockOccupiesSide(side) {
if (!SettingsData.showDock) if (!SettingsData.showDock)
@@ -200,10 +200,10 @@ Item {
} }
function _releaseModalChrome() { function _releaseModalChrome() {
if (_chromeClaimId) { if (!_chromeClaimId)
ConnectedModeState.releaseDockRetract(_chromeClaimId); return;
_chromeClaimId = ""; ConnectedModeState.releaseDockRetract(_chromeClaimId);
} _chromeClaimId = "";
const screenName = _currentScreenName(); const screenName = _currentScreenName();
if (screenName) if (screenName)
ConnectedModeState.clearModalState(screenName); ConnectedModeState.clearModalState(screenName);
+8 -4
View File
@@ -259,20 +259,24 @@ DankModal {
cancelHold(); cancelHold();
close(); close();
} }
onOpened: () => { onShouldBeVisibleChanged: {
if (!shouldBeVisible)
return;
holdAction = ""; holdAction = "";
holdActionIndex = -1; holdActionIndex = -1;
holdProgress = 0; holdProgress = 0;
showHoldHint = false; showHoldHint = false;
updateVisibleActions(); updateVisibleActions();
const defaultIndex = getDefaultActionIndex(); const defaultIndex = getDefaultActionIndex();
selectedIndex = defaultIndex;
if (SettingsData.powerMenuGridLayout) { if (SettingsData.powerMenuGridLayout) {
selectedRow = Math.floor(defaultIndex / gridColumns); selectedRow = Math.floor(defaultIndex / gridColumns);
selectedCol = defaultIndex % gridColumns; selectedCol = defaultIndex % gridColumns;
selectedIndex = defaultIndex;
} else {
selectedIndex = defaultIndex;
} }
}
onShouldHaveFocusChanged: {
if (!shouldHaveFocus)
return;
Qt.callLater(() => modalFocusScope.forceActiveFocus()); Qt.callLater(() => modalFocusScope.forceActiveFocus());
} }
onDialogClosed: () => { onDialogClosed: () => {