Don't toggle the footer when toggling the top status bar

reviewable/pr7213/r2
poire-z 3 years ago
parent 8ee7dcf342
commit 49e2d91afb

@ -40,8 +40,9 @@ function ReaderCoptListener:onReadSettings(config)
self:onTimeFormatChanged()
-- Enable or disable crengine header status line (note that for crengine, 0=header enabled, 1=header disabled)
local status_line = config:readSetting("copt_status_line") or G_reader_settings:readSetting("copt_status_line") or 1
self.ui:handleEvent(Event:new("SetStatusLine", status_line, true))
self.ui:handleEvent(Event:new("SetStatusLine", status_line))
end
function ReaderCoptListener:onSetFontSize(font_size)

@ -757,7 +757,6 @@ function ReaderFooter:disableFooter()
self.updateFooterPage = function() end
self.updateFooterPos = function() end
self.onUpdatePos = function() end
self.onSetStatusLine = function() end
self.mode = self.mode_list.off
self.view.footer_visible = false
end

@ -1031,17 +1031,14 @@ function ReaderRolling:onSetVisiblePages(visible_pages)
end
end
function ReaderRolling:onSetStatusLine(status_line, on_read_settings)
-- status_line values:
-- in crengine: 0=header enabled, 1=disabled
-- in koreader: 0=top status bar, 1=bottom mini bar
function ReaderRolling:onSetStatusLine(status_line)
-- Enable or disable crengine header status line
-- Note that for crengine, 0=header enabled, 1=header disabled
self.ui.document:setStatusLineProp(status_line)
self.cre_top_bar_enabled = status_line == 0
if not on_read_settings then
-- Ignore this event when it is first sent by ReaderCoptListener
-- on book loading, so we stay with the saved footer settings
self.view.footer:setVisible(status_line == 1)
end
-- (We used to toggle the footer when toggling the top status bar,
-- but people seem to like having them both, and it feels more
-- practicable to have the independant.)
self.ui:handleEvent(Event:new("UpdatePos"))
end

@ -533,15 +533,15 @@ Note that your selected font size is not affected by this setting.]]),
name = "status_line",
name_text = _("Alt Status Bar"),
toggle = {_("off"), _("on")},
values = {1, 0},
default_value = 1, -- Note that 1 means KOReader (bottom) status bar only
values = {1, 0}, -- Note that 0 means crengine header status line enabled, and 1 means disabled
default_value = 1,
args = {1, 0},
default_arg = 1,
event = "SetStatusLine",
name_text_hold_callback = optionsutil.showValues,
help_text = _([[Enable or disable the rendering engine alternative status bar at the top of the screen (this status bar can't be customized).
help_text = _([[Enable or disable the rendering engine alternative status bar at the top of the screen. The items displayed can be customized via the main menu.
Whether enabled or disabled, KOReader's own status bar at the bottom of the screen can be toggled by tapping. The items displayed can be customized via the main menu.]]),
Whether enabled or disabled, KOReader's own status bar at the bottom of the screen can be toggled by tapping.]]),
},
{
name = "embedded_css",

@ -56,6 +56,13 @@ describe("Readerfooter module", function()
end
end)
teardown(function()
-- Clean up global settings we played with
G_reader_settings:delSetting("reader_footer_mode")
G_reader_settings:delSetting("footer")
G_reader_settings:flush()
end)
before_each(function()
G_reader_settings:saveSetting("footer", {
disabled = false,
@ -747,6 +754,7 @@ describe("Readerfooter module", function()
readerui:onClose()
end)
--[[ This toggling behaviour has been removed:
it("should toggle between full and min progress bar for cre documents", function()
local sample_txt = "spec/front/unit/data/sample.txt"
local readerui = ReaderUI:new{
@ -773,4 +781,5 @@ describe("Readerfooter module", function()
readerui:closeDocument()
readerui:onClose()
end)
]]--
end)

Loading…
Cancel
Save