Checkbutton widget optimization (#8522)

-checkmark toggling is separated from the callback
-default width added
This commit is contained in:
hius07
2021-12-07 13:35:44 +02:00
committed by GitHub
parent 6ebcfd9e79
commit 19271c08c4
8 changed files with 21 additions and 63 deletions

View File

@@ -139,20 +139,12 @@ function ReaderSearch:onShowFulltextSearchInput()
text = _("Case sensitive"),
checked = not self.case_insensitive,
parent = self.input_dialog,
max_width = self.input_dialog._input_widget.width,
callback = function()
self.check_button_case:toggleCheck()
end,
}
self.input_dialog:addWidget(self.check_button_case)
self.check_button_regex = CheckButton:new{
text = _("Regular expression (long-press for help)"),
checked = self.use_regex,
parent = self.input_dialog,
max_width = self.input_dialog._input_widget.width,
callback = function()
self.check_button_regex:toggleCheck()
end,
hold_callback = function()
UIManager:show(InfoMessage:new{
text = help_text,