ReaderStatus: fix End of Document action (#13144)
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:
hius07
2025-01-26 13:51:34 +02:00
committed by GitHub
parent 9bcd09633c
commit e40512387a
2 changed files with 8 additions and 11 deletions

View File

@@ -23,14 +23,11 @@ function ReaderStatus:addToMainMenu(menu_items)
}
end
function ReaderStatus:onShowBookStatus(before_show_callback)
function ReaderStatus:onShowBookStatus(close_callback)
local status_page = BookStatusWidget:new{
ui = self.ui,
close_callback = close_callback,
}
if before_show_callback then
before_show_callback()
end
status_page.dithered = true
UIManager:show(status_page, "full")
return true
end
@@ -157,8 +154,8 @@ function ReaderStatus:onEndOfBook()
elseif settings == "book_status_file_browser" then
-- Ditto
UIManager:nextTick(function()
local before_show_callback = function() self:openFileBrowser() end
self:onShowBookStatus(before_show_callback)
local book_status_close_callback = function() self:openFileBrowser() end
self:onShowBookStatus(book_status_close_callback)
end)
elseif settings == "delete_file" then
-- Ditto
@@ -169,12 +166,9 @@ function ReaderStatus:onEndOfBook()
end
function ReaderStatus:openFileBrowser()
local FileManager = require("apps/filemanager/filemanager")
local file = self.document.file
self.ui:onClose()
if not FileManager.instance then
self.ui:showFileManager(file)
end
self.ui:showFileManager(file)
end
function ReaderStatus:onOpenNextDocumentInFolder()

View File

@@ -537,6 +537,9 @@ function BookStatusWidget:onClose()
end
-- NOTE: Flash on close to avoid ghosting, since we show an image.
UIManager:close(self, "flashpartial")
if self.close_callback then
self.close_callback()
end
return true
end