Merge pull request #599 from nicolua/master

menu on k3
This commit is contained in:
Huang Xin
2014-05-31 23:20:12 +08:00
4 changed files with 12 additions and 3 deletions

View File

@@ -121,7 +121,11 @@ function ReaderFont:onShowFontMenu()
UIManager:close(menu_container)
end
-- show menu
main_menu.show_parent = menu_container
UIManager:show(menu_container)
return true
end

View File

@@ -124,7 +124,6 @@ function ReaderToc:onShowToc()
ui = self.ui,
width = Screen:getWidth(),
height = Screen:getHeight(),
show_parent = menu_container,
is_borderless = true,
}
@@ -141,7 +140,10 @@ function ReaderToc:onShowToc()
UIManager:close(menu_container)
end
toc_menu.show_parent = menu_container
UIManager:show(menu_container)
return true
end

View File

@@ -80,7 +80,7 @@ function FocusManager:onFocusMove(args)
current_item:handleEvent(Event:new("Unfocus"))
self.layout[self.selected.y][self.selected.x]:handleEvent(Event:new("Focus"))
-- trigger a repaint (we need to be the registered widget!)
UIManager:setDirty(self, "partial")
UIManager:setDirty(self.show_parent or self, "partial")
break
end
end

View File

@@ -542,8 +542,11 @@ function Menu:updateItems(select_number)
end
-- FIXME: this is a dirty hack to clear previous menus
UIManager.repaint_all = true
-- UIManager.repaint_all = true
--UIManager:setDirty(self)
--nicolua
UIManager:setDirty(self.show_parent or self)
end
function Menu:swithItemTable(new_title, new_item_table)