KeyValuePage: configurable items per page

Tweak building to start from items per page instead of
a fixed item height.
Guess the best font size that fit.
Update separator specification from using a "----" to
the now generic separator=true (this allows not wasting
a slot for each separator in the page and not have
only 12 items and 2 small lines in a 14 items page).
This commit is contained in:
poire-z
2021-02-20 20:15:43 +01:00
parent 572900bfff
commit 8a0d798e9e
9 changed files with 121 additions and 52 deletions

View File

@@ -241,6 +241,7 @@ function ReaderDictionary:addToMainMenu(menu_items)
end
UIManager:show(KeyValuePage:new{
title = _("Dictionary lookup history"),
value_overflow_align = "right",
kv_pairs = kv_pairs,
})
end,
@@ -944,8 +945,7 @@ function ReaderDictionary:showDownload(downloadable_dicts)
end
table.insert(kv_pairs, {lang, ""})
table.insert(kv_pairs, {" ".._("License"), dict.license})
table.insert(kv_pairs, {" ".._("Entries"), dict.entries})
table.insert(kv_pairs, "----------------------------")
table.insert(kv_pairs, {" ".._("Entries"), dict.entries, separator = true})
end
self.download_window = KeyValuePage:new{
title = _("Tap dictionary name to download"),