mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
ConfirmBox: add widgets (#10364)
This commit is contained in:
@@ -38,8 +38,8 @@ local CheckButton = InputContainer:extend{
|
||||
background = Blitbuffer.COLOR_WHITE,
|
||||
text = nil,
|
||||
parent = nil, -- parent widget, must be set by the caller
|
||||
width = nil, -- default value: parent widget's input widget width
|
||||
-- If the parent widget has no input widget, the width must be set by the caller.
|
||||
width = nil, -- default value: parent widget's added widgets available width
|
||||
-- If the parent widget has no getAddedWidgetAvailableWidth() method, the width must be set by the caller.
|
||||
}
|
||||
|
||||
function CheckButton:init()
|
||||
@@ -70,7 +70,7 @@ function CheckButton:initCheckButton(checked)
|
||||
self._textwidget = TextBoxWidget:new{
|
||||
text = self.text,
|
||||
face = self.face,
|
||||
width = (self.width or self.parent._input_widget.width) - self._checkmark.dimen.w,
|
||||
width = (self.width or self.parent:getAddedWidgetAvailableWidth()) - self._checkmark.dimen.w,
|
||||
fgcolor = self.enabled and Blitbuffer.COLOR_BLACK or Blitbuffer.COLOR_DARK_GRAY,
|
||||
}
|
||||
local textbox_shift = math.max(0, self._checkmark.baseline - self._textwidget:getBaseline())
|
||||
|
||||
Reference in New Issue
Block a user