mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
48 lines
896 B
JavaScript
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;
|
|
|
|
};
|