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
This commit is contained in:
NiLuJe
2019-10-27 19:10:25 +01:00
committed by GitHub
parent 7b6a3f3cb2
commit 61a8b63757
2 changed files with 5 additions and 3 deletions

View File

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

View File

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