Browse Source

Editor: Settings clean up.

Mr.doob 4 years ago
parent
commit
a501950082

+ 2 - 2
editor/js/Sidebar.History.js → editor/js/Sidebar.Settings.History.js

@@ -2,7 +2,7 @@
 import { UIPanel, UIBreak, UIText } from './libs/ui.js';
 import { UIBoolean, UIOutliner } from './libs/ui.three.js';
 
-function SidebarHistory( editor ) {
+function SidebarSettingsHistory( editor ) {
 
 	var strings = editor.strings;
 
@@ -130,4 +130,4 @@ function SidebarHistory( editor ) {
 
 }
 
-export { SidebarHistory };
+export { SidebarSettingsHistory };

+ 8 - 4
editor/js/Sidebar.Settings.Shortcuts.js

@@ -1,4 +1,4 @@
-import { UIDiv, UIBreak, UIText, UIRow, UIInput } from './libs/ui.js';
+import { UIPanel, UIText, UIRow, UIInput } from './libs/ui.js';
 
 import { RemoveObjectCommand } from './commands/RemoveObjectCommand.js';
 
@@ -17,8 +17,11 @@ function SidebarSettingsShortcuts( editor ) {
 	var config = editor.config;
 	var signals = editor.signals;
 
-	var container = new UIDiv();
-	container.add( new UIBreak() );
+	var container = new UIPanel();
+
+	var headerRow = new UIRow();
+	headerRow.add( new UIText( strings.getKey( 'sidebar/settings/shortcuts' ).toUpperCase() ) );
+	container.add( headerRow );
 
 	var shortcuts = [ 'translate', 'rotate', 'scale', 'undo', 'focus' ];
 
@@ -27,7 +30,8 @@ function SidebarSettingsShortcuts( editor ) {
 		var configName = 'settings/shortcuts/' + name;
 		var shortcutRow = new UIRow();
 
-		var shortcutInput = new UIInput().setWidth( '150px' ).setFontSize( '12px' );
+		var shortcutInput = new UIInput().setWidth( '15px' ).setFontSize( '12px' );
+		shortcutInput.setTextAlign( 'center' );
 		shortcutInput.setTextTransform( 'lowercase' );
 		shortcutInput.onChange( function () {
 

+ 0 - 1
editor/js/Sidebar.Settings.js

@@ -64,7 +64,6 @@ function SidebarSettings( editor ) {
 
 	//
 
-	container.add( new SidebarSettingsShortcuts( editor ) );
 	container.add( new SidebarSettingsViewport( editor ) );
 
 	return container;

+ 4 - 2
editor/js/Sidebar.js

@@ -5,8 +5,9 @@ import { SidebarProperties } from './Sidebar.Properties.js';
 import { SidebarScript } from './Sidebar.Script.js';
 import { SidebarAnimation } from './Sidebar.Animation.js';
 import { SidebarProject } from './Sidebar.Project.js';
-import { SidebarHistory } from './Sidebar.History.js';
 import { SidebarSettings } from './Sidebar.Settings.js';
+import { SidebarSettingsShortcuts } from './Sidebar.Settings.Shortcuts.js';
+import { SidebarSettingsHistory } from './Sidebar.Settings.History.js';
 
 function Sidebar( editor ) {
 
@@ -26,7 +27,8 @@ function Sidebar( editor ) {
 
 	var settings = new UISpan().add(
 		new SidebarSettings( editor ),
-		new SidebarHistory( editor )
+		new SidebarSettingsShortcuts( editor ),
+		new SidebarSettingsHistory( editor )
 	);
 
 	container.addTab( 'scene', strings.getKey( 'sidebar/scene' ), scene );

+ 3 - 0
editor/js/Strings.js

@@ -304,6 +304,7 @@ function Strings( config ) {
 			'sidebar/settings/language': 'Language',
 			'sidebar/settings/exportPrecision': 'Export Precision',
 
+			'sidebar/settings/shortcuts': 'Shortcuts',
 			'sidebar/settings/shortcuts/translate': 'Translate',
 			'sidebar/settings/shortcuts/rotate': 'Rotate',
 			'sidebar/settings/shortcuts/scale': 'Scale',
@@ -628,6 +629,7 @@ function Strings( config ) {
 			'sidebar/settings/language': 'Langue',
 			'sidebar/settings/exportPrecision': 'Précision à l\'exportation',
 
+			'sidebar/settings/shortcuts': 'Shortcuts',
 			'sidebar/settings/shortcuts/translate': 'Position',
 			'sidebar/settings/shortcuts/rotate': 'Rotation',
 			'sidebar/settings/shortcuts/scale': 'Échelle',
@@ -936,6 +938,7 @@ function Strings( config ) {
 			'sidebar/settings/language': '语言',
 			'sidebar/settings/exportPrecision': '输出精度',
 
+			'sidebar/settings/shortcuts': 'Shortcuts',
 			'sidebar/settings/shortcuts/translate': '移动',
 			'sidebar/settings/shortcuts/rotate': '旋转',
 			'sidebar/settings/shortcuts/scale': '缩放',

+ 1 - 1
editor/sw.js

@@ -135,6 +135,7 @@ const assets = [
 	'./js/Sidebar.Project.Materials.js',
 	'./js/Sidebar.Project.Renderer.js',
 	'./js/Sidebar.Settings.js',
+	'./js/Sidebar.Settings.History.js',
 	'./js/Sidebar.Settings.Shortcuts.js',
 	'./js/Sidebar.Settings.Viewport.js',
 	'./js/Sidebar.Properties.js',
@@ -162,7 +163,6 @@ const assets = [
 	'./js/Sidebar.Material.js',
 	'./js/Sidebar.Animation.js',
 	'./js/Sidebar.Script.js',
-	'./js/Sidebar.History.js',
 	'./js/Strings.js',
 	'./js/Toolbar.js',
 	'./js/Viewport.js',