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
pull/7323/head
NiLuJe 3 years ago committed by Frans de Jonge
parent e6a946a048
commit 588acfe31e

@ -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

Loading…
Cancel
Save