Merge pull request #1341 from chrox/master

fix #1336 by ignoring uncompatiable saved highlights
pull/1349/head v2014.11
HW 10 years ago
commit 1a6dc93b99

@ -1 +1 @@
Subproject commit a9cf24aa8b5427d2efc1f375b42e9f1cd88782af
Subproject commit f16af8b6bcfe8d9f24d8102cb0c5571eac5fb578

@ -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,

@ -91,12 +91,17 @@ function ReaderBookmark:importSavedHighlight(config)
if not config:readSetting("highlights_imported") then
for page, marks in pairs(textmarks) do
for _, mark in ipairs(marks) do
self:addBookmark({
page = self.ui.document.info.has_pages and page or mark.pos0,
datetime = mark.datetime,
notes = mark.text,
highlighted = true,
})
local page = self.ui.document.info.has_pages and page or mark.pos0
-- highlights saved by some old versions don't have pos0 field
-- we just ignore those highlights
if page then
self:addBookmark({
page = page,
datetime = mark.datetime,
notes = mark.text,
highlighted = true,
})
end
end
end
end

@ -353,12 +353,16 @@ function UIManager:_refresh(mode, region)
if not mode then return end
-- special case: full screen partial update
-- will get promoted every self.FULL_REFRESH_COUNT updates
if not region and mode == "partial" then
-- since _refresh can be called mutiple times via setDirty called in
-- different widget before a real screen repaint, we should make sure
-- refresh_count is incremented by only once at most for each repaint
if not region and mode == "partial" and not self.refresh_counted then
self.refresh_count = (self.refresh_count + 1) % self.FULL_REFRESH_COUNT
if self.refresh_count == self.FULL_REFRESH_COUNT - 1 then
DEBUG("promote refresh to full refresh")
mode = "full"
end
self.refresh_counted = true
end
-- if no region is specified, define default region
@ -425,6 +429,7 @@ function UIManager:_repaint()
refresh.region.w + 2, refresh.region.h + 2)
end
self._refresh_stack = {}
self.refresh_counted = false
end
-- this is the main loop of the UI controller

@ -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)

Loading…
Cancel
Save