Skip to content

Commit 65adf9b

Browse files
committed
Add auto-invert option to icon fields
1 parent 6e06c9c commit 65adf9b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/glance/config-fields.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,16 @@ type customIconField struct {
128128
}
129129

130130
func newCustomIconField(value string) customIconField {
131+
const autoInvertPrefix = "auto-invert "
131132
field := customIconField{}
132133

133134
prefix, icon, found := strings.Cut(value, ":")
134135
if !found {
136+
if strings.HasPrefix(value, autoInvertPrefix) {
137+
field.IsFlatIcon = true
138+
value = strings.TrimPrefix(value, autoInvertPrefix)
139+
}
140+
135141
field.URL = template.URL(value)
136142
return field
137143
}

0 commit comments

Comments
 (0)