Checkbutton: remove unused (#8108)

* Inputtext checkbutton: add "parent"
pull/8115/head
hius07 3 years ago committed by GitHub
parent 1c739f1d54
commit 66b644295a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,7 +26,6 @@ local TextBoxWidget = require("ui/widget/textboxwidget")
local UIManager = require("ui/uimanager") local UIManager = require("ui/uimanager")
local VerticalGroup = require("ui/widget/verticalgroup") local VerticalGroup = require("ui/widget/verticalgroup")
local VerticalSpan = require("ui/widget/verticalspan") local VerticalSpan = require("ui/widget/verticalspan")
local Screen = Device.screen
local CheckButton = InputContainer:new{ local CheckButton = InputContainer:new{
callback = nil, callback = nil,
@ -35,15 +34,8 @@ local CheckButton = InputContainer:new{
enabled = true, enabled = true,
face = Font:getFace("smallinfofont"), face = Font:getFace("smallinfofont"),
background = Blitbuffer.COLOR_WHITE, background = Blitbuffer.COLOR_WHITE,
overlap_align = "right",
text = nil, text = nil,
toggle_text = nil,
max_width = nil, -- must be set by the caller max_width = nil, -- must be set by the caller
window = nil,
padding = Screen:scaleBySize(5),
margin = Screen:scaleBySize(5),
bordersize = Screen:scaleBySize(3),
} }
function CheckButton:init() function CheckButton:init()

@ -391,6 +391,7 @@ function InputText:initTextBox(text, char_added)
if self.is_password_type and self.show_password_toggle then if self.is_password_type and self.show_password_toggle then
self._check_button = self._check_button or CheckButton:new{ self._check_button = self._check_button or CheckButton:new{
text = _("Show password"), text = _("Show password"),
parent = self,
max_width = self.width, max_width = self.width,
callback = function() callback = function()
if self.text_type == "text" then if self.text_type == "text" then
@ -402,10 +403,6 @@ function InputText:initTextBox(text, char_added)
end end
self:setText(self:getText(), true) self:setText(self:getText(), true)
end, end,
padding = self.padding,
margin = self.margin,
bordersize = self.bordersize,
} }
self._password_toggle = FrameContainer:new{ self._password_toggle = FrameContainer:new{
bordersize = 0, bordersize = 0,

Loading…
Cancel
Save