2
0
mirror of https://github.com/koreader/koreader synced 2024-11-13 19:11:25 +00:00

disable reflow in flipping mode

This commit is contained in:
chrox 2013-03-31 21:37:57 +08:00
parent 3257219b12
commit dd19d446cf
2 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,7 @@
ReaderFlipping = LeftContainer:new{} ReaderFlipping = LeftContainer:new{
orig_reflow_mode = 0,
}
function ReaderFlipping:init() function ReaderFlipping:init()
local widget = ImageWidget:new{ local widget = ImageWidget:new{
@ -10,7 +12,12 @@ function ReaderFlipping:init()
self[1] = widget self[1] = widget
end end
function ReaderFlipping:onSetDogearVisibility(visible) function ReaderFlipping:onSetFlippingMode(flipping_mode)
self.view.dogear_visible = visible if flipping_mode then
self.orig_reflow_mode = self.view.document.configurable.text_wrap
self.view.document.configurable.text_wrap = 0
else
self.view.document.configurable.text_wrap = self.orig_reflow_mode
end
return true return true
end end

View File

@ -155,6 +155,7 @@ function ReaderPaging:onToggleFlipping()
else else
self:updateOriginalPage(nil) self:updateOriginalPage(nil)
end end
self.ui:handleEvent(Event:new("SetFlippingMode", self.flipping_mode))
self.ui:handleEvent(Event:new("SetHinting", not self.flipping_mode)) self.ui:handleEvent(Event:new("SetHinting", not self.flipping_mode))
UIManager:setDirty(self.view.dialog, "partial") UIManager:setDirty(self.view.dialog, "partial")
end end