Sidebar.Settings.js 989 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. Sidebar.Settings = function ( editor ) {
  5. var config = editor.config;
  6. var signals = editor.signals;
  7. var container = new UI.Panel();
  8. container.setBorderTop( '0' );
  9. container.setPaddingTop( '20px' );
  10. container.setPaddingBottom( '20px' );
  11. // class
  12. var options = {
  13. 'css/light.css': 'light',
  14. 'css/dark.css': 'dark'
  15. };
  16. var themeRow = new UI.Row();
  17. var theme = new UI.Select().setWidth( '150px' );
  18. theme.setOptions( options );
  19. if ( config.getKey( 'theme' ) !== undefined ) {
  20. theme.setValue( config.getKey( 'theme' ) );
  21. }
  22. theme.onChange( function () {
  23. var value = this.getValue();
  24. editor.setTheme( value );
  25. editor.config.setKey( 'theme', value );
  26. } );
  27. themeRow.add( new UI.Text( 'Theme' ).setWidth( '90px' ) );
  28. themeRow.add( theme );
  29. container.add( themeRow );
  30. container.add( new Sidebar.Settings.Shortcuts( editor ) );
  31. container.add( new Sidebar.Settings.Viewport( editor ) );
  32. return container;
  33. };