mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
VirtualKeyboard: Revamp visibility handling (#10852)
Move as much of the state tracking as possible inside VirtualKeyboard itself. InputDialog unfortunately needs an internal tracking of this state because it needs to know about it *before* the VK is shown, so we have to keep a bit of duplication in there, although we do try much harder to keep everything in sync (at least at function call edges), and to keep the damage contained to, essentially, the toggle button's handler. (Followup to #10803 & #10850)
This commit is contained in:
@@ -218,7 +218,9 @@ end
|
||||
function MultiInputDialog:onSwitchFocus(inputbox)
|
||||
-- unfocus current inputbox
|
||||
self._input_widget:unfocus()
|
||||
self._input_widget:onCloseKeyboard()
|
||||
-- and close its existing keyboard (via InputDialog's thin wrapper around _input_widget's own method)
|
||||
self:onCloseKeyboard()
|
||||
|
||||
UIManager:setDirty(nil, function()
|
||||
return "ui", self.dialog_frame.dimen
|
||||
end)
|
||||
@@ -226,7 +228,9 @@ function MultiInputDialog:onSwitchFocus(inputbox)
|
||||
-- focus new inputbox
|
||||
self._input_widget = inputbox
|
||||
self._input_widget:focus()
|
||||
self._input_widget:onShowKeyboard()
|
||||
|
||||
-- Make sure we have a (new) visible keyboard
|
||||
self:onShowKeyboard()
|
||||
end
|
||||
|
||||
return MultiInputDialog
|
||||
|
||||
Reference in New Issue
Block a user