mirror of
https://github.com/vsariola/sointu.git
synced 2025-06-03 17:18:20 -04:00
feat(tracker): make clear song button to reset to default song
This commit is contained in:
parent
2378be5021
commit
c90f8efbdc
@ -22,6 +22,7 @@ var downIcon *widget.Icon
|
||||
var addIcon *widget.Icon
|
||||
var loadIcon *widget.Icon
|
||||
var saveIcon *widget.Icon
|
||||
var clearIcon *widget.Icon
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
@ -45,6 +46,10 @@ func init() {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
clearIcon, err = widget.NewIcon(icons.ContentClear)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func smallButton(icStyle material.IconButtonStyle) material.IconButtonStyle {
|
||||
|
@ -24,6 +24,10 @@ func (t *Tracker) layoutSongButtons(gtx C) D {
|
||||
|
||||
//paint.FillShape(gtx.Ops, primaryColorDark, clip.Rect(image.Rect(0, 0, gtx.Constraints.Max.X, gtx.Constraints.Max.Y)).Op())
|
||||
|
||||
for t.NewSongFileBtn.Clicked() {
|
||||
t.LoadSong(defaultSong)
|
||||
}
|
||||
|
||||
for t.LoadSongFileBtn.Clicked() {
|
||||
t.LoadSongFile()
|
||||
}
|
||||
@ -32,7 +36,7 @@ func (t *Tracker) layoutSongButtons(gtx C) D {
|
||||
t.SaveSongFile()
|
||||
}
|
||||
|
||||
newBtnStyle := material.IconButton(t.Theme, t.NewSongFileBtn, addIcon)
|
||||
newBtnStyle := material.IconButton(t.Theme, t.NewSongFileBtn, clearIcon)
|
||||
newBtnStyle.Background = transparent
|
||||
newBtnStyle.Inset = layout.UniformInset(unit.Dp(6))
|
||||
newBtnStyle.Color = primaryColor
|
||||
|
Loading…
x
Reference in New Issue
Block a user