1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -05:00

windows: dont close on esc

fixes #911
This commit is contained in:
bbedward
2025-12-08 14:02:58 -05:00
parent 64d5e99b9d
commit b7062fe40c
4 changed files with 3 additions and 12 deletions

View File

@@ -46,6 +46,7 @@ FocusScope {
property bool pathInputHasFocus: false
property int actualGridColumns: 5
property bool _initialized: false
property bool closeOnEscape: true
signal fileSelected(string path)
signal closeRequested
@@ -298,7 +299,7 @@ FocusScope {
property int gridColumns: viewMode === "list" ? 1 : Math.max(1, actualGridColumns)
function handleKey(event) {
if (event.key === Qt.Key_Escape) {
if (event.key === Qt.Key_Escape && root.closeOnEscape) {
closeRequested();
event.accepted = true;
return;

View File

@@ -59,6 +59,7 @@ FloatingWindow {
id: content
anchors.fill: parent
focus: true
closeOnEscape: false
browserTitle: fileBrowserModal.browserTitle
browserIcon: fileBrowserModal.browserIcon

View File

@@ -112,12 +112,6 @@ FloatingWindow {
focus: true
Keys.onPressed: event => {
if (event.key === Qt.Key_Escape) {
hide();
event.accepted = true;
return;
}
switch (event.key) {
case Qt.Key_1:
currentTab = 0;

View File

@@ -139,11 +139,6 @@ FloatingWindow {
focus: true
Keys.onPressed: event => {
if (event.key === Qt.Key_Escape) {
hide();
event.accepted = true;
return;
}
if (event.key === Qt.Key_Down || (event.key === Qt.Key_Tab && !event.modifiers)) {
sidebar.navigateNext();
event.accepted = true;