Allow fixed width and height for safari
This commit is contained in:
parent
8ad7cc0fa4
commit
ee8d730a71
1 changed files with 9 additions and 1 deletions
|
@ -115,7 +115,7 @@ func (bs *BookmarkService) replaceIconString() {
|
|||
continue
|
||||
}
|
||||
}
|
||||
bs.bookmarks.Applications[i].Entries[j].Icon = string(data)
|
||||
bs.bookmarks.Applications[i].Entries[j].Icon = insertWidthHeight(string(data))
|
||||
} else {
|
||||
bs.bookmarks.Applications[i].Entries[j].Icon = "<img title=\"" + bookmark.Name + "\" src=\"/icons/" + bookmark.Icon + "\"/>"
|
||||
}
|
||||
|
@ -157,3 +157,11 @@ func insertColor(svg, color string) string {
|
|||
}
|
||||
return parts[0] + "<svg " + `fill="#` + color + `" ` + parts[1]
|
||||
}
|
||||
|
||||
func insertWidthHeight(svg string) string {
|
||||
parts := strings.SplitN(svg, "<svg", 2)
|
||||
if len(parts) != 2 {
|
||||
return svg
|
||||
}
|
||||
return parts[0] + "<svg width=\"2rem\" height=\"2rem\" " + parts[1]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue