mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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:
@@ -52,7 +52,7 @@ function Button:init()
|
||||
self.label_widget = TextWidget:new{
|
||||
text = self.text,
|
||||
max_width = self.max_width and self.max_width - 2*self.padding - 2*self.margin - 2*self.bordersize or nil,
|
||||
fgcolor = self.enabled and Blitbuffer.COLOR_BLACK or Blitbuffer.COLOR_GREY,
|
||||
fgcolor = self.enabled and Blitbuffer.COLOR_BLACK or Blitbuffer.COLOR_DARK_GRAY,
|
||||
bold = self.text_font_bold,
|
||||
face = Font:getFace(self.text_font_face, self.text_font_size)
|
||||
}
|
||||
@@ -144,7 +144,7 @@ function Button:enable()
|
||||
if self.enabled then
|
||||
self.label_widget.fgcolor = Blitbuffer.COLOR_BLACK
|
||||
else
|
||||
self.label_widget.fgcolor = Blitbuffer.COLOR_GREY
|
||||
self.label_widget.fgcolor = Blitbuffer.COLOR_DARK_GRAY
|
||||
end
|
||||
else
|
||||
self.label_widget.dim = not self.enabled
|
||||
@@ -157,7 +157,7 @@ function Button:disable()
|
||||
if self.enabled then
|
||||
self.label_widget.fgcolor = Blitbuffer.COLOR_BLACK
|
||||
else
|
||||
self.label_widget.fgcolor = Blitbuffer.COLOR_GREY
|
||||
self.label_widget.fgcolor = Blitbuffer.COLOR_DARK_GRAY
|
||||
end
|
||||
else
|
||||
self.label_widget.dim = not self.enabled
|
||||
|
||||
Reference in New Issue
Block a user