From 2c8f76ba09c92f1703ecfd813efe6ef1340850b2 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 19 Jul 2025 23:04:32 +1000 Subject: filedialog: navigation --- widgets/filedialog/HeaderBar.qml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'widgets/filedialog/HeaderBar.qml') diff --git a/widgets/filedialog/HeaderBar.qml b/widgets/filedialog/HeaderBar.qml index 40177a3..077bd29 100644 --- a/widgets/filedialog/HeaderBar.qml +++ b/widgets/filedialog/HeaderBar.qml @@ -9,7 +9,7 @@ import QtQuick.Layouts RowLayout { id: root - required property list cwd + required property var dialog spacing: Appearance.spacing.small @@ -21,7 +21,7 @@ RowLayout { radius: Appearance.rounding.small function onClicked(): void { - root.cwd.pop(); + root.dialog.cwd.pop(); } } @@ -51,7 +51,7 @@ RowLayout { spacing: Appearance.spacing.small Repeater { - model: root.cwd + model: root.dialog.cwd RowLayout { id: folder @@ -78,13 +78,13 @@ RowLayout { Loader { anchors.fill: parent - active: folder.index < root.cwd.length - 1 + active: folder.index < root.dialog.cwd.length - 1 asynchronous: true sourceComponent: StateLayer { radius: Appearance.rounding.small function onClicked(): void { - root.cwd = root.cwd.slice(0, folder.index); + root.dialog.cwd = root.dialog.cwd.slice(0, folder.index + 1); } } } @@ -100,7 +100,7 @@ RowLayout { asynchronous: true sourceComponent: MaterialIcon { text: "home" - color: root.cwd.length === 1 ? Colours.palette.m3onSurface : Colours.palette.m3onSurfaceVariant + color: root.dialog.cwd.length === 1 ? Colours.palette.m3onSurface : Colours.palette.m3onSurfaceVariant fill: 1 } } @@ -113,7 +113,7 @@ RowLayout { anchors.leftMargin: homeIcon.active ? Appearance.padding.small : 0 text: folder.modelData - color: folder.index < root.cwd.length - 1 ? Colours.palette.m3onSurfaceVariant : Colours.palette.m3onSurface + color: folder.index < root.dialog.cwd.length - 1 ? Colours.palette.m3onSurfaceVariant : Colours.palette.m3onSurface font.bold: true } } -- cgit v1.2.3-freya