[ReaderFooter] keep menu open after arranging items in status bar (#13168)
Some checks are pending
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (10.15, 13, x86-64, 15.2) (push) Waiting to run
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (11.0, 14, ARM64, 15.4) (push) Waiting to run

This commit is contained in:
David
2025-02-01 20:12:41 +00:00
committed by GitHub
parent 8606b132e4
commit d66527cd0e

View File

@@ -1381,6 +1381,20 @@ function ReaderFooter:addToMainMenu(menu_items)
{
text = _("Arrange items in status bar"),
separator = true,
keep_menu_open = true,
enabled_func = function()
-- count enabled items
local enabled_count = 0
for _, m in ipairs(self.mode_index) do
if self.settings[m] then
enabled_count = enabled_count + 1
if enabled_count > 1 then
break
end
end
end
return enabled_count > 1
end,
callback = function()
local item_table = {}
for i=1, #self.mode_index do