Skip to content

Commit

Permalink
Minor fixes after #5537 (#5538)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
NiLuJe committed Oct 27, 2019
1 parent 7b6a3f3 commit 61a8b63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions frontend/apps/reader/modules/readerfooter.lua
Expand Up @@ -52,7 +52,7 @@ local symbol_prefix = {
icons = {
time = "",
pages_left = "",
battery = "",
battery = "",
percentage = "",
book_time_to_read = "",
chapter_time_to_read = "",
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/readerfooter_spec.lua
Expand Up @@ -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
Expand Down

0 comments on commit 61a8b63

Please sign in to comment.