mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Button: Better handling of translucent MovableContainer (#7223)
* DictQuickLookup: Preserve alpha when switching dict, and scrolling inside a dict. * Start moving the NumberPicker alpha hack to Button itself This makes handling flash_ui easier and saner, avoiding flickering. * Handle the transparency hack entirely from within Button * Murder the now unnecessary NumberPicker update_callback hack * Tweak comments * And the Button handling made that redundant, too * Squish debug print * More comment tweaks * Reset transparency on scrolling instead of rpeserving it * Reset alpha when switching dictionaries * Simplify the pre/post callbakc transparency state handling And explain why we need to care. * Give a named reference to ButtonDialog's MovableContainer, so the Button alpha hack behaves with it * Document the "self.movable" convention * Amend that comment a bit e.g., we don't care much about MultiConfirmBox'w MpvableContainer, as any button action will close it. * And make SkimTo's MovableContainer accessible so that Button can grok that it's translucent
This commit is contained in:
@@ -150,9 +150,17 @@ function ScrollTextWidget:updateScrollBar(is_partial)
|
||||
if is_partial then
|
||||
refreshfunc = "partial"
|
||||
end
|
||||
UIManager:setDirty(self.dialog, function()
|
||||
return refreshfunc, self.dimen
|
||||
end)
|
||||
-- Reset transparency if the dialog's MovableContainer is currently translucent...
|
||||
if is_partial and self.dialog.movable and self.dialog.movable.alpha then
|
||||
self.dialog.movable.alpha = nil
|
||||
UIManager:setDirty(self.dialog, function()
|
||||
return refreshfunc, self.dialog.movable.dimen
|
||||
end)
|
||||
else
|
||||
UIManager:setDirty(self.dialog, function()
|
||||
return refreshfunc, self.dimen
|
||||
end)
|
||||
end
|
||||
if self.scroll_callback then
|
||||
self.scroll_callback(low, high)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user