DictQuickLookup: two minor fixes (#8333)

- Allow Wikipedia languages cycling when invoked
  from File browser.
- Fix TextBoxWidget content not updated when next/prev
  when use_xtext=false.
pull/8334/head
poire-z 3 years ago committed by GitHub
parent 1c2e5eee1d
commit ca1c3484d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -64,16 +64,15 @@ local highlight_strings = {
}
function DictQuickLookup:canSearch()
if self:isDocless() then
return false
end
if self.is_wiki then
-- In the Wiki variant of this widget, the Search button is coopted to cycle between enabled languages.
if #self.wiki_languages > 1 then
return true
end
else
if self:isDocless() then
return false
end
-- This is to prevent an ineffective button when we're launched from the Reader's menu.
if self.highlight then
return true
@ -853,6 +852,7 @@ function DictQuickLookup:update()
-- Re-use our ScrollTextWidget (self.stw_widget)
-- Update properties that may change across results (as done in DictQuickLookup:_instantiateScrollWidget())
self.text_widget.text_widget.text = self.definition
self.text_widget.text_widget.charlist = nil -- (required when use_xtext=false for proper re-init)
self.text_widget.text_widget.lang = self.lang and self.lang:lower()
self.text_widget.text_widget.para_direction_rtl = self.rtl_lang
self.text_widget.text_widget.images = self.images

Loading…
Cancel
Save