diff --git a/src/client/ui/ui-tree.js b/src/client/ui/ui-tree.js index 0a2ca5b7..5e716dc3 100644 --- a/src/client/ui/ui-tree.js +++ b/src/client/ui/ui-tree.js @@ -7,8 +7,28 @@ var UiWidget = require('./ui-widget'), raw = require('nanohtml/raw'), {icon} = require('./utils'), Root, Panel, Matrix, Keyboard, widgetManager, + {widgets, categories} = require('../widgets'), init = false +var widgetIcons = {root: 'bookmark'}, categoryIcons = { + 'Basics': 'toggle-on', + 'Containers': 'th-large', + 'Frames': 'images', + 'Graphs': 'chart-area', + 'Indicators': 'info-circle', + 'Pads': 'crosshairs', + 'Sliders': 'sliders-h', + 'Scripts': 'code', +} + +for (var type in widgets) { + for (var cat in categoryIcons) { + if (categories[cat].includes(type)) { + widgetIcons[type] = categoryIcons[cat] + } + } +} + class UiTree extends UiWidget { constructor(options) { @@ -195,7 +215,7 @@ class UiTree extends UiWidget { id = widget.getProp('id'), node = html`