mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #1828 from koreader/houqp-master
fix(readerfontlight): crash in toggle
This commit is contained in:
@@ -93,7 +93,7 @@ function ReaderFrontLight:onShowFlDialog()
|
||||
text = _("Toggle"),
|
||||
enabled = true,
|
||||
callback = function()
|
||||
self.fl_dialog.input:setText("")
|
||||
self.fl_dialog:setInputText("")
|
||||
powerd:toggleFrontlight()
|
||||
end,
|
||||
},
|
||||
|
||||
@@ -57,7 +57,7 @@ function InputDialog:init()
|
||||
width = self.width,
|
||||
}
|
||||
}
|
||||
self.input_widget = InputText:new{
|
||||
self._input_widget = InputText:new{
|
||||
text = self.input,
|
||||
hint = self.input_hint,
|
||||
face = self.input_face,
|
||||
@@ -99,9 +99,9 @@ function InputDialog:init()
|
||||
CenterContainer:new{
|
||||
dimen = Geom:new{
|
||||
w = self.title_bar:getSize().w,
|
||||
h = self.input_widget:getSize().h,
|
||||
h = self._input_widget:getSize().h,
|
||||
},
|
||||
self.input_widget,
|
||||
self._input_widget,
|
||||
},
|
||||
-- buttons
|
||||
CenterContainer:new{
|
||||
@@ -117,12 +117,20 @@ function InputDialog:init()
|
||||
self[1] = CenterContainer:new{
|
||||
dimen = Geom:new{
|
||||
w = Screen:getWidth(),
|
||||
h = Screen:getHeight() - self.input_widget:getKeyboardDimen().h,
|
||||
h = Screen:getHeight() - self._input_widget:getKeyboardDimen().h,
|
||||
},
|
||||
self.dialog_frame,
|
||||
}
|
||||
end
|
||||
|
||||
function InputDialog:getInputText()
|
||||
return self._input_widget:getText()
|
||||
end
|
||||
|
||||
function InputDialog:setInputText(text)
|
||||
self._input_widget:setText(text)
|
||||
end
|
||||
|
||||
function InputDialog:onShow()
|
||||
UIManager:setDirty(self, function()
|
||||
return "ui", self.dialog_frame.dimen
|
||||
@@ -136,15 +144,11 @@ function InputDialog:onCloseWidget()
|
||||
end
|
||||
|
||||
function InputDialog:onShowKeyboard()
|
||||
self.input_widget:onShowKeyboard()
|
||||
end
|
||||
|
||||
function InputDialog:getInputText()
|
||||
return self.input_widget:getText()
|
||||
self._input_widget:onShowKeyboard()
|
||||
end
|
||||
|
||||
function InputDialog:onClose()
|
||||
self.input_widget:onCloseKeyboard()
|
||||
self._input_widget:onCloseKeyboard()
|
||||
end
|
||||
|
||||
return InputDialog
|
||||
|
||||
@@ -31,7 +31,6 @@ local FrameContainer = require("ui/widget/container/framecontainer")
|
||||
local AlphaContainer = require("ui/widget/container/alphacontainer")
|
||||
local ConfirmBox = require("ui/widget/confirmbox")
|
||||
local TouchMenu = require("ui/widget/touchmenu")
|
||||
local InputText = require("ui/widget/inputtext")
|
||||
local DocumentRegistry = require("document/documentregistry")
|
||||
local ReaderUI = require("apps/reader/readerui")
|
||||
local DEBUG = require("dbg")
|
||||
|
||||
Reference in New Issue
Block a user