From 40858c670a2d0512af8a3cf854f341dc697ccf7f Mon Sep 17 00:00:00 2001 From: chrox Date: Fri, 17 Jun 2016 00:04:15 +0800 Subject: [PATCH] restrict dictionary window inside of screen especially in landscape mode This should fix #2020. --- frontend/ui/widget/dictquicklookup.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/ui/widget/dictquicklookup.lua b/frontend/ui/widget/dictquicklookup.lua index 57009c3e8..6ed37c0d0 100644 --- a/frontend/ui/widget/dictquicklookup.lua +++ b/frontend/ui/widget/dictquicklookup.lua @@ -108,11 +108,11 @@ function DictQuickLookup:update() } if self.word_box then local box = self.word_box - if box.y + box.h/2 < Screen:getHeight()/2 then + if box.y + box.h/2 < Screen:getHeight()*0.3 then self.region.y = box.y + box.h self.region.h = Screen:getHeight() - box.y - box.h self.align = "top" - else + elseif box.y + box.h/2 > Screen:getHeight()*0.7 then self.region.y = 0 self.region.h = box.y self.align = "bottom"