Browse Source

Editor: Moved menubar/edit/clear_history to sidebar/history/clear.

Mr.doob 1 year ago
parent
commit
8a321b5194
3 changed files with 23 additions and 27 deletions
  1. 1 18
      editor/js/Menubar.Edit.js
  2. 17 4
      editor/js/Sidebar.Settings.History.js
  3. 5 5
      editor/js/Strings.js

+ 1 - 18
editor/js/Menubar.Edit.js

@@ -47,23 +47,6 @@ function MenubarEdit( editor ) {
 	} );
 	} );
 	options.add( redo );
 	options.add( redo );
 
 
-	// Clear History
-
-	let option = new UIRow();
-	option.setClass( 'option' );
-	option.setTextContent( strings.getKey( 'menubar/edit/clear_history' ) );
-	option.onClick( function () {
-
-		if ( confirm( 'The Undo/Redo History will be cleared. Are you sure?' ) ) {
-
-			editor.history.clear();
-
-		}
-
-	} );
-	options.add( option );
-
-
 	editor.signals.historyChanged.add( function () {
 	editor.signals.historyChanged.add( function () {
 
 
 		const history = editor.history;
 		const history = editor.history;
@@ -91,7 +74,7 @@ function MenubarEdit( editor ) {
 
 
 	// Center
 	// Center
 
 
-	option = new UIRow();
+	let option = new UIRow();
 	option.setClass( 'option' );
 	option.setClass( 'option' );
 	option.setTextContent( strings.getKey( 'menubar/edit/center' ) );
 	option.setTextContent( strings.getKey( 'menubar/edit/center' ) );
 	option.onClick( function () {
 	option.onClick( function () {

+ 17 - 4
editor/js/Sidebar.Settings.History.js

@@ -1,15 +1,12 @@
 
 
-import { UIPanel, UIBreak, UIText } from './libs/ui.js';
+import { UIButton, UIPanel, UIBreak, UIText } from './libs/ui.js';
 import { UIBoolean, UIOutliner } from './libs/ui.three.js';
 import { UIBoolean, UIOutliner } from './libs/ui.three.js';
 
 
 function SidebarSettingsHistory( editor ) {
 function SidebarSettingsHistory( editor ) {
 
 
 	const strings = editor.strings;
 	const strings = editor.strings;
-
 	const signals = editor.signals;
 	const signals = editor.signals;
-
 	const config = editor.config;
 	const config = editor.config;
-
 	const history = editor.history;
 	const history = editor.history;
 
 
 	const container = new UIPanel();
 	const container = new UIPanel();
@@ -59,6 +56,22 @@ function SidebarSettingsHistory( editor ) {
 	} );
 	} );
 	container.add( outliner );
 	container.add( outliner );
 
 
+	container.add( new UIBreak() );
+
+	// Clear History
+
+	const option = new UIButton( strings.getKey( 'sidebar/history/clear' ) ).setTextTransform( 'uppercase' );
+	option.onClick( function () {
+
+		if ( confirm( 'The Undo/Redo History will be cleared. Are you sure?' ) ) {
+
+			editor.history.clear();
+
+		}
+
+	} );
+	container.add( option );
+
 	//
 	//
 
 
 	const refreshUI = function () {
 	const refreshUI = function () {

+ 5 - 5
editor/js/Strings.js

@@ -26,7 +26,6 @@ function Strings( config ) {
 			'menubar/edit': 'Edit',
 			'menubar/edit': 'Edit',
 			'menubar/edit/undo': 'Undo (Ctrl+Z)',
 			'menubar/edit/undo': 'Undo (Ctrl+Z)',
 			'menubar/edit/redo': 'Redo (Ctrl+Shift+Z)',
 			'menubar/edit/redo': 'Redo (Ctrl+Shift+Z)',
-			'menubar/edit/clear_history': 'Clear History',
 			'menubar/edit/center': 'Center',
 			'menubar/edit/center': 'Center',
 			'menubar/edit/clone': 'Clone',
 			'menubar/edit/clone': 'Clone',
 			'menubar/edit/delete': 'Delete (Del)',
 			'menubar/edit/delete': 'Delete (Del)',
@@ -338,7 +337,8 @@ function Strings( config ) {
 			'sidebar/settings/shortcuts/focus': 'Focus',
 			'sidebar/settings/shortcuts/focus': 'Focus',
 
 
 			'sidebar/history': 'History',
 			'sidebar/history': 'History',
-			'sidebar/history/persistent': 'persistent',
+			'sidebar/history/clear': 'Clear',
+			'sidebar/history/persistent': 'Persistent',
 
 
 			'toolbar/translate': 'Translate',
 			'toolbar/translate': 'Translate',
 			'toolbar/rotate': 'Rotate',
 			'toolbar/rotate': 'Rotate',
@@ -377,7 +377,6 @@ function Strings( config ) {
 			'menubar/edit': 'Edition',
 			'menubar/edit': 'Edition',
 			'menubar/edit/undo': 'Annuler (Ctrl+Z)',
 			'menubar/edit/undo': 'Annuler (Ctrl+Z)',
 			'menubar/edit/redo': 'Refaire (Ctrl+Shift+Z)',
 			'menubar/edit/redo': 'Refaire (Ctrl+Shift+Z)',
-			'menubar/edit/clear_history': 'Supprimer Historique',
 			'menubar/edit/center': 'Center',
 			'menubar/edit/center': 'Center',
 			'menubar/edit/clone': 'Cloner',
 			'menubar/edit/clone': 'Cloner',
 			'menubar/edit/delete': 'Supprimer (Supp)',
 			'menubar/edit/delete': 'Supprimer (Supp)',
@@ -687,7 +686,8 @@ function Strings( config ) {
 			'sidebar/settings/shortcuts/focus': 'Focus',
 			'sidebar/settings/shortcuts/focus': 'Focus',
 
 
 			'sidebar/history': 'Historique',
 			'sidebar/history': 'Historique',
-			'sidebar/history/persistent': 'permanent',
+			'sidebar/history/clear': 'Supprimer',
+			'sidebar/history/persistent': 'Permanent',
 
 
 			'toolbar/translate': 'Position',
 			'toolbar/translate': 'Position',
 			'toolbar/rotate': 'Rotation',
 			'toolbar/rotate': 'Rotation',
@@ -726,7 +726,6 @@ function Strings( config ) {
 			'menubar/edit': '编辑',
 			'menubar/edit': '编辑',
 			'menubar/edit/undo': '撤销 (Ctrl+Z)',
 			'menubar/edit/undo': '撤销 (Ctrl+Z)',
 			'menubar/edit/redo': '重做 (Ctrl+Shift+Z)',
 			'menubar/edit/redo': '重做 (Ctrl+Shift+Z)',
-			'menubar/edit/clear_history': '清空历史记录',
 			'menubar/edit/center': '居中',
 			'menubar/edit/center': '居中',
 			'menubar/edit/clone': '拷贝',
 			'menubar/edit/clone': '拷贝',
 			'menubar/edit/delete': '删除 (Del)',
 			'menubar/edit/delete': '删除 (Del)',
@@ -1036,6 +1035,7 @@ function Strings( config ) {
 			'sidebar/settings/shortcuts/focus': '聚焦',
 			'sidebar/settings/shortcuts/focus': '聚焦',
 
 
 			'sidebar/history': '历史记录',
 			'sidebar/history': '历史记录',
+			'sidebar/history/clear': '清空',
 			'sidebar/history/persistent': '本地存储',
 			'sidebar/history/persistent': '本地存储',
 
 
 			'toolbar/translate': '移动',
 			'toolbar/translate': '移动',