Skip to content

Commit 8a321b5

Browse files
committed
Editor: Moved menubar/edit/clear_history to sidebar/history/clear.
1 parent 74d7dc8 commit 8a321b5

File tree

3 files changed

+23
-27
lines changed

3 files changed

+23
-27
lines changed

editor/js/Menubar.Edit.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,6 @@ function MenubarEdit( editor ) {
4747
} );
4848
options.add( redo );
4949

50-
// Clear History
51-
52-
let option = new UIRow();
53-
option.setClass( 'option' );
54-
option.setTextContent( strings.getKey( 'menubar/edit/clear_history' ) );
55-
option.onClick( function () {
56-
57-
if ( confirm( 'The Undo/Redo History will be cleared. Are you sure?' ) ) {
58-
59-
editor.history.clear();
60-
61-
}
62-
63-
} );
64-
options.add( option );
65-
66-
6750
editor.signals.historyChanged.add( function () {
6851

6952
const history = editor.history;
@@ -91,7 +74,7 @@ function MenubarEdit( editor ) {
9174

9275
// Center
9376

94-
option = new UIRow();
77+
let option = new UIRow();
9578
option.setClass( 'option' );
9679
option.setTextContent( strings.getKey( 'menubar/edit/center' ) );
9780
option.onClick( function () {

editor/js/Sidebar.Settings.History.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11

2-
import { UIPanel, UIBreak, UIText } from './libs/ui.js';
2+
import { UIButton, UIPanel, UIBreak, UIText } from './libs/ui.js';
33
import { UIBoolean, UIOutliner } from './libs/ui.three.js';
44

55
function SidebarSettingsHistory( editor ) {
66

77
const strings = editor.strings;
8-
98
const signals = editor.signals;
10-
119
const config = editor.config;
12-
1310
const history = editor.history;
1411

1512
const container = new UIPanel();
@@ -59,6 +56,22 @@ function SidebarSettingsHistory( editor ) {
5956
} );
6057
container.add( outliner );
6158

59+
container.add( new UIBreak() );
60+
61+
// Clear History
62+
63+
const option = new UIButton( strings.getKey( 'sidebar/history/clear' ) ).setTextTransform( 'uppercase' );
64+
option.onClick( function () {
65+
66+
if ( confirm( 'The Undo/Redo History will be cleared. Are you sure?' ) ) {
67+
68+
editor.history.clear();
69+
70+
}
71+
72+
} );
73+
container.add( option );
74+
6275
//
6376

6477
const refreshUI = function () {

editor/js/Strings.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function Strings( config ) {
2626
'menubar/edit': 'Edit',
2727
'menubar/edit/undo': 'Undo (Ctrl+Z)',
2828
'menubar/edit/redo': 'Redo (Ctrl+Shift+Z)',
29-
'menubar/edit/clear_history': 'Clear History',
3029
'menubar/edit/center': 'Center',
3130
'menubar/edit/clone': 'Clone',
3231
'menubar/edit/delete': 'Delete (Del)',
@@ -338,7 +337,8 @@ function Strings( config ) {
338337
'sidebar/settings/shortcuts/focus': 'Focus',
339338

340339
'sidebar/history': 'History',
341-
'sidebar/history/persistent': 'persistent',
340+
'sidebar/history/clear': 'Clear',
341+
'sidebar/history/persistent': 'Persistent',
342342

343343
'toolbar/translate': 'Translate',
344344
'toolbar/rotate': 'Rotate',
@@ -377,7 +377,6 @@ function Strings( config ) {
377377
'menubar/edit': 'Edition',
378378
'menubar/edit/undo': 'Annuler (Ctrl+Z)',
379379
'menubar/edit/redo': 'Refaire (Ctrl+Shift+Z)',
380-
'menubar/edit/clear_history': 'Supprimer Historique',
381380
'menubar/edit/center': 'Center',
382381
'menubar/edit/clone': 'Cloner',
383382
'menubar/edit/delete': 'Supprimer (Supp)',
@@ -687,7 +686,8 @@ function Strings( config ) {
687686
'sidebar/settings/shortcuts/focus': 'Focus',
688687

689688
'sidebar/history': 'Historique',
690-
'sidebar/history/persistent': 'permanent',
689+
'sidebar/history/clear': 'Supprimer',
690+
'sidebar/history/persistent': 'Permanent',
691691

692692
'toolbar/translate': 'Position',
693693
'toolbar/rotate': 'Rotation',
@@ -726,7 +726,6 @@ function Strings( config ) {
726726
'menubar/edit': '编辑',
727727
'menubar/edit/undo': '撤销 (Ctrl+Z)',
728728
'menubar/edit/redo': '重做 (Ctrl+Shift+Z)',
729-
'menubar/edit/clear_history': '清空历史记录',
730729
'menubar/edit/center': '居中',
731730
'menubar/edit/clone': '拷贝',
732731
'menubar/edit/delete': '删除 (Del)',
@@ -1036,6 +1035,7 @@ function Strings( config ) {
10361035
'sidebar/settings/shortcuts/focus': '聚焦',
10371036

10381037
'sidebar/history': '历史记录',
1038+
'sidebar/history/clear': '清空',
10391039
'sidebar/history/persistent': '本地存储',
10401040

10411041
'toolbar/translate': '移动',

0 commit comments

Comments
 (0)