From 3f9dc4631582fbe1ce9eb2edf8ed8c2b4c50f9f8 Mon Sep 17 00:00:00 2001 From: Hans-Werner Hilse Date: Sun, 30 Nov 2014 17:57:41 +0000 Subject: [PATCH] fix dict window refresh was still using old API also, move this to another place. --- frontend/ui/widget/dictquicklookup.lua | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/frontend/ui/widget/dictquicklookup.lua b/frontend/ui/widget/dictquicklookup.lua index 5c11dd4ad..26c74b91c 100644 --- a/frontend/ui/widget/dictquicklookup.lua +++ b/frontend/ui/widget/dictquicklookup.lua @@ -88,6 +88,7 @@ function DictQuickLookup:init() end function DictQuickLookup:update() + local orig_dimen = self.dict_frame and self.dict_frame.dimen or Geom:new{} -- calculate window dimension and try to not hide highlighted word self.align = "center" self.region = Geom:new{ @@ -256,7 +257,12 @@ function DictQuickLookup:update() self.dict_frame, } } - UIManager:setDirty("all", "partial") + + UIManager:setDirty("all", function() + local update_region = self.dict_frame.dimen:combine(orig_dimen) + DEBUG("update dict region", update_region) + return "partial", update_region + end) end function DictQuickLookup:isPrevDictAvaiable() @@ -282,14 +288,7 @@ function DictQuickLookup:changeDictionary(index) self.lookupword = self.results[index].word self.definition = self.results[index].definition - local orig_dimen = self.dict_frame and self.dict_frame.dimen or Geom:new{} self:update() - - UIManager.update_regions_func = function() - local update_region = self.dict_frame.dimen:combine(orig_dimen) - DEBUG("update dict region", update_region) - return {update_region} - end end function DictQuickLookup:changeToDefaultDict()