gui: add nav context images for refresh + close
This commit is contained in:
parent
15b29b32ce
commit
ef70e5825a
BIN
assets/arrow_refresh.png
Normal file
BIN
assets/arrow_refresh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 685 B |
@ -10,7 +10,8 @@ import (
|
||||
var assetsFs embed.FS
|
||||
|
||||
const (
|
||||
imgChartBar int32 = iota
|
||||
imgArrowRefresh int32 = iota
|
||||
imgChartBar
|
||||
imgDatabase
|
||||
imgDatabaseAdd
|
||||
imgDatabaseDelete
|
||||
@ -46,6 +47,7 @@ func loadImages(owner vcl.IComponent) *vcl.TImageList {
|
||||
}
|
||||
|
||||
ilist := vcl.NewImageList(owner)
|
||||
ilist.Add(mustLoad("assets/arrow_refresh.png"), nil)
|
||||
ilist.Add(mustLoad("assets/chart_bar.png"), nil)
|
||||
ilist.Add(mustLoad("assets/database.png"), nil)
|
||||
ilist.Add(mustLoad("assets/database_add.png"), nil)
|
||||
|
3
main.go
3
main.go
@ -387,9 +387,11 @@ func (f *TMainForm) OnNavContextPopup(sender vcl.IObject, mousePos types.TPoint,
|
||||
}
|
||||
|
||||
mnu := vcl.NewPopupMenu(f.Buckets)
|
||||
mnu.SetImages(f.ImageList)
|
||||
|
||||
mnuRefresh := vcl.NewMenuItem(mnu)
|
||||
mnuRefresh.SetCaption("Refresh")
|
||||
mnuRefresh.SetImageIndex(imgArrowRefresh)
|
||||
mnuRefresh.SetOnClick(f.OnNavContextRefresh)
|
||||
mnu.Items().Add(mnuRefresh)
|
||||
|
||||
@ -424,6 +426,7 @@ func (f *TMainForm) OnNavContextPopup(sender vcl.IObject, mousePos types.TPoint,
|
||||
mnuClose := vcl.NewMenuItem(mnu)
|
||||
mnuClose.SetCaption("Close")
|
||||
mnuClose.SetOnClick(f.OnNavContextClose)
|
||||
mnuClose.SetImageIndex(imgDatabaseDelete)
|
||||
mnu.Items().Add(mnuClose)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user