comp. replaced by items

reviewable/pr11678/r3
SomeGuy 1 month ago committed by GitHub
parent be132f7222
commit f6f590f5f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1135,11 +1135,11 @@ function ReaderFooter:addToMainMenu(menu_items)
{ {
separator = true, separator = true,
text_func = function() text_func = function()
local text = _("alongside complications") local text = _("alongside items")
if self.settings.progress_bar_position == "above" then if self.settings.progress_bar_position == "above" then
text = _("above complications") text = _("above items")
elseif self.settings.progress_bar_position == "below" then elseif self.settings.progress_bar_position == "below" then
text = _("below complications") text = _("below items")
end end
return T(_("Position: %1"), text) return T(_("Position: %1"), text)
end, end,
@ -1148,7 +1148,7 @@ function ReaderFooter:addToMainMenu(menu_items)
end, end,
sub_item_table = { sub_item_table = {
{ {
text = _("Above complications"), text = _("Above items"),
checked_func = function() checked_func = function()
return self.settings.progress_bar_position == "above" return self.settings.progress_bar_position == "above"
end, end,
@ -1158,7 +1158,7 @@ function ReaderFooter:addToMainMenu(menu_items)
end, end,
}, },
{ {
text = _("Alongside complications"), text = _("Alongside items"),
checked_func = function() checked_func = function()
return self.settings.progress_bar_position == "alongside" return self.settings.progress_bar_position == "alongside"
end, end,
@ -1176,7 +1176,7 @@ function ReaderFooter:addToMainMenu(menu_items)
end end
}, },
{ {
text = _("Below complications"), text = _("Below items"),
checked_func = function() checked_func = function()
return self.settings.progress_bar_position == "below" return self.settings.progress_bar_position == "below"
end, end,
@ -1455,58 +1455,45 @@ function ReaderFooter:addToMainMenu(menu_items)
}, },
} }
}) })
----------- complications (footer_items) ----------- footer_items
local about_text = _("A complication is any feature that provides additional information beyond the content of your book. Examples of ".. local footer_items = {}
"common complications include time, percentage read, pages left, and the battery indicator. You can choose which complications to "..
"display on the status bar from this page.")
local complication_subitems = {}
table.insert(sub_items, { table.insert(sub_items, {
text = _("Complications"), text = _("Items"),
sub_item_table = complication_subitems, sub_item_table = footer_items,
}) })
table.insert(sub_items, complications) table.insert(sub_items, items)
table.insert(complication_subitems, { table.insert(footer_items, getMinibarOption("page_progress"))
text = _("About complications"), table.insert(footer_items, getMinibarOption("pages_left_book"))
keep_menu_open = true, table.insert(footer_items, getMinibarOption("time"))
callback = function() table.insert(footer_items, getMinibarOption("chapter_progress"))
UIManager:show(InfoMessage:new{ table.insert(footer_items, getMinibarOption("pages_left"))
text = about_text,
})
end,
separator = true,
})
table.insert(complication_subitems, getMinibarOption("page_progress"))
table.insert(complication_subitems, getMinibarOption("pages_left_book"))
table.insert(complication_subitems, getMinibarOption("time"))
table.insert(complication_subitems, getMinibarOption("chapter_progress"))
table.insert(complication_subitems, getMinibarOption("pages_left"))
if Device:hasBattery() then if Device:hasBattery() then
table.insert(complication_subitems, getMinibarOption("battery")) table.insert(footer_items, getMinibarOption("battery"))
end end
table.insert(complication_subitems, getMinibarOption("bookmark_count")) table.insert(footer_items, getMinibarOption("bookmark_count"))
table.insert(complication_subitems, getMinibarOption("percentage")) table.insert(footer_items, getMinibarOption("percentage"))
table.insert(complication_subitems, getMinibarOption("book_time_to_read")) table.insert(footer_items, getMinibarOption("book_time_to_read"))
table.insert(complication_subitems, getMinibarOption("chapter_time_to_read")) table.insert(footer_items, getMinibarOption("chapter_time_to_read"))
if Device:hasFrontlight() then if Device:hasFrontlight() then
table.insert(complication_subitems, getMinibarOption("frontlight")) table.insert(footer_items, getMinibarOption("frontlight"))
end end
if Device:hasNaturalLight() then if Device:hasNaturalLight() then
table.insert(complication_subitems, getMinibarOption("frontlight_warmth")) table.insert(footer_items, getMinibarOption("frontlight_warmth"))
end end
table.insert(complication_subitems, getMinibarOption("mem_usage")) table.insert(footer_items, getMinibarOption("mem_usage"))
if Device:hasFastWifiStatusQuery() then if Device:hasFastWifiStatusQuery() then
table.insert(complication_subitems, getMinibarOption("wifi_status")) table.insert(footer_items, getMinibarOption("wifi_status"))
end end
table.insert(complication_subitems, getMinibarOption("book_title")) table.insert(footer_items, getMinibarOption("book_title"))
table.insert(complication_subitems, getMinibarOption("book_chapter")) table.insert(footer_items, getMinibarOption("book_chapter"))
table.insert(complication_subitems, getMinibarOption("custom_text")) table.insert(footer_items, getMinibarOption("custom_text"))
-------- configure footer_items -------- configure footer_items
table.insert(sub_items, { table.insert(sub_items, {
separator = true, separator = true,
text = _("Configure complications"), text = _("Configure items"),
sub_item_table = { sub_item_table = {
{ {
text = _("Arrange complications in status bar"), text = _("Arrange items in status bar"),
separator = true, separator = true,
callback = function() callback = function()
local item_table = {} local item_table = {}
@ -1516,7 +1503,7 @@ function ReaderFooter:addToMainMenu(menu_items)
local SortWidget = require("ui/widget/sortwidget") local SortWidget = require("ui/widget/sortwidget")
local sort_item local sort_item
sort_item = SortWidget:new{ sort_item = SortWidget:new{
title = _("Arrange complications"), title = _("Arrange items"),
item_table = item_table, item_table = item_table,
callback = function() callback = function()
for i=1, #sort_item.item_table do for i=1, #sort_item.item_table do
@ -1533,9 +1520,9 @@ function ReaderFooter:addToMainMenu(menu_items)
}, },
getMinibarOption("all_at_once", self.updateFooterTextGenerator), getMinibarOption("all_at_once", self.updateFooterTextGenerator),
{ {
text = _("Auto refresh complications"), text = _("Auto refresh items"),
help_text = _("This option allows certain complications to update without needing a full-page update. For example, the time".. help_text = _("This option allows certain items to update without needing a full-page update. For example, the time"..
" complication will update every minute regardless of user input."), " item will update every minute regardless of user input."),
checked_func = function() checked_func = function()
return self.settings.auto_refresh_time == true return self.settings.auto_refresh_time == true
end, end,
@ -1545,7 +1532,7 @@ function ReaderFooter:addToMainMenu(menu_items)
end end
}, },
{ {
text = _("Hide empty complications"), text = _("Hide empty items"),
help_text = _([[This option will hide values like 0 or off.]]), help_text = _([[This option will hide values like 0 or off.]]),
enabled_func = function() enabled_func = function()
return self.settings.all_at_once == true return self.settings.all_at_once == true
@ -1559,9 +1546,9 @@ function ReaderFooter:addToMainMenu(menu_items)
end, end,
}, },
{ {
text = _("Count current page in pages left"), text = _("Include current page in pages left"),
help_text = _("By default, KOReader does not include the current page when calculating pages left. For example, in a book ".. help_text = _("By default, KOReader does not include the current page when calculating pages left. For example, in a book "..
"or chapter with n pages the 'pages left' complication will range from 'n-1' to 0 (last page). With this feature activated, ".. "or chapter with n pages the 'pages left' item will range from 'n-1' to 0 (last page). With this feature activated, "..
"the current page is factored in, resulting in the count going from n to 1 instead."), "the current page is factored in, resulting in the count going from n to 1 instead."),
enabled_func = function() enabled_func = function()
return self.settings.pages_left or self.settings.pages_left_book return self.settings.pages_left or self.settings.pages_left_book
@ -1619,12 +1606,12 @@ function ReaderFooter:addToMainMenu(menu_items)
}, },
}, },
{ {
text = _("Maximum length for text complications"), text = _("Maximum length for text items"),
separator = true, separator = true,
sub_item_table = { sub_item_table = {
{ {
text_func = function() text_func = function()
return T(_("Length of book-title complication: %1".. "%"), self.settings.book_title_max_width_pct) return T(_("Length of book-title items: %1".. "%"), self.settings.book_title_max_width_pct)
end, end,
callback = function(touchmenu_instance) callback = function(touchmenu_instance)
local SpinWidget = require("ui/widget/spinwidget") local SpinWidget = require("ui/widget/spinwidget")
@ -1635,8 +1622,8 @@ function ReaderFooter:addToMainMenu(menu_items)
value_hold_step = 20, value_hold_step = 20,
value_max = 100, value_max = 100,
unit = "%", unit = "%",
title_text = _("Max length of book-title complication"), title_text = _("Max length of book-title item"),
info_text = _("Maximum percentage of screen width used for book-title complication"), info_text = _("Maximum percentage of screen width used for book-title item"),
keep_shown_on_apply = true, keep_shown_on_apply = true,
callback = function(spin) callback = function(spin)
self.settings.book_title_max_width_pct = spin.value self.settings.book_title_max_width_pct = spin.value
@ -1650,7 +1637,7 @@ function ReaderFooter:addToMainMenu(menu_items)
}, },
{ {
text_func = function() text_func = function()
return T(_("Length of chapter-title complication: %1".. "%"), self.settings.book_chapter_max_width_pct) return T(_("Length of chapter-title item: %1".. "%"), self.settings.book_chapter_max_width_pct)
end, end,
callback = function(touchmenu_instance) callback = function(touchmenu_instance)
local SpinWidget = require("ui/widget/spinwidget") local SpinWidget = require("ui/widget/spinwidget")
@ -1661,8 +1648,8 @@ function ReaderFooter:addToMainMenu(menu_items)
value_hold_step = 20, value_hold_step = 20,
value_max = 100, value_max = 100,
unit = "%", unit = "%",
title_text = _("Max length of chapter-title complication"), title_text = _("Max length of chapter-title item"),
info_text = _("Maximum percentage of screen width used for chapter-title complication"), info_text = _("Maximum percentage of screen width used for chapter-title item"),
keep_shown_on_apply = true, keep_shown_on_apply = true,
callback = function(spin) callback = function(spin)
self.settings.book_chapter_max_width_pct = spin.value self.settings.book_chapter_max_width_pct = spin.value
@ -1730,12 +1717,12 @@ function ReaderFooter:addToMainMenu(menu_items)
if self.settings.text_font_bold == true then if self.settings.text_font_bold == true then
font_weight = ", " .. _("bold") font_weight = ", " .. _("bold")
end end
return T(_("Complications font: %1%2"), self.settings.text_font_size, font_weight) return T(_("Items font: %1%2"), self.settings.text_font_size, font_weight)
end, end,
sub_item_table = { sub_item_table = {
{ {
text_func = function() text_func = function()
return T(_("Complications font size: %1"), self.settings.text_font_size) return T(_("Items font size: %1"), self.settings.text_font_size)
end, end,
callback = function(touchmenu_instance) callback = function(touchmenu_instance)
local SpinWidget = require("ui/widget/spinwidget") local SpinWidget = require("ui/widget/spinwidget")
@ -1746,7 +1733,7 @@ function ReaderFooter:addToMainMenu(menu_items)
value_max = 36, value_max = 36,
default_value = 14, default_value = 14,
ok_text = _("Set size"), ok_text = _("Set size"),
title_text = _("Set font size for complications"), title_text = _("Set font size for items"),
keep_shown_on_apply = true, keep_shown_on_apply = true,
callback = function(spin) callback = function(spin)
self.settings.text_font_size = spin.value self.settings.text_font_size = spin.value
@ -1766,7 +1753,7 @@ function ReaderFooter:addToMainMenu(menu_items)
keep_menu_open = true, keep_menu_open = true,
}, },
{ {
text = _("Use boldface"), text = _("Items in bold"),
checked_func = function() checked_func = function()
return self.settings.text_font_bold == true return self.settings.text_font_bold == true
end, end,
@ -1905,7 +1892,7 @@ function ReaderFooter:addToMainMenu(menu_items)
text_func = function() text_func = function()
local separator = self:get_separator_symbol() local separator = self:get_separator_symbol()
separator = separator ~= "" and separator or "none" separator = separator ~= "" and separator or "none"
return T(_("Complication separator: %1"), separator) return T(_("Items separator: %1"), separator)
end, end,
sub_item_table = { sub_item_table = {
{ {
@ -1957,9 +1944,9 @@ function ReaderFooter:addToMainMenu(menu_items)
table.insert(configure_complications_sub_table , 5, { table.insert(configure_complications_sub_table , 5, {
text_func = function() text_func = function()
if self.settings.battery_hide_threshold <= (Device:hasAuxBattery() and 200 or 100) then if self.settings.battery_hide_threshold <= (Device:hasAuxBattery() and 200 or 100) then
return T(_("Hide battery complication when higher than: %1".. "%"), self.settings.battery_hide_threshold) return T(_("Hide battery item when higher than: %1".. "%"), self.settings.battery_hide_threshold)
else else
return _("Hide battery complication at custom threshold") return _("Hide battery item at custom threshold")
end end
end, end,
checked_func = function() checked_func = function()
@ -1978,7 +1965,7 @@ function ReaderFooter:addToMainMenu(menu_items)
default_value = Device:hasAuxBattery() and 200 or 100, default_value = Device:hasAuxBattery() and 200 or 100,
unit = "%", unit = "%",
value_hold_step = 10, value_hold_step = 10,
title_text = _("Set minimum threshold to hide battery complication"), title_text = _("Set minimum threshold to hide battery item"),
callback = function(spin) callback = function(spin)
self.settings.battery_hide_threshold = spin.value self.settings.battery_hide_threshold = spin.value
self:refreshFooter(true, true) self:refreshFooter(true, true)

Loading…
Cancel
Save