+11
-3
main.lua
+11
-3
main.lua
···
399
400
function Paperbnd:showBookSelectionDialog(books)
401
local Menu = require("ui/widget/menu")
402
local Screen = require("device").screen
403
404
local items = {}
···
410
})
411
end
412
413
local book_menu = Menu:new({
414
title = _("Select a book"),
415
item_table = items,
416
-
width = Screen:getWidth() - Screen:scaleBySize(100),
417
-
height = Screen:getHeight() - Screen:scaleBySize(100),
418
fullscreen = true,
419
single_line = false,
420
onMenuSelect = function(_, item)
421
self:confirmLinkBook(item.book)
422
end,
423
})
424
425
-
UIManager:show(book_menu)
426
end
427
428
function Paperbnd:confirmLinkBook(book)
···
399
400
function Paperbnd:showBookSelectionDialog(books)
401
local Menu = require("ui/widget/menu")
402
+
local CenterContainer = require("ui/widget/container/centercontainer")
403
local Screen = require("device").screen
404
405
local items = {}
···
411
})
412
end
413
414
+
local book_menu_container
415
local book_menu = Menu:new({
416
title = _("Select a book"),
417
item_table = items,
418
+
width = Screen:getWidth() - Screen:scaleBySize(80),
419
+
height = Screen:getHeight() - Screen:scaleBySize(80),
420
fullscreen = true,
421
single_line = false,
422
onMenuSelect = function(_, item)
423
+
UIManager:close(book_menu_container)
424
self:confirmLinkBook(item.book)
425
end,
426
})
427
428
+
book_menu_container = CenterContainer:new({
429
+
dimen = Screen:getSize(),
430
+
book_menu,
431
+
})
432
+
433
+
UIManager:show(book_menu_container)
434
end
435
436
function Paperbnd:confirmLinkBook(book)