From 59b310dff5b5a814c8bbd443aacb2657f6ca1ba8 Mon Sep 17 00:00:00 2001
From: Erwin Ried <1091420+eried@users.noreply.github.com>
Date: Mon, 1 Jun 2020 01:59:40 +0200
Subject: [PATCH] Friendlier UI in fileman

---
 firmware/application/apps/ui_fileman.cpp | 6 +++---
 firmware/application/apps/ui_fileman.hpp | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/firmware/application/apps/ui_fileman.cpp b/firmware/application/apps/ui_fileman.cpp
index e10f61fb..0e5eaf9e 100644
--- a/firmware/application/apps/ui_fileman.cpp
+++ b/firmware/application/apps/ui_fileman.cpp
@@ -32,8 +32,8 @@ namespace ui {
 void FileManBaseView::load_directory_contents(const std::filesystem::path& dir_path) {
 	current_path = dir_path;
 	
-	text_current.set(dir_path.string().substr(0, 30 - 8));
-	
+	text_current.set(dir_path.string().length()? dir_path.string().substr(0, 30 - 6):"(sd root)");
+
 	entry_list.clear();
 	
 	auto filtering = (bool)extension_filter.size();
@@ -315,7 +315,7 @@ FileManagerView::FileManagerView(
 	
 	button_delete.on_select = [this, &nav](Button&) {
 		// Use display_modal ?
-		nav.push<ModalMessageView>("Delete", "Delete " + entry_list[menu_view.highlighted_index()].entry_path.filename().string() + "\nAre you sure ?", YESNO,
+		nav.push<ModalMessageView>("Delete", "Delete " + entry_list[menu_view.highlighted_index()].entry_path.filename().string() + "\nAre you sure?", YESNO,
 			[this](bool choice) {
 				if (choice)
 					on_delete();
diff --git a/firmware/application/apps/ui_fileman.hpp b/firmware/application/apps/ui_fileman.hpp
index 2ea38571..68c09db8 100644
--- a/firmware/application/apps/ui_fileman.hpp
+++ b/firmware/application/apps/ui_fileman.hpp
@@ -85,10 +85,10 @@ protected:
 	void refresh_list();
 	
 	Labels labels {
-		{ { 0, 0 }, "Current:", Color::light_grey() }
+		{ { 0, 0 }, "Path:", Color::light_grey() }
 	};
 	Text text_current {
-		{ 8 * 8, 0 * 8, 22 * 8, 16 },
+		{ 6 * 8, 0 * 8, 24 * 8, 16 },
 		"",
 	};
 	
-- 
GitLab