Various blitting related cleanups (#4789)

* Fix the "Enable debug logging" checkbox so that it properly disables "Enable verbose debug logging" when it gets disabled
* Avoid asking ImageWidget for alpha-blending when it's not useful
* Make ImageWidget's alpha-blending code-path double-check that alpha-blending actually is needed, and avoid it if possible
* In the same vein, only do alpha-blending in textboxwidget when absolutely necessary
* Prefer color constants over the gray() method, ensuring that they're part of the eInk palette

Depends on https://github.com/koreader/koreader-base/pull/853

Fix #4774
This commit is contained in:
NiLuJe
2019-03-14 20:58:45 +01:00
committed by Frans de Jonge
parent 1045bf8946
commit 2011cf1ad1
39 changed files with 112 additions and 103 deletions

View File

@@ -237,7 +237,7 @@ function InputText:initTextBox(text, char_added)
if show_text == "" or show_text == nil then
-- no preset value, use hint text if set
show_text = self.hint
fgcolor = Blitbuffer.COLOR_GREY
fgcolor = Blitbuffer.COLOR_DARK_GRAY
self.charlist = {}
self.charpos = 1
else
@@ -346,7 +346,7 @@ function InputText:initTextBox(text, char_added)
bordersize = self.bordersize,
padding = self.padding,
margin = self.margin,
color = self.focused and Blitbuffer.COLOR_BLACK or Blitbuffer.COLOR_GREY,
color = self.focused and Blitbuffer.COLOR_BLACK or Blitbuffer.COLOR_DARK_GRAY,
self.text_widget,
}
self._verticalgroup = VerticalGroup:new{
@@ -387,7 +387,7 @@ end
function InputText:unfocus()
self.focused = false
self.text_widget:unfocus()
self._frame_textwidget.color = Blitbuffer.COLOR_GREY
self._frame_textwidget.color = Blitbuffer.COLOR_DARK_GRAY
end
function InputText:focus()