mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
DictQuickLookup: Properly scroll back to top when updating a
ScrollTextWidget Despite a similar API between ScrollTextWidget and ScrollHtmlWiget, what they do internally doesn't quite match. So, while ScrollHtmlWidget's resetSCroll *does* rewind back to the top, ScrollTextWidget's doesn't, it just updates the scrollbar itself. So, do that on our end, *before* the (re-)init, which'll call _renderText for us. Fix #7318
This commit is contained in:
@@ -816,9 +816,11 @@ function DictQuickLookup:update()
|
||||
self.text_widget.text_widget.lang = self.lang and self.lang:lower()
|
||||
self.text_widget.text_widget.para_direction_rtl = self.rtl_lang
|
||||
self.text_widget.text_widget.images = self.images
|
||||
-- Scroll back to the top, àla TextBoxWidget:scrollToTop
|
||||
self.text_widget.text_widget.virtual_line_num = 1
|
||||
-- NOTE: The recursive free via our WidgetContainer (self[1]) above already free'd us ;)
|
||||
self.text_widget.text_widget:init()
|
||||
-- Scroll back to top
|
||||
-- Reset the scrollbar's state
|
||||
self.text_widget:resetScroll()
|
||||
else
|
||||
-- We jumped from HTML to Text (or vice-versa), we need a new widget instance
|
||||
|
||||
Reference in New Issue
Block a user