|
|
@ -34,7 +34,7 @@ local DictQuickLookup = InputContainer:new{
|
|
|
|
content_face = Font:getFace("cfont", DDICT_FONT_SIZE),
|
|
|
|
content_face = Font:getFace("cfont", DDICT_FONT_SIZE),
|
|
|
|
width = nil,
|
|
|
|
width = nil,
|
|
|
|
height = nil,
|
|
|
|
height = nil,
|
|
|
|
|
|
|
|
|
|
|
|
title_padding = Screen:scaleByDPI(5),
|
|
|
|
title_padding = Screen:scaleByDPI(5),
|
|
|
|
title_margin = Screen:scaleByDPI(2),
|
|
|
|
title_margin = Screen:scaleByDPI(2),
|
|
|
|
word_padding = Screen:scaleByDPI(2),
|
|
|
|
word_padding = Screen:scaleByDPI(2),
|
|
|
@ -113,13 +113,13 @@ function DictQuickLookup:update()
|
|
|
|
height = self.height*0.7,
|
|
|
|
height = self.height*0.7,
|
|
|
|
dialog = self,
|
|
|
|
dialog = self,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
local button_table = ButtonTable:new{
|
|
|
|
local button_table = ButtonTable:new{
|
|
|
|
width = math.max(self.width, definition:getSize().w),
|
|
|
|
width = math.max(self.width, definition:getSize().w),
|
|
|
|
button_font_face = "cfont",
|
|
|
|
button_font_face = "cfont",
|
|
|
|
button_font_size = 20,
|
|
|
|
button_font_size = 20,
|
|
|
|
buttons = {
|
|
|
|
buttons = {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
text = _("<<"),
|
|
|
|
text = _("<<"),
|
|
|
|
enabled = self:isPrevDictAvaiable(),
|
|
|
|
enabled = self:isPrevDictAvaiable(),
|
|
|
@ -153,6 +153,7 @@ function DictQuickLookup:update()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
zero_sep = true,
|
|
|
|
zero_sep = true,
|
|
|
|
|
|
|
|
show_parent = self,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
local title_bar = LineWidget:new{
|
|
|
|
local title_bar = LineWidget:new{
|
|
|
|
--background = 8,
|
|
|
|
--background = 8,
|
|
|
@ -161,12 +162,12 @@ function DictQuickLookup:update()
|
|
|
|
h = Screen:scaleByDPI(2),
|
|
|
|
h = Screen:scaleByDPI(2),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
self.dict_bar = OverlapGroup:new{
|
|
|
|
self.dict_bar = OverlapGroup:new{
|
|
|
|
dimen = {w = button_table:getSize().w, h = self.dict_title:getSize().h},
|
|
|
|
dimen = {w = button_table:getSize().w, h = self.dict_title:getSize().h},
|
|
|
|
self.dict_title,
|
|
|
|
self.dict_title,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
self.dict_frame = FrameContainer:new{
|
|
|
|
self.dict_frame = FrameContainer:new{
|
|
|
|
radius = 8,
|
|
|
|
radius = 8,
|
|
|
|
bordersize = 3,
|
|
|
|
bordersize = 3,
|
|
|
@ -237,7 +238,7 @@ function DictQuickLookup:changeDictionary(index)
|
|
|
|
self.dictionary = self.results[index].dict
|
|
|
|
self.dictionary = self.results[index].dict
|
|
|
|
self.lookupword = self.results[index].word
|
|
|
|
self.lookupword = self.results[index].word
|
|
|
|
self.definition = self.results[index].definition
|
|
|
|
self.definition = self.results[index].definition
|
|
|
|
|
|
|
|
|
|
|
|
local orig_dimen = self.dict_frame and self.dict_frame.dimen or Geom:new{}
|
|
|
|
local orig_dimen = self.dict_frame and self.dict_frame.dimen or Geom:new{}
|
|
|
|
self:update()
|
|
|
|
self:update()
|
|
|
|
|
|
|
|
|
|
|
@ -248,7 +249,7 @@ function DictQuickLookup:changeDictionary(index)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function DictQuickLookup:changeToDefaultDict()
|
|
|
|
function DictQuickLookup:changeToDefaultDict()
|
|
|
|
if self.dictionary then
|
|
|
|
if self.dictionary then
|
|
|
|
-- dictionaries that have definition of the first word(accurate word)
|
|
|
|
-- dictionaries that have definition of the first word(accurate word)
|
|
|
|
-- excluding Fuzzy queries.
|
|
|
|
-- excluding Fuzzy queries.
|
|
|
|