mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add support for colouring tab icon in settings.js
``` editorTheme: { page: { tabicon: { icon: "full/path/of/tabicon.svg", colour: "#008f00" } } ``` The old way still works also (but doesn't allow the tabicon to be coloured: ``` editorTheme: { page: { tabicon: "full/path/of/tabicon.svg" } } ```
This commit is contained in:
@@ -24,7 +24,10 @@ var defaultContext = {
|
||||
page: {
|
||||
title: "Node-RED",
|
||||
favicon: "favicon.ico",
|
||||
tabicon: "red/images/node-red-icon-black.svg"
|
||||
tabicon: {
|
||||
icon: "red/images/node-red-icon-black.svg",
|
||||
colour: "#8f0000"
|
||||
}
|
||||
},
|
||||
header: {
|
||||
title: "Node-RED",
|
||||
@@ -123,9 +126,13 @@ module.exports = {
|
||||
}
|
||||
|
||||
if (theme.page.tabicon) {
|
||||
url = serveFile(themeApp,"/tabicon/",theme.page.tabicon)
|
||||
let icon = theme.page.tabicon.icon || theme.page.tabicon
|
||||
url = serveFile(themeApp,"/tabicon/", icon)
|
||||
if (url) {
|
||||
themeContext.page.tabicon = url;
|
||||
themeContext.page.tabicon.icon = url;
|
||||
}
|
||||
if (theme.page.tabicon.colour) {
|
||||
themeContext.page.tabicon.colour = theme.page.tabicon.colour
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user