Fix sizes bug

Remove redundant menu package
This commit is contained in:
Lea Anthony 2023-01-03 05:43:56 +11:00
commit 746b4dfc04
No known key found for this signature in database
GPG key ID: 33DAF7BB90A58405
2 changed files with 3 additions and 25 deletions

View file

@ -82,8 +82,8 @@ func generateExampleIcon() error {
func parseSizes(sizes string) ([]int, error) {
// split the input string by comma and confirm that each one is an integer
parsedSizes := strings.Split(sizes, ",")
result := make([]int, len(parsedSizes))
for i, size := range parsedSizes {
var result []int
for _, size := range parsedSizes {
s, err := strconv.Atoi(size)
if err != nil {
return nil, err
@ -91,7 +91,7 @@ func parseSizes(sizes string) ([]int, error) {
if s == 0 {
continue
}
result[i] = s
result = append(result, s)
}
// put all integers in a slice and return

View file

@ -1,22 +0,0 @@
package menu
type Menu struct {
Items []*Item
}
func (m *Menu) Label(label string) *Item {
return &Item{
Label: label,
}
}
type CallbackContext struct {
MenuItem *Item
}
type Item struct {
Label string
Disabled bool
Click func(*CallbackContext)
ID uint
}