diff --git a/frontend/apps/filemanager/filemanager.lua b/frontend/apps/filemanager/filemanager.lua index 9c1be469a..f71b6a119 100644 --- a/frontend/apps/filemanager/filemanager.lua +++ b/frontend/apps/filemanager/filemanager.lua @@ -63,6 +63,10 @@ function FileManager:init() face = Font:getFace("tfont", 24), text = self.title, }, + TextWidget:new{ + face = Font:getFace("infofont", 18), + text = self.root_path, + }, VerticalSpan:new{ width = Screen:scaleBySize(10) } } @@ -88,6 +92,11 @@ function FileManager:init() } self.file_chooser = file_chooser + function file_chooser:onPathChanged(path) -- luacheck: ignore + FileManager.instance.banner[2].text = path + return true + end + function file_chooser:onFileSelect(file) -- luacheck: ignore FileManager.instance:onClose() local ReaderUI = require("apps/reader/readerui") diff --git a/frontend/ui/widget/filechooser.lua b/frontend/ui/widget/filechooser.lua index 9d6cb0c32..c5ae74794 100644 --- a/frontend/ui/widget/filechooser.lua +++ b/frontend/ui/widget/filechooser.lua @@ -20,7 +20,6 @@ local FileChooser = Menu:extend{ path = lfs.currentdir(), parent = nil, show_hidden = nil, - filter = function(filename) return true end, exclude_dirs = {"%.sdr$"}, strcoll = strcoll, collate = "strcoll", -- or collate = "access", @@ -33,7 +32,7 @@ function FileChooser:init() -- common dir filter self.dir_filter = function(dirname) for _, pattern in ipairs(self.exclude_dirs) do - if dirname:match(pattern) then return end + if dirname:match(pattern) then return false end end return true end @@ -161,6 +160,7 @@ function FileChooser:changeToPath(path) path = util.realpath(path) self.path = path self:refreshPath() + self:onPathChanged(path) end function FileChooser:toggleHiddenFiles() @@ -203,4 +203,8 @@ function FileChooser:onFileHold(file) return true end +function FileChooser:onPathChanged(path) + return true +end + return FileChooser