mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-20 18:07:59 +02:00
Make auto-invert work with prefixed icons
This commit is contained in:
parent
808f3c1436
commit
88d8fa56fb
@ -141,13 +141,13 @@ func newCustomIconField(value string) customIconField {
|
||||
const autoInvertPrefix = "auto-invert "
|
||||
field := customIconField{}
|
||||
|
||||
if strings.HasPrefix(value, autoInvertPrefix) {
|
||||
field.IsFlatIcon = true
|
||||
value = strings.TrimPrefix(value, autoInvertPrefix)
|
||||
}
|
||||
|
||||
prefix, icon, found := strings.Cut(value, ":")
|
||||
if !found {
|
||||
if strings.HasPrefix(value, autoInvertPrefix) {
|
||||
field.IsFlatIcon = true
|
||||
value = strings.TrimPrefix(value, autoInvertPrefix)
|
||||
}
|
||||
|
||||
field.URL = template.URL(value)
|
||||
return field
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user