mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #233 from thotypous/fl-toggle-clear
Add InputText:setText and avoid non-intuitive UI behavior after light toggle
This commit is contained in:
@@ -69,6 +69,7 @@ function ReaderFrontLight:onShowFlDialog()
|
||||
text = _("Toggle"),
|
||||
enabled = true,
|
||||
callback = function()
|
||||
self.fl_dialog.input:setText("")
|
||||
fl:toggle()
|
||||
end,
|
||||
},
|
||||
|
||||
@@ -114,6 +114,12 @@ function InputText:getText()
|
||||
return self.text
|
||||
end
|
||||
|
||||
function InputText:setText(text)
|
||||
self:StringToCharlist(text)
|
||||
self:initTextBox()
|
||||
UIManager:setDirty(self.parent, "partial")
|
||||
end
|
||||
|
||||
function InputText:StringToCharlist(text)
|
||||
if text == nil then return end
|
||||
-- clear
|
||||
|
||||
Reference in New Issue
Block a user