mirror of
https://gitee.com/energye/energy.git
synced 2024-12-10 07:37:53 +08:00
U: demo lcl window mask
This commit is contained in:
parent
18cfe18706
commit
c87b365f02
@ -35,16 +35,20 @@ func Create(window *cef.LCLBrowserWindow) *Mask {
|
||||
mem.LoadFromFSFile("resources/loading.gif")
|
||||
//play.LoadFromFile("本地加载") //或本地加载
|
||||
mask.gifPlay.LoadFromStream(mem)
|
||||
mask.gifPlay.SetOnFrameChanged(func(sender lcl.IObject) {
|
||||
fmt.Println("OnFrameChanged CurrentImageIndex:", mask.gifPlay.CurrentImageIndex())
|
||||
})
|
||||
mem.Free() // stream free
|
||||
//关闭时释放掉 play 占内存啊
|
||||
mask.maskForm.SetOnClose(func(sender lcl.IObject, action *types.TCloseAction) {
|
||||
mask.gifPlay.Animate(false)
|
||||
mask.gifPlay.Free()
|
||||
})
|
||||
// 进度显示
|
||||
mask.progressLabel = lcl.NewLabel(mask.maskForm)
|
||||
mask.progressLabel.SetParent(mask.maskForm)
|
||||
mask.progressLabel.Font().SetColor(colors.ClRed)
|
||||
mask.progressLabel.Font().SetSize(24)
|
||||
mask.progressLabel.Font().SetSize(18)
|
||||
// 居中显示
|
||||
var center = func(sender lcl.IObject) {
|
||||
mask.gifPlay.SetLeft(window.Width()/2 - mask.gifPlay.Width()/2)
|
||||
|
Loading…
Reference in New Issue
Block a user