mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
* Switching between HTML/text dicts (Fix #7209) * Updating the scrollbar and scroll state properly when switching dicts * Highlights in SortWidget * Highlights in the Dictionary Download page * Minor simplification of the tail end of the update process in ImageViewer
This commit is contained in:
@@ -159,6 +159,17 @@ function ScrollTextWidget:updateScrollBar(is_partial)
|
||||
end
|
||||
end
|
||||
|
||||
-- Reset the scrolling *state* to the top of the document, but don't actually re-render/refresh anything.
|
||||
-- (Useful when replacing a Scroll*Widget during an update call, c.f., DictQuickLookup).
|
||||
function ScrollTextWidget:resetScroll()
|
||||
local low, high = self.text_widget:getVisibleHeightRatios()
|
||||
self.v_scroll_bar:set(low, high)
|
||||
|
||||
local visible_line_count = self.text_widget:getVisLineCount()
|
||||
local total_line_count = self.text_widget:getAllLineCount()
|
||||
self.v_scroll_bar.enable = visible_line_count < total_line_count
|
||||
end
|
||||
|
||||
function ScrollTextWidget:moveCursorToCharPos(charpos)
|
||||
self.text_widget:moveCursorToCharPos(charpos)
|
||||
self:updateScrollBar()
|
||||
|
||||
Reference in New Issue
Block a user