diff --git a/quickshell/Modals/FileBrowser/FileBrowserContent.qml b/quickshell/Modals/FileBrowser/FileBrowserContent.qml index ff10bfa6..006a601b 100644 --- a/quickshell/Modals/FileBrowser/FileBrowserContent.qml +++ b/quickshell/Modals/FileBrowser/FileBrowserContent.qml @@ -201,6 +201,21 @@ FocusScope { keyboardSelectionRequested = true; } + function activateFile(path, name, isDir) { + if (isDir) { + navigateTo(path); + return; + } + if (saveMode) { + saveRow.fileName = name; + pendingFilePath = path; + showOverwriteConfirmation = true; + } else { + fileSelected(path); + closeRequested(); + } + } + function handleSaveFile(filePath) { var normalizedPath = filePath; if (!normalizedPath.startsWith("file://")) { @@ -652,6 +667,7 @@ FocusScope { Row { anchors.fill: parent + anchors.bottomMargin: root.saveMode ? 40 + Theme.spacingL * 2 : 0 spacing: 0 Row { @@ -756,12 +772,7 @@ FocusScope { onItemClicked: (index, path, name, isDir) => { selectedIndex = index; setSelectedFileData(path, name, isDir); - if (isDir) { - navigateTo(path); - } else { - fileSelected(path); - root.closeRequested(); - } + root.activateFile(path, name, isDir); } onItemSelected: (index, path, name, isDir) => { setSelectedFileData(path, name, isDir); @@ -776,12 +787,7 @@ FocusScope { root.keyboardSelectionRequested = false; selectedIndex = index; setSelectedFileData(filePath, fileName, fileIsDir); - if (fileIsDir) { - navigateTo(filePath); - } else { - fileSelected(filePath); - root.closeRequested(); - } + root.activateFile(filePath, fileName, fileIsDir); } } @@ -817,12 +823,7 @@ FocusScope { onItemClicked: (index, path, name, isDir) => { selectedIndex = index; setSelectedFileData(path, name, isDir); - if (isDir) { - navigateTo(path); - } else { - fileSelected(path); - root.closeRequested(); - } + root.activateFile(path, name, isDir); } onItemSelected: (index, path, name, isDir) => { setSelectedFileData(path, name, isDir); @@ -837,12 +838,7 @@ FocusScope { root.keyboardSelectionRequested = false; selectedIndex = index; setSelectedFileData(filePath, fileName, fileIsDir); - if (fileIsDir) { - navigateTo(filePath); - } else { - fileSelected(filePath); - root.closeRequested(); - } + root.activateFile(filePath, fileName, fileIsDir); } } @@ -855,6 +851,7 @@ FocusScope { } FileBrowserSaveRow { + id: saveRow anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right @@ -913,21 +910,21 @@ FocusScope { } } } + } - FileBrowserOverwriteDialog { - anchors.fill: parent - showDialog: showOverwriteConfirmation - pendingFilePath: root.pendingFilePath - onConfirmed: filePath => { - showOverwriteConfirmation = false; - fileSelected(filePath); - pendingFilePath = ""; - Qt.callLater(() => root.closeRequested()); - } - onCancelled: { - showOverwriteConfirmation = false; - pendingFilePath = ""; - } + FileBrowserOverwriteDialog { + anchors.fill: parent + showDialog: showOverwriteConfirmation + pendingFilePath: root.pendingFilePath + onConfirmed: filePath => { + showOverwriteConfirmation = false; + fileSelected(filePath); + pendingFilePath = ""; + Qt.callLater(() => root.closeRequested()); + } + onCancelled: { + showOverwriteConfirmation = false; + pendingFilePath = ""; } } diff --git a/quickshell/Modals/FileBrowser/FileBrowserOverwriteDialog.qml b/quickshell/Modals/FileBrowser/FileBrowserOverwriteDialog.qml index 4b686041..f9c7b005 100644 --- a/quickshell/Modals/FileBrowser/FileBrowserOverwriteDialog.qml +++ b/quickshell/Modals/FileBrowser/FileBrowserOverwriteDialog.qml @@ -74,7 +74,7 @@ Item { width: 80 height: 36 radius: Theme.cornerRadius - color: cancelArea.containsMouse ? Theme.surfaceVariantHover : Theme.surfaceVariant + color: cancelArea.containsMouse ? Qt.lighter(Theme.surfaceVariant, 1.2) : Theme.surfaceVariant border.color: Theme.outline border.width: 1 diff --git a/quickshell/Modals/FileBrowser/FileBrowserSaveRow.qml b/quickshell/Modals/FileBrowser/FileBrowserSaveRow.qml index a47f4b50..b2a17e5d 100644 --- a/quickshell/Modals/FileBrowser/FileBrowserSaveRow.qml +++ b/quickshell/Modals/FileBrowser/FileBrowserSaveRow.qml @@ -8,6 +8,7 @@ Row { property bool saveMode: false property string defaultFileName: "" property string currentPath: "" + property alias fileName: fileNameInput.text signal saveRequested(string filePath) diff --git a/quickshell/Modules/Notepad/Notepad.qml b/quickshell/Modules/Notepad/Notepad.qml index 092ac2dd..912b029e 100644 --- a/quickshell/Modules/Notepad/Notepad.qml +++ b/quickshell/Modules/Notepad/Notepad.qml @@ -44,6 +44,12 @@ Item { service: NotepadStorageService } + // In connected frame mode the slideout sits on the Overlay layer + onFileDialogOpenChanged: { + if (slideout) + slideout.suppressOverlayLayer = fileDialogOpen; + } + Connections { target: slideout enabled: slideout !== null diff --git a/quickshell/Widgets/DankSlideout.qml b/quickshell/Widgets/DankSlideout.qml index 5f5a954d..fb583260 100644 --- a/quickshell/Widgets/DankSlideout.qml +++ b/quickshell/Widgets/DankSlideout.qml @@ -16,6 +16,8 @@ PanelWindow { property var targetScreen: null property var modelData: null property bool triggerUsesOverlayLayer: false + // Drop off the Overlay layer (back to Top) while an overlay modal + property bool suppressOverlayLayer: false property real slideoutWidth: 480 property bool expandable: false property bool expandedWidth: false @@ -67,7 +69,7 @@ PanelWindow { readonly property bool slideoutBlurActive: root.visible && BlurService.enabled && Theme.connectedSurfaceBlurEnabled - WlrLayershell.layer: (triggerUsesOverlayLayer || CompositorService.framePeerSurfacesUseOverlayForScreen(modelData)) ? WlrLayershell.Overlay : WlrLayershell.Top + WlrLayershell.layer: (!suppressOverlayLayer && (triggerUsesOverlayLayer || CompositorService.framePeerSurfacesUseOverlayForScreen(modelData))) ? WlrLayershell.Overlay : WlrLayershell.Top WlrLayershell.exclusiveZone: 0 WlrLayershell.keyboardFocus: isVisible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None