Misc: Get rid of the legacy defaults.lua globals (#9546)

* This removes support for the following deprecated constants: `DTAP_ZONE_FLIPPING`, `DTAP_ZONE_BOOKMARK`, `DCREREADER_CONFIG_DEFAULT_FONT_GAMMA`
* The "Advanced settings" panel now highlights modified values in bold (think about:config in Firefox ;)).
* LuaData: Isolate global table lookup shenanigans, and fix a few issues in unused-in-prod codepaths.
* CodeStyle: Require module locals for Lua/C modules, too.
* ScreenSaver: Actually garbage collect our widget on close (ScreenSaver itself is not an instantiated object).
* DateTimeWidget: Code cleanups to ensure child widgets can be GC'ed.
This commit is contained in:
NiLuJe
2022-09-28 01:10:50 +02:00
committed by GitHub
parent 46f729c248
commit 62059f8d68
74 changed files with 1030 additions and 1050 deletions

View File

@@ -30,6 +30,7 @@ local logger = require("logger")
local dbg = require("dbg")
local time = require("ui/time")
local util = require("util")
local xtext -- Delayed (and optional) loading
local Screen = require("device").screen
local TextBoxWidget = InputContainer:new{
@@ -244,7 +245,7 @@ end
function TextBoxWidget:_measureWithXText()
if not self._xtext_loaded then
require("libs/libkoreader-xtext")
xtext = require("libs/libkoreader-xtext")
TextBoxWidget._xtext_loaded = true
end
if type(self.charlist) == "table" then
@@ -819,7 +820,7 @@ function TextBoxWidget:_renderText(start_row_idx, end_row_idx)
end
self:_shapeLine(line)
if line.xglyphs then -- non-empty line
for __, xglyph in ipairs(line.xglyphs) do
for _, xglyph in ipairs(line.xglyphs) do
if not xglyph.no_drawing then
local face = self.face.getFallbackFont(xglyph.font_num) -- callback (not a method)
local glyph = RenderText:getGlyphByIndex(face, xglyph.glyph, self.bold)
@@ -1854,8 +1855,6 @@ function TextBoxWidget:onHoldWord(callback, ges)
idx = idx + 1
end
end
return
end
-- Allow selection of one or more words (with no visual feedback)