Browse Source

Editor: Clean up.

Mr.doob 9 years ago
parent
commit
5562b0961f

+ 3 - 3
editor/css/dark.css

@@ -29,9 +29,8 @@
 
 input.Number {
 	color: #2A75B7!important;
-	font-size: 12px;							/** TODO: Use of !imporant is not ideal **/
-	background-color: transparent!important;	/* For now this is a quick fix a rendering issue due to inherited background */
-	border: 1px solid transparent;
+	font-size: 12px;
+	border: 0px;
 	padding: 2px;
 	cursor: col-resize;
 }
@@ -173,6 +172,7 @@ input.Number {
 	}
 
 	#sidebar .Row {
+		min-height: 20px;
 		margin-bottom: 10px;
 	}
 

+ 3 - 3
editor/css/light.css

@@ -22,9 +22,8 @@
 
 input.Number {
 	color: #0080f0!important;
-	font-size: 12px;							/** TODO: Use of !imporant is not ideal **/
-	background-color: transparent!important;	/* For now this is a quick fix a rendering issue due to inherited background */
-	border: 1px solid transparent;
+	font-size: 12px;
+	border: 0px;
 	padding: 2px;
 	cursor: col-resize;
 }
@@ -162,6 +161,7 @@ input.Number {
 	}
 
 	#sidebar .Row {
+		min-height: 20px;
 		margin-bottom: 10px;
 	}
 

+ 2 - 2
editor/js/Sidebar.Geometry.BufferGeometry.js

@@ -47,11 +47,11 @@ Sidebar.Geometry.BufferGeometry = function ( editor ) {
 
 		}
 
-	};
+	}
 
 	signals.objectSelected.add( update );
 	signals.geometryChanged.add( update );
 
 	return container;
 
-}
+};

+ 3 - 3
editor/js/Sidebar.Geometry.Geometry.js

