mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
check if there is at least one page link before drawing shortcuts
This commit is contained in:
@@ -2883,14 +2883,22 @@ function UniReader:addAllCommands()
|
||||
Debug("shortcuts",SelectMenu.item_shortcuts)
|
||||
local face = Font:getFace("rifont", font_size)
|
||||
|
||||
local page_links = 0
|
||||
|
||||
for i, link in ipairs(links) do
|
||||
if link.page then
|
||||
local x,y,w,h = self:zoomedRectCoordTransform( link.x0,link.y0, link.x1,link.y1 )
|
||||
fb.bb:dimRect(x,y,w,h) -- black 50%
|
||||
fb.bb:dimRect(x,y,w,h) -- black 25%
|
||||
page_links = page_links + 1
|
||||
end
|
||||
end
|
||||
|
||||
if page_links == 0 then
|
||||
showInfoMsgWithDelay("No links on this page", 2000, 1)
|
||||
return
|
||||
end
|
||||
|
||||
Screen:saveCurrentBB() -- save dimmed links
|
||||
|
||||
local shortcut_offset = 0
|
||||
|
||||
Reference in New Issue
Block a user