refactor(tracker): change so that all icon initialization is a lazy & cache in iconcache

This commit is contained in:
vsariola
2021-02-01 17:57:13 +02:00
parent c667ffb4e1
commit 3cf2fc70a8
4 changed files with 30 additions and 48 deletions

View File

@ -9,6 +9,7 @@ import (
"gioui.org/op/paint"
"gioui.org/unit"
"gioui.org/widget/material"
"golang.org/x/exp/shiny/materialdesign/icons"
)
func (t *Tracker) layoutSongPanel(gtx C) D {
@ -36,17 +37,17 @@ func (t *Tracker) layoutSongButtons(gtx C) D {
t.SaveSongFile()
}
newBtnStyle := material.IconButton(t.Theme, t.NewSongFileBtn, clearIcon)
newBtnStyle := material.IconButton(t.Theme, t.NewSongFileBtn, widgetForIcon(icons.ContentClear))
newBtnStyle.Background = transparent
newBtnStyle.Inset = layout.UniformInset(unit.Dp(6))
newBtnStyle.Color = primaryColor
loadBtnStyle := material.IconButton(t.Theme, t.LoadSongFileBtn, loadIcon)
loadBtnStyle := material.IconButton(t.Theme, t.LoadSongFileBtn, widgetForIcon(icons.FileFolder))
loadBtnStyle.Background = transparent
loadBtnStyle.Inset = layout.UniformInset(unit.Dp(6))
loadBtnStyle.Color = primaryColor
saveBtnStyle := material.IconButton(t.Theme, t.SaveSongFileBtn, saveIcon)
saveBtnStyle := material.IconButton(t.Theme, t.SaveSongFileBtn, widgetForIcon(icons.ContentSave))
saveBtnStyle.Background = transparent
saveBtnStyle.Inset = layout.UniformInset(unit.Dp(6))
saveBtnStyle.Color = primaryColor