@@ -11,7 +11,7 @@ Sidebar.Geometry.Geometry = function ( editor ) {
 	// vertices
 
 	var verticesRow = new UI.Row();
-	var vertices = new UI.Text().setFontSize( '12px' );
+	var vertices = new UI.Text();
 
 	verticesRow.add( new UI.Text( 'Vertices' ).setWidth( '90px' ) );
 	verticesRow.add( vertices );
@@ -21,7 +21,7 @@ Sidebar.Geometry.Geometry = function ( editor ) {
 	// faces
 
 	var facesRow = new UI.Row();
-	var faces = new UI.Text().setFontSize( '12px' );
+	var faces = new UI.Text();
 
 	facesRow.add( new UI.Text( 'Faces' ).setWidth( '90px' ) );
 	facesRow.add( faces );
@@ -36,7 +36,7 @@ Sidebar.Geometry.Geometry = function ( editor ) {
 
 		var geometry = object.geometry;
 
-		if ( geometry instanceof THREE.Geometry ) { 
+		if ( geometry instanceof THREE.Geometry ) {
 
 			container.setDisplay( 'block' );
 

+ 11 - 11
editor/js/Sidebar.Geometry.js

@@ -81,6 +81,16 @@ Sidebar.Geometry = function ( editor ) {
 	} );
 	// container.addStatic( objectActions );
 
+	// type
+
+	var geometryTypeRow = new UI.Row();
+	var geometryType = new UI.Text();
+
+	geometryTypeRow.add( new UI.Text( 'Type' ).setWidth( '90px' ) );
+	geometryTypeRow.add( geometryType );
+
+	container.add( geometryTypeRow );
+
 	// uuid
 
 	var geometryUUIDRow = new UI.Row();
@@ -113,16 +123,6 @@ Sidebar.Geometry = function ( editor ) {
 
 	container.add( geometryNameRow );
 
-	// type
-
-	var geometryTypeRow = new UI.Row();
-	var geometryType = new UI.Text();
-
-	geometryTypeRow.add( new UI.Text( 'Type' ).setWidth( '90px' ) );
-	geometryTypeRow.add( geometryType );
-
-	container.add( geometryTypeRow );
-
 	// geometry
 
 	container.add( new Sidebar.Geometry.Geometry( editor ) );
@@ -181,4 +181,4 @@ Sidebar.Geometry = function ( editor ) {
 
 	return container;
 
-}
+};

+ 23 - 23
editor/js/Sidebar.Material.js

@@ -11,6 +11,29 @@ Sidebar.Material = function ( editor ) {
 	container.setBorderTop( '0' );
 	container.setPaddingTop( '20px' );
 
+	// type
+
+	var materialClassRow = new UI.Row();
+	var materialClass = new UI.Select().setOptions( {
+
+		'LineBasicMaterial': 'LineBasicMaterial',
+		'LineDashedMaterial': 'LineDashedMaterial',
+		'MeshBasicMaterial': 'MeshBasicMaterial',
+		'MeshDepthMaterial': 'MeshDepthMaterial',
+		'MeshNormalMaterial': 'MeshNormalMaterial',
+		'MeshLambertMaterial': 'MeshLambertMaterial',
+		'MeshPhongMaterial': 'MeshPhongMaterial',
+		'MeshStandardMaterial': 'MeshStandardMaterial',
+		'ShaderMaterial': 'ShaderMaterial',
+		'SpriteMaterial': 'SpriteMaterial'
+
+	} ).setWidth( '150px' ).setFontSize( '12px' ).onChange( update );
+
+	materialClassRow.add( new UI.Text( 'Type' ).setWidth( '90px' ) );
+	materialClassRow.add( materialClass );
+
+	container.add( materialClassRow );
+
 	// uuid
 
 	var materialUUIDRow = new UI.Row();
@@ -42,29 +65,6 @@ Sidebar.Material = function ( editor ) {
 
 	container.add( materialNameRow );
 
-	// class
-
-	var materialClassRow = new UI.Row();
-	var materialClass = new UI.Select().setOptions( {
-
-		'LineBasicMaterial': 'LineBasicMaterial',
-		'LineDashedMaterial': 'LineDashedMaterial',
-		'MeshBasicMaterial': 'MeshBasicMaterial',
-		'MeshDepthMaterial': 'MeshDepthMaterial',
-		'MeshNormalMaterial': 'MeshNormalMaterial',
-		'MeshLambertMaterial': 'MeshLambertMaterial',
-		'MeshPhongMaterial': 'MeshPhongMaterial',
-		'MeshStandardMaterial': 'MeshStandardMaterial',
-		'ShaderMaterial': 'ShaderMaterial',
-		'SpriteMaterial': 'SpriteMaterial'
-
-	} ).setWidth( '150px' ).setFontSize( '12px' ).onChange( update );
-
-	materialClassRow.add( new UI.Text( 'Type' ).setWidth( '90px' ) );
-	materialClassRow.add( materialClass );
-
-	container.add( materialClassRow );
-
 	// program
 
 	var materialProgramRow = new UI.Row();

+ 12 - 12
editor/js/Sidebar.Object.js

@@ -9,6 +9,7 @@ Sidebar.Object = function ( editor ) {
 	var container = new UI.Panel();
 	container.setBorderTop( '0' );
 	container.setPaddingTop( '20px' );
+	container.setDisplay( 'none' );
 
 	// Actions
 
@@ -51,6 +52,16 @@ Sidebar.Object = function ( editor ) {
 	} );
 	// container.addStatic( objectActions );
 
+	// type
+
+	var objectTypeRow = new UI.Row();
+	var objectType = new UI.Text();
+
+	objectTypeRow.add( new UI.Text( 'Type' ).setWidth( '90px' ) );
+	objectTypeRow.add( objectType );
+
+	container.add( objectTypeRow );
+
 	// uuid
 
 	var objectUUIDRow = new UI.Row();
@@ -83,17 +94,6 @@ Sidebar.Object = function ( editor ) {
 
 	container.add( objectNameRow );
 
-	// type
-
-	var objectTypeRow = new UI.Row();
-	var objectType = new UI.Text();
-
-	objectTypeRow.add( new UI.Text( 'Type' ).setWidth( '90px' ) );
-	objectTypeRow.add( objectType );
-
-	container.add( objectTypeRow );
-
-
 	/*
 	// parent
 
@@ -710,4 +710,4 @@ Sidebar.Object = function ( editor ) {
 
 	return container;
 
-}
+};

+ 6 - 6
editor/js/libs/ui.js

@@ -607,9 +607,9 @@ UI.Color = function () {
 	var dom = document.createElement( 'input' );
 	dom.className = 'Color';
 	dom.style.width = '64px';
-	dom.style.height = '16px';
+	dom.style.height = '17px';
 	dom.style.border = '0px';
-	dom.style.padding = '0px';
+	dom.style.padding = '2px';
 	dom.style.backgroundColor = 'transparent';
 
 	try {
@@ -770,7 +770,6 @@ UI.Number = function ( number ) {
 	function onFocus( event ) {
 
 		dom.style.backgroundColor = '';
-		dom.style.borderColor = '#ccc';
 		dom.style.cursor = '';
 
 	}
@@ -778,11 +777,12 @@ UI.Number = function ( number ) {
 	function onBlur( event ) {
 
 		dom.style.backgroundColor = 'transparent';
-		dom.style.borderColor = 'transparent';
 		dom.style.cursor = 'col-resize';
 
 	}
 
+	onBlur();
+
 	dom.addEventListener( 'mousedown', onMouseDown, false );
 	dom.addEventListener( 'change', onChange, false );
 	dom.addEventListener( 'focus', onFocus, false );
@@ -942,7 +942,6 @@ UI.Integer = function ( number ) {
 	function onFocus( event ) {
 
 		dom.style.backgroundColor = '';
-		dom.style.borderColor = '#ccc';
 		dom.style.cursor = '';
 
 	}
@@ -950,11 +949,12 @@ UI.Integer = function ( number ) {
 	function onBlur( event ) {
 
 		dom.style.backgroundColor = 'transparent';
-		dom.style.borderColor = 'transparent';
 		dom.style.cursor = 'col-resize';
 
 	}
 
+	onBlur();
+
 	dom.addEventListener( 'mousedown', onMouseDown, false );
 	dom.addEventListener( 'change', onChange, false );
 	dom.addEventListener( 'focus', onFocus, false );