From 0a06041cd9c68e68dad773c782b0aecd356fcc16 Mon Sep 17 00:00:00 2001 From: chrox Date: Tue, 25 Nov 2014 17:43:28 +0800 Subject: [PATCH] fix calculation of widget height of filechooser the height of filechooser is provided when creating filechooser widget since there may be no title as in filemanger which needs a special title widget to contain filemanger menu. --- frontend/ui/downloadmgr.lua | 2 ++ frontend/ui/widget/filechooser.lua | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/ui/downloadmgr.lua b/frontend/ui/downloadmgr.lua index 36ed14022..54e517d31 100644 --- a/frontend/ui/downloadmgr.lua +++ b/frontend/ui/downloadmgr.lua @@ -1,5 +1,6 @@ local PathChooser = require("ui/widget/pathchooser") local UIManager = require("ui/uimanager") +local Screen = require("device").screen local util = require("ffi/util") local _ = require("gettext") @@ -20,6 +21,7 @@ function DownloadMgr:chooseDir() local download_dir = G_reader_settings:readSetting("download_dir") local path_chooser = PathChooser:new{ title = self.title, + height = Screen:getHeight(), path = download_dir and (download_dir .. "/..") or lastdir, show_hidden = G_reader_settings:readSetting("show_hidden"), onConfirm = function(path) diff --git a/frontend/ui/widget/filechooser.lua b/frontend/ui/widget/filechooser.lua index e0f663def..06f9007f5 100644 --- a/frontend/ui/widget/filechooser.lua +++ b/frontend/ui/widget/filechooser.lua @@ -31,7 +31,6 @@ local FileChooser = Menu:extend{ function FileChooser:init() self.width = Screen:getWidth() - self.height = Screen:getHeight() -- common dir filter self.dir_filter = function(dirname) for _, pattern in ipairs(self.exclude_dirs) do