VBox 是布局容器不支持 click 事件,导致: - 语言代码不显示(VBox 无 otext) - 点击无反应(VBox 不触发 click bind) - 语言切换后代码不更新(缺少 app lang bind) 恢复为 Text widget + Popup click + lang event bind
36 lines
594 B
XML
36 lines
594 B
XML
{
|
|
"id":"language",
|
|
"widgettype":"Text",
|
|
"options":{
|
|
"tip":"change UI language",
|
|
"i18n":true,
|
|
"otext":"{{params_kw._lang}}",
|
|
"cwidth": 4,
|
|
"css":"clickable"
|
|
},
|
|
"binds":[
|
|
{
|
|
"wid":"self",
|
|
"event":"click",
|
|
"actiontype":"urlwidget",
|
|
"target":"Popup",
|
|
"popup_options":{
|
|
"eventpos":true,
|
|
"cwidth": 11,
|
|
"cheight":10,
|
|
"dismiss_events":["command"]
|
|
},
|
|
"options":{
|
|
"url":"{{entire_url('menu.ui')}}"
|
|
}
|
|
},
|
|
{
|
|
"wid":"app",
|
|
"event":"lang",
|
|
"actiontype":"script",
|
|
"target":"self",
|
|
"script":"this.set_otext(bricks.app.lang)"
|
|
}
|
|
]
|
|
}
|