From f3bcbd3b4eeb1fea9d19e62309db87a78d2ff039 Mon Sep 17 00:00:00 2001 From: chrox Date: Mon, 22 Jul 2013 22:09:14 +0800 Subject: [PATCH] use regional update when displaying dict windows --- frontend/ui/widget/dict.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/ui/widget/dict.lua b/frontend/ui/widget/dict.lua index c939177bb..c2b4ec869 100644 --- a/frontend/ui/widget/dict.lua +++ b/frontend/ui/widget/dict.lua @@ -154,6 +154,7 @@ function DictQuickLookup:update() dimen = Screen:getSize(), self.dict_frame, } + UIManager.repaint_all = true end function DictQuickLookup:isPrevDictAvaiable() @@ -177,8 +178,15 @@ function DictQuickLookup:changeDictionary(index) self.dictionary = self.results[index].dict 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.repaint_all = true + + UIManager.update_region_func = function() + local update_region = self.dict_frame.dimen:combine(orig_dimen) + DEBUG("update region", update_region) + return update_region + end end function DictQuickLookup:changeToDefaultDict()