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() 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 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 end
function ReaderCoptListener:onSetFontSize(font_size) function ReaderCoptListener:onSetFontSize(font_size)

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

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

@ -533,15 +533,15 @@ Note that your selected font size is not affected by this setting.]]),
name = "status_line", name = "status_line",
name_text = _("Alt Status Bar"), name_text = _("Alt Status Bar"),
toggle = {_("off"), _("on")}, toggle = {_("off"), _("on")},
values = {1, 0}, values = {1, 0}, -- Note that 0 means crengine header status line enabled, and 1 means disabled
default_value = 1, -- Note that 1 means KOReader (bottom) status bar only default_value = 1,
args = {1, 0}, args = {1, 0},
default_arg = 1, default_arg = 1,
event = "SetStatusLine", event = "SetStatusLine",
name_text_hold_callback = optionsutil.showValues, 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", name = "embedded_css",

@ -56,6 +56,13 @@ describe("Readerfooter module", function()
end end
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() before_each(function()
G_reader_settings:saveSetting("footer", { G_reader_settings:saveSetting("footer", {
disabled = false, disabled = false,
@ -747,6 +754,7 @@ describe("Readerfooter module", function()
readerui:onClose() readerui:onClose()
end) end)
--[[ This toggling behaviour has been removed:
it("should toggle between full and min progress bar for cre documents", function() it("should toggle between full and min progress bar for cre documents", function()
local sample_txt = "spec/front/unit/data/sample.txt" local sample_txt = "spec/front/unit/data/sample.txt"
local readerui = ReaderUI:new{ local readerui = ReaderUI:new{
@ -773,4 +781,5 @@ describe("Readerfooter module", function()
readerui:closeDocument() readerui:closeDocument()
readerui:onClose() readerui:onClose()
end) end)
]]--
end) end)

Loading…
Cancel
Save