Merge pull request #1019 from chrox/fix_1017

Fix #1017
pull/1021/head
HW 10 years ago
commit 67eb0c8663

@ -21,6 +21,7 @@ local ReaderFooter = InputContainer:new{
pageno = nil,
pages = nil,
toc_level = 0,
max_ticks = 50,
progress_percentage = 0.0,
progress_text = nil,
text_font_face = "ffont",
@ -63,8 +64,14 @@ function ReaderFooter:init()
face = Font:getFace(self.text_font_face, self.text_font_size),
}
local text_width = self.progress_text:getSize().w
local ticks = (self.ui.toc and DMINIBAR_PROGRESS_MARKER)
and self.ui.toc:getTocTicks(self.toc_level) or {}
local ticks = {}
if self.ui.toc and DMINIBAR_PROGRESS_MARKER then
local max_level = self.ui.toc:getMaxDepth()
for i = self.toc_level, -max_level, -1 do
ticks = self.ui.toc:getTocTicks(i)
if #ticks < self.max_ticks then break end
end
end
self.progress_bar = ProgressWidget:new{
width = math.floor(Screen:getWidth() - text_width - self.padding),
height = self.bar_height,

@ -244,12 +244,14 @@ function ReaderToc:onShowToc()
-- update collapsible state
self.expand_button = Button:new{
icon = "resources/icons/appbar.control.expand.png",
width = Screen:scaleByDPI(30),
bordersize = 0,
show_parent = self,
}
self.collapse_button = Button:new{
icon = "resources/icons/appbar.control.collapse.png",
width = Screen:scaleByDPI(30),
bordersize = 0,
show_parent = self,
}

@ -72,14 +72,14 @@ function Button:init()
self[1] = self.frame
if Device:isTouchDevice() then
self.ges_events = {
TapSelect = {
TapSelectButton = {
GestureRange:new{
ges = "tap",
range = self.dimen,
},
doc = "Tap Button",
},
HoldSelect = {
HoldSelectButton = {
GestureRange:new{
ges = "hold",
range = self.dimen,
@ -149,7 +149,7 @@ function Button:showHide(show)
end
end
function Button:onTapSelect()
function Button:onTapSelectButton()
if self.enabled and self.callback then
self[1].invert = true
UIManager:setDirty(self.show_parent, "partial")
@ -162,7 +162,7 @@ function Button:onTapSelect()
return true
end
function Button:onHoldSelect()
function Button:onHoldSelectButton()
if self.enabled and self.hold_callback then
self.hold_callback()
end

Loading…
Cancel
Save