[TextBoxWidget] Find in definition (wiki edition) (#15356)

This commit is contained in:
David authored and GitHub committed 2026-05-31 13:52:30 +01:00
1 parent 644a80bce1
commit c35c508be7
4 files changed
+409 -9

No files matched your search

+7
View File
@@ -42,6 +42,7 @@ local ScrollTextWidget = InputContainer:extend{
auto_para_direction = false,
alignment_strict = false,
highlight_text_selection = false,
on_clear_search = nil,
-- for internal use
for_measurement_only = nil, -- When the widget is a one-off used to compute text height
@@ -70,6 +71,7 @@ function ScrollTextWidget:init()
alignment_strict = self.alignment_strict,
for_measurement_only = self.for_measurement_only,
highlight_text_selection = self.highlight_text_selection,
on_clear_search = self.on_clear_search,
}
local visible_line_count = self.text_widget:getVisLineCount()
local total_line_count = self.text_widget:getAllLineCount()
@@ -303,6 +305,7 @@ function ScrollTextWidget:onScrollText(arg, ges)
end
function ScrollTextWidget:onTapScrollText(arg, ges)
if self.ignore_taps then return false end
if self.editable then
-- Tap is used to position cursor
return false
@@ -315,6 +318,10 @@ function ScrollTextWidget:onTapScrollText(arg, ges)
end
end
function ScrollTextWidget:setTapScrollEnabled(enabled)
self.ignore_taps = not enabled
end
function ScrollTextWidget:onScrollUp()
if self.text_widget.virtual_line_num > 1 then
self:scrollText(-1)