From 99171b526779ffa188cef388d0eae7948e1a1758 Mon Sep 17 00:00:00 2001 From: poire-z Date: Mon, 10 Jan 2022 23:07:39 +0100 Subject: [PATCH] ReaderBookmark: fix issue with unit tests (#8645) Revert some bits from 55532b13, as the otherwise uneeded CenterContainer is used by unit tests. --- frontend/apps/reader/modules/readerbookmark.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/apps/reader/modules/readerbookmark.lua b/frontend/apps/reader/modules/readerbookmark.lua index 9baf154d8..920c636d1 100644 --- a/frontend/apps/reader/modules/readerbookmark.lua +++ b/frontend/apps/reader/modules/readerbookmark.lua @@ -481,6 +481,10 @@ function ReaderBookmark:onShowBookmark(match_table) local multilines_show_more_text = G_reader_settings:isTrue("bookmarks_items_multilines_show_more_text") local show_separator = G_reader_settings:isTrue("bookmarks_items_show_separator") + self.bookmark_menu = CenterContainer:new{ + dimen = Screen:getSize(), + covers_fullscreen = true, -- hint for UIManager:_repaint() + } local bm_menu = Menu:new{ title = self.filtered_mode and _("Bookmarks (search results)") or _("Bookmarks"), item_table = item_table, @@ -504,7 +508,9 @@ function ReaderBookmark:onShowBookmark(match_table) direction = BD.flipDirectionIfMirroredUILayout("east") } }, + show_parent = self.bookmark_menu, } + table.insert(self.bookmark_menu, bm_menu) -- buid up menu widget method as closure local bookmark = self @@ -815,7 +821,7 @@ function ReaderBookmark:onShowBookmark(match_table) end bm_menu.close_callback = function() - UIManager:close(bm_menu) + UIManager:close(self.bookmark_menu) end self.refresh = function() @@ -823,7 +829,7 @@ function ReaderBookmark:onShowBookmark(match_table) self:onSaveSettings() end - UIManager:show(bm_menu) + UIManager:show(self.bookmark_menu) return true end