词典两个按钮改为图标

This commit is contained in:
MrZ626
2021-10-28 02:34:57 +08:00
parent 8c6df74237
commit 28e83dcf02
8 changed files with 10 additions and 25 deletions

View File

@@ -558,8 +558,6 @@ return{
}, },
dict={ dict={
title="TetroDictionary", title="TetroDictionary",
copy="Copy page",
link="Open URL",
}, },
stat={ stat={
path="Open Data Folder", path="Open Data Folder",

View File

@@ -517,8 +517,6 @@ return{
}, },
dict={ dict={
title="TetroDictionary", title="TetroDictionary",
-- copy="Copy page",
link="Abrir URL",
}, },
stat={ stat={
path="Abrir carpeta del juego", path="Abrir carpeta del juego",

View File

@@ -513,8 +513,6 @@ return{
}, },
dict={ dict={
title="TetroDictionary", title="TetroDictionary",
-- copy="Copy page",
link="Ouvrir URL",
}, },
stat={ stat={
path="Ouvrir dossier des données", path="Ouvrir dossier des données",

View File

@@ -548,8 +548,6 @@ return{
}, },
dict={ dict={
title="TetroDictionary", title="TetroDictionary",
-- copy="Copy page",
link="Abrir URL",
}, },
stat={ stat={
path="Abrir Pasta De Data", path="Abrir Pasta De Data",

View File

@@ -427,8 +427,6 @@ return{
}, },
dict={ dict={
title="TetroDictionary", title="TetroDictionary",
copy=":→__",
link="~~e>>",
}, },
stat={ stat={
path="%$%", path="%$%",

View File

@@ -575,8 +575,6 @@ return{
}, },
dict={ dict={
title="小Z方块词典", title="小Z方块词典",
copy="复制页面",
link="打开链接",
}, },
stat={ stat={
path="打开存储目录", path="打开存储目录",

View File

@@ -559,8 +559,6 @@ return{
}, },
dict={ dict={
title="四联词典", title="四联词典",
copy="复印页",
link="打开网页",
}, },
stat={ stat={
path="打开数据文件夹", path="打开数据文件夹",

View File

@@ -1,7 +1,6 @@
local gc=love.graphics local gc=love.graphics
local inputBox=WIDGET.newInputBox{name='input',x=20,y=110,w=762,h=60,font=40,limit=32} local inputBox=WIDGET.newInputBox{name='input',x=20,y=110,w=762,h=60,font=40,limit=32}
local copyButton=WIDGET.newKey{name='copy',x=940,y=655,w=200,h=80,font=35,code=pressKey"cC"}
local int,abs=math.floor,math.abs local int,abs=math.floor,math.abs
local min,sin=math.min,math.sin local min,sin=math.min,math.sin
local ins=table.insert local ins=table.insert
@@ -50,7 +49,7 @@ local function _clearResult()
selected=1 selected=1
scrollPos=0 scrollPos=0
waiting,lastSearch=0,false waiting,lastSearch=0,false
copyButton.hide=false scene.widgetList.copy.hide=false
end end
local function _search() local function _search()
local input=inputBox:getText():lower() local input=inputBox:getText():lower()
@@ -97,7 +96,7 @@ function scene.keyDown(key)
if selected<scrollPos+1 then if selected<scrollPos+1 then
scrollPos=scrollPos-1 scrollPos=scrollPos-1
end end
copyButton.hide=false scene.widgetList.copy.hide=false
end end
elseif key=="down"then elseif key=="down"then
if selected and selected<#_getList()then if selected and selected<#_getList()then
@@ -105,7 +104,7 @@ function scene.keyDown(key)
if selected>scrollPos+15 then if selected>scrollPos+15 then
scrollPos=selected-15 scrollPos=selected-15
end end
copyButton.hide=false scene.widgetList.copy.hide=false
end end
elseif key=="left"or key=="pageup"then elseif key=="left"or key=="pageup"then
for _=1,12 do scene.keyDown("up")end for _=1,12 do scene.keyDown("up")end
@@ -131,7 +130,7 @@ function scene.keyDown(key)
local t=_getList()[selected] local t=_getList()[selected]
t=t.title..":\n"..t.content..(t.url and"\n[ "..t.url.." ]\n"or"\n")..text.dictNote t=t.title..":\n"..t.content..(t.url and"\n[ "..t.url.." ]\n"or"\n")..text.dictNote
love.system.setClipboardText(t) love.system.setClipboardText(t)
copyButton.hide=true scene.widgetList.copy.hide=true
MES.new('info',text.copyDone) MES.new('info',text.copyDone)
return return
else else
@@ -206,12 +205,12 @@ scene.widgetList={
WIDGET.newText{name='book', x=20,y=15,font=70,align='L',fText=CHAR.icon.zBook}, WIDGET.newText{name='book', x=20,y=15,font=70,align='L',fText=CHAR.icon.zBook},
WIDGET.newText{name='title', x=100,y=15,font=70,align='L'}, WIDGET.newText{name='title', x=100,y=15,font=70,align='L'},
inputBox, inputBox,
copyButton, WIDGET.newKey{name='link', x=1120,y=655,w=80,font=55,fText=CHAR.icon.globe, code=pressKey"link",hideF=function()return not _getList()[selected].url end},
WIDGET.newKey{name='link', x=1150,y=655,w=200,h=80,font=35,code=pressKey"link",hideF=function()return not _getList()[selected].url end}, WIDGET.newKey{name='copy', x=1210,y=655,w=80,font=50,fText=CHAR.icon.copy, code=pressKey"cC"},
WIDGET.newKey{name='up', x=1130,y=460,w=60,h=90,font=35,fText="",code=pressKey"up",hide=not MOBILE}, WIDGET.newKey{name='up', x=1120,y=475,w=80,font=50,fText=CHAR.key.up, code=pressKey"up",hide=not MOBILE},
WIDGET.newKey{name='down', x=1130,y=560,w=60,h=90,font=35,fText="",code=pressKey"down",hide=not MOBILE}, WIDGET.newKey{name='down', x=1120,y=565,w=80,font=50,fText=CHAR.key.down, code=pressKey"down",hide=not MOBILE},
WIDGET.newKey{name='pageup', x=1210,y=460,w=80,h=90,font=35,fText="↑↑",code=pressKey"pageup",hide=not MOBILE}, WIDGET.newKey{name='pageup', x=1210,y=475,w=80,font=50,fText=CHAR.icon.toUp, code=pressKey"pageup",hide=not MOBILE},
WIDGET.newKey{name='pagedown',x=1210,y=560,w=80,h=90,font=35,fText="↓↓",code=pressKey"pagedown",hide=not MOBILE}, WIDGET.newKey{name='pagedown',x=1210,y=565,w=80,font=50,fText=CHAR.icon.toDown,code=pressKey"pagedown",hide=not MOBILE},
WIDGET.newButton{name='back', x=1165,y=60,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1165,y=60,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }