Hyphenation: add custom hyphenation rules (#7746)

The hyphenation of a word can be changed from its default
by long pressing for 3 seconds and selecting 'Hyphenate'.
These overrides are stored in a per-language file, i.e:
koreader/settings/user-German.hyph.
This commit is contained in:
zwim
2021-05-31 20:34:26 +02:00
committed by GitHub
parent b30e366ccd
commit f25da5d0d5
39 changed files with 355 additions and 256 deletions

View File

@@ -61,7 +61,6 @@ local InputText = InputContainer:new{
for_measurement_only = nil, -- When the widget is a one-off used to compute text height
do_select = false, -- to start text selection
selection_start_pos = nil, -- selection start position
is_keyboard_hidden = false, -- to be able to show the keyboard again when it was hidden (by VK itself)
}
-- only use PhysicalKeyboard if the device does not have touch screen
@@ -122,11 +121,6 @@ if Device:isTouchDevice() or Device:hasDPad() then
function InputText:onTapTextBox(arg, ges)
if self.parent.onSwitchFocus then
self.parent:onSwitchFocus(self)
else
if self.is_keyboard_hidden == true then
self:onShowKeyboard()
self.is_keyboard_hidden = false
end
end
if #self.charlist > 0 then -- Avoid cursor moving within a hint.
local textwidget_offset = self.margin + self.bordersize + self.padding
@@ -569,21 +563,12 @@ end
function InputText:onShowKeyboard(ignore_first_hold_release)
Device:startTextInput()
self.keyboard.ignore_first_hold_release = ignore_first_hold_release
UIManager:show(self.keyboard)
return true
end
function InputText:onHideKeyboard()
if not self.has_nav_bar then
UIManager:close(self.keyboard)
Device:stopTextInput()
self.is_keyboard_hidden = true
end
return self.is_keyboard_hiddenend
end
function InputText:onCloseKeyboard()
UIManager:close(self.keyboard)
Device:stopTextInput()