summaryrefslogtreecommitdiff
path: root/raveos-hyprland-theme/theme-data/dms/Modals/FileBrowser/FileBrowserNavigation.qml
diff options
context:
space:
mode:
authorNippy <nippy@rp1.hu>2026-05-08 19:50:49 +0200
committerNippy <nippy@rp1.hu>2026-05-08 19:50:49 +0200
commit3462bcc46ecf74f576ea4397f16492c16bd75b10 (patch)
treec5ab7aef4498647e057bda8d49c11e5f9dda74c9 /raveos-hyprland-theme/theme-data/dms/Modals/FileBrowser/FileBrowserNavigation.qml
parent56616f693b4f263cbf0d47da43b67424efa6022d (diff)
downloadRaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.tar.gz
RaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.zip
raveos update
Diffstat (limited to 'raveos-hyprland-theme/theme-data/dms/Modals/FileBrowser/FileBrowserNavigation.qml')
-rw-r--r--raveos-hyprland-theme/theme-data/dms/Modals/FileBrowser/FileBrowserNavigation.qml130
1 files changed, 130 insertions, 0 deletions
diff --git a/raveos-hyprland-theme/theme-data/dms/Modals/FileBrowser/FileBrowserNavigation.qml b/raveos-hyprland-theme/theme-data/dms/Modals/FileBrowser/FileBrowserNavigation.qml
new file mode 100644
index 0000000..61ce7b6
--- /dev/null
+++ b/raveos-hyprland-theme/theme-data/dms/Modals/FileBrowser/FileBrowserNavigation.qml
@@ -0,0 +1,130 @@
+import QtQuick
+import qs.Common
+import qs.Widgets
+
+Row {
+ id: navigation
+
+ property string currentPath: ""
+ property string homeDir: ""
+ property bool backButtonFocused: false
+ property bool keyboardNavigationActive: false
+ property bool showSidebar: true
+ property bool pathEditMode: false
+ property bool pathInputHasFocus: false
+
+ signal navigateUp()
+ signal navigateTo(string path)
+ signal pathInputFocusChanged(bool hasFocus)
+
+ height: 40
+ leftPadding: Theme.spacingM
+ rightPadding: Theme.spacingM
+ spacing: Theme.spacingS
+
+ StyledRect {
+ width: 32
+ height: 32
+ radius: Theme.cornerRadius
+ color: (backButtonMouseArea.containsMouse || (backButtonFocused && keyboardNavigationActive)) && currentPath !== homeDir ? Theme.surfaceVariant : "transparent"
+ opacity: currentPath !== homeDir ? 1 : 0
+ anchors.verticalCenter: parent.verticalCenter
+
+ DankIcon {
+ anchors.centerIn: parent
+ name: "arrow_back"
+ size: Theme.iconSizeSmall
+ color: Theme.surfaceText
+ }
+
+ MouseArea {
+ id: backButtonMouseArea
+
+ anchors.fill: parent
+ hoverEnabled: currentPath !== homeDir
+ cursorShape: currentPath !== homeDir ? Qt.PointingHandCursor : Qt.ArrowCursor
+ enabled: currentPath !== homeDir
+ onClicked: navigation.navigateUp()
+ }
+ }
+
+ Item {
+ width: Math.max(0, (parent?.width ?? 0) - 40 - Theme.spacingS - (showSidebar ? 0 : 80))
+ height: 32
+ anchors.verticalCenter: parent.verticalCenter
+
+ StyledRect {
+ anchors.fill: parent
+ radius: Theme.cornerRadius
+ color: pathEditMode ? Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency) : "transparent"
+ border.color: pathEditMode ? Theme.primary : "transparent"
+ border.width: pathEditMode ? 1 : 0
+ visible: !pathEditMode
+
+ StyledText {
+ id: pathDisplay
+ text: currentPath.replace("file://", "")
+ font.pixelSize: Theme.fontSizeMedium
+ color: Theme.surfaceText
+ font.weight: Font.Medium
+ anchors.fill: parent
+ anchors.leftMargin: Theme.spacingS
+ anchors.rightMargin: Theme.spacingS
+ elide: Text.ElideMiddle
+ verticalAlignment: Text.AlignVCenter
+ maximumLineCount: 1
+ wrapMode: Text.NoWrap
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ cursorShape: Qt.IBeamCursor
+ onClicked: {
+ pathEditMode = true
+ pathInput.text = currentPath.replace("file://", "")
+ Qt.callLater(() => pathInput.forceActiveFocus())
+ }
+ }
+ }
+
+ DankTextField {
+ id: pathInput
+ anchors.fill: parent
+ visible: pathEditMode
+ topPadding: Theme.spacingXS
+ bottomPadding: Theme.spacingXS
+ onAccepted: {
+ const newPath = text.trim()
+ if (newPath !== "") {
+ navigation.navigateTo(newPath)
+ }
+ pathEditMode = false
+ }
+ Keys.onEscapePressed: {
+ pathEditMode = false
+ }
+ Keys.onDownPressed: {
+ pathEditMode = false
+ }
+ onActiveFocusChanged: {
+ navigation.pathInputFocusChanged(activeFocus)
+ if (!activeFocus && pathEditMode) {
+ pathEditMode = false
+ }
+ }
+ }
+ }
+
+ Row {
+ spacing: Theme.spacingXS
+ visible: !showSidebar
+ anchors.verticalCenter: parent.verticalCenter
+
+ DankActionButton {
+ circular: false
+ iconName: "sort"
+ iconSize: Theme.iconSize - 6
+ iconColor: Theme.surfaceText
+ }
+ }
+}