mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-05 21:18:30 -04:00
keybinds: add toggle to switch to FloatingWindow and back
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import QtQml
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Modals
|
||||
import qs.Modals.Common
|
||||
import qs.Services
|
||||
|
||||
DankModal {
|
||||
id: overlay
|
||||
|
||||
signal floatingToggleRequested
|
||||
|
||||
layerNamespace: "dms:keybinds"
|
||||
useOverlayLayer: true
|
||||
property real _maxW: Math.min(overlay.screenWidth * 0.92, 1200)
|
||||
property real _maxH: Math.min(overlay.screenHeight * 0.92, 900)
|
||||
modalWidth: _maxW
|
||||
modalHeight: _maxH
|
||||
onBackgroundClicked: close()
|
||||
onOpened: {
|
||||
Qt.callLater(() => {
|
||||
modalFocusScope.forceActiveFocus();
|
||||
if (contentLoader.item?.searchField)
|
||||
contentLoader.item.searchField.forceActiveFocus();
|
||||
});
|
||||
if (!Object.keys(KeybindsService.cheatsheet).length && KeybindsService.cheatsheetAvailable)
|
||||
KeybindsService.loadCheatsheet();
|
||||
}
|
||||
|
||||
content: Component {
|
||||
KeybindsContent {
|
||||
showFloatingToggle: true
|
||||
floating: false
|
||||
onCloseRequested: overlay.close()
|
||||
onFloatingToggleRequested: overlay.floatingToggleRequested()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user