Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show full ToC entry on hold #6729

Merged
merged 15 commits into from Sep 30, 2020
15 changes: 15 additions & 0 deletions frontend/apps/reader/modules/readertoc.lua
Expand Up @@ -9,6 +9,7 @@ local GestureRange = require("ui/gesturerange")
local Geom = require("ui/geometry")
local InputContainer = require("ui/widget/container/inputcontainer")
local Menu = require("ui/widget/menu")
local TextViewer = require("ui/widget/textviewer")
local UIManager = require("ui/uimanager")
local logger = require("logger")
local _ = require("gettext")
Expand Down Expand Up @@ -582,6 +583,20 @@ function ReaderToc:onShowToc()
end
end

function toc_menu:onMenuHold(item)
print("toc_menu:onMenuHold", item)
print(require("dump")(item))
local textviewer = TextViewer:new{
title = _("ToC entry"),
NiLuJe marked this conversation as resolved.
Show resolved Hide resolved
text = item.text,
lang = nil, --- @todo: Get doc's lang?
NiLuJe marked this conversation as resolved.
Show resolved Hide resolved
width = math.floor(self.width * 0.8),
height = math.floor(self.height * 0.25),
}
UIManager:show(textviewer)
return true
end

toc_menu.close_callback = function()
UIManager:close(menu_container)
end
Expand Down