From b3d79b053a98f85e045e414b7c0bc7f24f635f24 Mon Sep 17 00:00:00 2001 From: chrox Date: Thu, 4 Dec 2014 10:09:09 +0800 Subject: [PATCH] workaround to fix #1340 --- frontend/apps/filemanager/filemanagersetdefaults.lua | 7 +++++++ frontend/ui/widget/menu.lua | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/frontend/apps/filemanager/filemanagersetdefaults.lua b/frontend/apps/filemanager/filemanagersetdefaults.lua index 4850d6ef3..4979a00b9 100644 --- a/frontend/apps/filemanager/filemanagersetdefaults.lua +++ b/frontend/apps/filemanager/filemanagersetdefaults.lua @@ -81,6 +81,13 @@ function SetDefaults:init() local menu_container = CenterContainer:new{ dimen = Screen:getSize(), } + -- FIXME: + -- in this use case (an input dialog is closed and the menu container is opened + -- immediately) we need to set the full screen dirty because otherwise only + -- the input dialog part of the screen is refreshed. + menu_container.onShow = function() + UIManager:setDirty(nil, "partial") + end self.defaults_menu = Menu:new{ width = Screen:getWidth()-15, diff --git a/frontend/ui/widget/menu.lua b/frontend/ui/widget/menu.lua index 26a093758..dc9b796a9 100644 --- a/frontend/ui/widget/menu.lua +++ b/frontend/ui/widget/menu.lua @@ -580,7 +580,14 @@ function Menu:init() end function Menu:onCloseWidget() - UIManager:setDirty(nil, "partial", self.dimen) + -- FIXME: + -- we cannot refresh regionally using the dimen field + -- because some menus without menu title use VerticalGroup to include + -- a text widget which is not calculated into the dimen. + -- For example, it's a dirty hack to use two menus(one this menu and one + -- touch menu) in the filemanager in order to capture tap gesture to popup + -- the filemanager menu. + UIManager:setDirty(nil, "partial") end function Menu:updateItems(select_number)