From 3657a88ce529f5c3d54582dc18ad0b3fa8db3b64 Mon Sep 17 00:00:00 2001 From: Vishesh Handa <me@vhanda.in> Date: Sat, 14 Dec 2019 12:18:52 +0100 Subject: [PATCH] FolderListing: Show the full path of subfolders It's confusing otherwise, though this doesn't look very pretty. --- lib/core/notes_folder.dart | 7 +++++++ lib/screens/journal_listing.dart | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/core/notes_folder.dart b/lib/core/notes_folder.dart index b7b6eae9..7cfe578e 100644 --- a/lib/core/notes_folder.dart +++ b/lib/core/notes_folder.dart @@ -274,6 +274,13 @@ class NotesFolder with ChangeNotifier implements Comparable<NotesFolder> { notifyListeners(); } + String pathSpec() { + if (parent == null) { + return ""; + } + return p.join(parent.pathSpec(), name); + } + @override int compareTo(NotesFolder other) { return folderPath.compareTo(other.folderPath); diff --git a/lib/screens/journal_listing.dart b/lib/screens/journal_listing.dart index d5bd7b81..a5a1d493 100644 --- a/lib/screens/journal_listing.dart +++ b/lib/screens/journal_listing.dart @@ -43,7 +43,7 @@ class JournalListingScreen extends StatelessWidget { emptyText: "Why not add your first\n Journal Entry?", ); - var title = notesFolder.parent == null ? "Notes" : notesFolder.name; + var title = notesFolder.parent == null ? "Notes" : notesFolder.pathSpec(); return Scaffold( appBar: AppBar(