ShadowEditor/editor/js/Sidebar.Settings.js
2018-06-07 19:50:07 +08:00

48 lines
896 B
JavaScript

/**
* @author mrdoob / http://mrdoob.com/
*/
Sidebar.Settings = function (editor) {
var config = editor.config;
var signals = editor.signals;
var container = new UI.Panel();
container.setBorderTop('0');
container.setPaddingTop('20px');
// class
var options = {
'css/light.css': '浅色',
'css/dark.css': '深色'
};
var themeRow = new UI.Row();
var theme = new UI.Select().setWidth('150px');
theme.setOptions(options);
if (config.getKey('theme') !== undefined) {
theme.setValue(config.getKey('theme'));
}
theme.onChange(function () {
var value = this.getValue();
editor.setTheme(value);
editor.config.setKey('theme', value);
});
themeRow.add(new UI.Text('主题').setWidth('90px'));
themeRow.add(theme);
container.add(themeRow);
return container;
};