Browse Source

Editor: Improve "compute vertex normals" button. (#24309)

Michael Herzog 3 năm trước cách đây
mục cha
commit
16f13e3b07
2 tập tin đã thay đổi với 11 bổ sung3 xóa
  1. 8 3
      editor/js/Sidebar.Geometry.Modifiers.js
  2. 3 0
      editor/js/Strings.js

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

@@ -1,7 +1,9 @@
-import { UIDiv, UIButton } from './libs/ui.js';
+import { UIDiv, UIButton, UIRow } from './libs/ui.js';
 
 function SidebarGeometryModifiers( editor, object ) {
 
+	const strings = editor.strings;
+
 	const signals = editor.signals;
 
 	const container = new UIDiv().setPaddingLeft( '90px' );
@@ -10,7 +12,7 @@ function SidebarGeometryModifiers( editor, object ) {
 
 	// Compute Vertex Normals
 
-	const button = new UIButton( 'Compute Vertex Normals' );
+	const button = new UIButton( strings.getKey( 'sidebar/geometry/show_vertex_normals' ) );
 	button.onClick( function () {
 
 		geometry.computeVertexNormals();
@@ -21,7 +23,10 @@ function SidebarGeometryModifiers( editor, object ) {
 
 	} );
 
-	container.add( button );
+	const row = new UIRow();
+	row.add( button );
+
+	container.add( row );
 
 	//
 

+ 3 - 0
editor/js/Strings.js

@@ -134,6 +134,7 @@ function Strings( config ) {
 			'sidebar/geometry/name': 'Name',
 			'sidebar/geometry/bounds': 'Bounds',
 			'sidebar/geometry/show_vertex_normals': 'Show Vertex Normals',
+			'sidebar/geometry/compute_vertex_normals': 'Compute Vertex Normals',
 
 			'sidebar/geometry/box_geometry/width': 'Width',
 			'sidebar/geometry/box_geometry/height': 'Height',
@@ -476,6 +477,7 @@ function Strings( config ) {
 			'sidebar/geometry/name': 'Nom',
 			'sidebar/geometry/bounds': 'Limites',
 			'sidebar/geometry/show_vertex_normals': 'Afficher normales',
+			'sidebar/geometry/compute_vertex_normals': 'Compute Vertex Normals',
 
 			'sidebar/geometry/box_geometry/width': 'Largeur',
 			'sidebar/geometry/box_geometry/height': 'Hauteur',
@@ -813,6 +815,7 @@ function Strings( config ) {
 			'sidebar/geometry/name': '名称',
 			'sidebar/geometry/bounds': '界限',
 			'sidebar/geometry/show_vertex_normals': '显示顶点法线',
+			'sidebar/geometry/compute_vertex_normals': 'Compute Vertex Normals',
 
 			'sidebar/geometry/box_geometry/width': '宽度',
 			'sidebar/geometry/box_geometry/height': '高度',