ReaderBookmark: fix issue with unit tests (#8645)

Revert some bits from 55532b13, as the otherwise uneeded
CenterContainer is used by unit tests.
reviewable/pr8647/r1
poire-z 2 years ago committed by GitHub
parent 1d40949699
commit 99171b5267
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save