mirror of
https://github.com/Xevion/glance.git
synced 2025-12-06 01:15:08 -06:00
Add auto-invert option to icon fields
This commit is contained in:
@@ -128,10 +128,16 @@ type customIconField struct {
|
||||
}
|
||||
|
||||
func newCustomIconField(value string) customIconField {
|
||||
const autoInvertPrefix = "auto-invert "
|
||||
field := customIconField{}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user