mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-21 18:31:24 +02:00
Add auto-invert option to icon fields
This commit is contained in:
parent
6e06c9c489
commit
65adf9b9c3
@ -128,10 +128,16 @@ type customIconField struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newCustomIconField(value string) customIconField {
|
func newCustomIconField(value string) customIconField {
|
||||||
|
const autoInvertPrefix = "auto-invert "
|
||||||
field := customIconField{}
|
field := customIconField{}
|
||||||
|
|
||||||
prefix, icon, found := strings.Cut(value, ":")
|
prefix, icon, found := strings.Cut(value, ":")
|
||||||
if !found {
|
if !found {
|
||||||
|
if strings.HasPrefix(value, autoInvertPrefix) {
|
||||||
|
field.IsFlatIcon = true
|
||||||
|
value = strings.TrimPrefix(value, autoInvertPrefix)
|
||||||
|
}
|
||||||
|
|
||||||
field.URL = template.URL(value)
|
field.URL = template.URL(value)
|
||||||
return field
|
return field
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user