gui: add nav context images for refresh + close

This commit is contained in:
mappu 2024-06-28 12:00:18 +12:00
parent 15b29b32ce
commit ef70e5825a
3 changed files with 6 additions and 1 deletions

BIN
assets/arrow_refresh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

View File

@ -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)

View File

@ -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)
}