Minor fixes after #5537 (#5538)

* Restore '+' prefix when charging in the footer w/ letters prefixes

Regression since #5537

* Don't use a full battery icon in the menu entry

Make it clear that one isn't in-sync with the current gauge
pull/5543/head
NiLuJe 5 years ago committed by GitHub
parent 7b6a3f3cb2
commit 61a8b63757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -52,7 +52,7 @@ local symbol_prefix = {
icons = {
time = "",
pages_left = "",
battery = "",
battery = "",
percentage = "",
book_time_to_read = "",
chapter_time_to_read = "",
@ -115,8 +115,10 @@ local footerTextGeneratorMap = {
prefix = ""
end
end
return prefix .. batt_lvl .. "%"
else
return prefix .. " " .. (powerd:isCharging() and "+" or "") .. batt_lvl .. "%"
end
return prefix .. (symbol_type == "icons" and "" or " ") .. batt_lvl .. "%"
end,
time = function(footer)
local symbol_type = footer.settings.item_prefix or "icons"

@ -217,7 +217,7 @@ describe("Readerfooter module", function()
assert.are.same('0%', footer.footer_text.text)
-- disable battery, percentage should follow
tapFooterMenu(fake_menu, "Battery status".." ()")
tapFooterMenu(fake_menu, "Battery status".." ()")
assert.are.same('⤠ 50%', footer.footer_text.text)
-- disable percentage, book time to read should follow

Loading…
Cancel
Save