From aabb0ffcc5e9b9c3116ccd3ef912c3d83df4d15e Mon Sep 17 00:00:00 2001 From: bbedward Date: Thu, 24 Jul 2025 19:55:41 -0400 Subject: [PATCH] filebrowser: bug fixes --- Modals/FileBrowserModal.qml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Modals/FileBrowserModal.qml b/Modals/FileBrowserModal.qml index 5f304640..7f49dda4 100644 --- a/Modals/FileBrowserModal.qml +++ b/Modals/FileBrowserModal.qml @@ -95,12 +95,13 @@ DankModal { var lastSlash = path.lastIndexOf('/'); if (lastSlash > 0) { var newPath = path.substring(0, lastSlash); - if (newPath.startsWith(homeDir)) { - currentPath = newPath; - saveLastPath(newPath); - } else { + // Don't go above home directory + if (newPath.length < homeDir.length) { currentPath = homeDir; saveLastPath(homeDir); + } else { + currentPath = newPath; + saveLastPath(newPath); } } } @@ -184,9 +185,10 @@ DankModal { } StyledText { - text: "Current folder: " + fileBrowserModal.currentPath - font.pixelSize: Theme.fontSizeSmall - color: Theme.surfaceVariantText + text: fileBrowserModal.currentPath.replace("file://", "") + font.pixelSize: Theme.fontSizeMedium + color: Theme.surfaceText + font.weight: Font.Medium width: parent.width - 40 - Theme.spacingS elide: Text.ElideMiddle anchors.verticalCenter: parent.verticalCenter