mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
TextEditor: allow scrolling by lines with Pan (#4145)
Feature of ScrollTextWidget, only used for now by TextEditor. Pan is like Swipe, but wait a bit at end of gesture to release: the line on which Pan was started will be moved to where Pan is released. May conflict with MovableContainer (so not enabled for DictQuickLookup, where it could have been nice - but it would work only with text dictionaries, not with HTML ones, as ScrollHtmlWidget can't really do that).
This commit is contained in:
@@ -30,6 +30,7 @@ local InputText = InputContainer:new{
|
||||
parent = nil, -- parent dialog that will be set dirty
|
||||
edit_callback = nil, -- called with true when text modified, false on init or text re-set
|
||||
scroll_callback = nil, -- called with (low, high) when view is scrolled (cf ScrollTextWidget)
|
||||
scroll_by_pan = false, -- allow scrolling by lines with Pan (needs scroll=true)
|
||||
|
||||
width = nil,
|
||||
height = nil, -- when nil, will be set to original text height (possibly
|
||||
@@ -322,6 +323,7 @@ function InputText:initTextBox(text, char_added)
|
||||
height = self.height,
|
||||
dialog = self.parent,
|
||||
scroll_callback = self.scroll_callback,
|
||||
scroll_by_pan = self.scroll_by_pan,
|
||||
}
|
||||
else
|
||||
self.text_widget = TextBoxWidget:new{
|
||||
|
||||
Reference in New Issue
Block a user