Read bookmarks without having to view ebook page

pull/3042/head
robert00s 7 years ago committed by Frans de Jonge
parent c7417c45b3
commit 6d5859d11d

@ -1,4 +1,3 @@
local ButtonDialog = require("ui/widget/buttondialog")
local CenterContainer = require("ui/widget/container/centercontainer")
local Device = require("device")
local Event = require("ui/event")
@ -7,6 +6,7 @@ local Geom = require("ui/geometry")
local GestureRange = require("ui/gesturerange")
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")
@ -207,22 +207,31 @@ function ReaderBookmark:onShowBookmark()
end
function bm_menu:onMenuHold(item)
self.remove_bookmark_dialog = ButtonDialog:new{
buttons = {
self.textviewer = TextViewer:new{
title = _("Bookmark details"),
text = item.notes,
width = self.textviewer_width,
height = self.textviewer_height,
buttons_table = {
{
{
text = _("Close"),
callback = function()
UIManager:close(self.textviewer)
end,
},
{
text = _("Remove this bookmark"),
callback = function()
bookmark:removeHightligit(item)
bm_menu:switchItemTable(nil, bookmark.bookmarks, -1)
UIManager:close(self.remove_bookmark_dialog)
UIManager:close(self.textviewer)
end,
},
},
},
}
}
UIManager:show(self.remove_bookmark_dialog)
UIManager:show(self.textviewer)
return true
end

@ -27,6 +27,7 @@ local TextViewer = InputContainer:new{
text = nil,
width = nil,
height = nil,
buttons_table = nil,
title_face = Font:getFace("x_smalltfont"),
text_face = Font:getFace("x_smallinfofont"),
@ -115,16 +116,21 @@ function TextViewer:init()
}
}
local buttons = {
{
local buttons
if self.buttons_table == nil then
buttons = {
{
text = _("Close"),
callback = function()
UIManager:close(self)
end,
{
text = _("Close"),
callback = function()
UIManager:close(self)
end,
},
},
},
}
}
else
buttons = self.buttons_table
end
local button_table = ButtonTable:new{
width = self.width - self.button_padding,
button_font_face = "cfont",

Loading…
Cancel
Save