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:
Huang Xin
2013-08-21 05:06:51 -07:00
2 changed files with 7 additions and 0 deletions

View File

@@ -69,6 +69,7 @@ function ReaderFrontLight:onShowFlDialog()
text = _("Toggle"),
enabled = true,
callback = function()
self.fl_dialog.input:setText("")
fl:toggle()
end,
},

View File

@@ -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