Skip to content

Commit a501950

Browse files
committed
Editor: Settings clean up.
1 parent c513508 commit a501950

File tree

6 files changed

+18
-10
lines changed

6 files changed

+18
-10
lines changed

editor/js/Sidebar.History.js renamed to editor/js/Sidebar.Settings.History.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { UIPanel, UIBreak, UIText } from './libs/ui.js';
33
import { UIBoolean, UIOutliner } from './libs/ui.three.js';
44

5-
function SidebarHistory( editor ) {
5+
function SidebarSettingsHistory( editor ) {
66

77
var strings = editor.strings;
88

@@ -130,4 +130,4 @@ function SidebarHistory( editor ) {
130130

131131
}
132132

133-
export { SidebarHistory };
133+
export { SidebarSettingsHistory };

editor/js/Sidebar.Settings.Shortcuts.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UIDiv, UIBreak, UIText, UIRow, UIInput } from './libs/ui.js';
1+
import { UIPanel, UIText, UIRow, UIInput } from './libs/ui.js';
22

33
import { RemoveObjectCommand } from './commands/RemoveObjectCommand.js';
44

@@ -17,8 +17,11 @@ function SidebarSettingsShortcuts( editor ) {
1717
var config = editor.config;
1818
var signals = editor.signals;
1919

20-
var container = new UIDiv();
21-
container.add( new UIBreak() );
20+
var container = new UIPanel();
21+
22+
var headerRow = new UIRow();
23+
headerRow.add( new UIText( strings.getKey( 'sidebar/settings/shortcuts' ).toUpperCase() ) );
24+
container.add( headerRow );
2225

2326
var shortcuts = [ 'translate', 'rotate', 'scale', 'undo', 'focus' ];
2427

@@ -27,7 +30,8 @@ function SidebarSettingsShortcuts( editor ) {
2730
var configName = 'settings/shortcuts/' + name;
2831
var shortcutRow = new UIRow();
2932

30-
var shortcutInput = new UIInput().setWidth( '150px' ).setFontSize( '12px' );
33+
var shortcutInput = new UIInput().setWidth( '15px' ).setFontSize( '12px' );
34+
shortcutInput.setTextAlign( 'center' );
3135
shortcutInput.setTextTransform( 'lowercase' );
3236
shortcutInput.onChange( function () {
3337

editor/js/Sidebar.Settings.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ function SidebarSettings( editor ) {
6464

6565
//
6666

67-
container.add( new SidebarSettingsShortcuts( editor ) );
6867
container.add( new SidebarSettingsViewport( editor ) );
6968

7069
return container;

editor/js/Sidebar.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import { SidebarProperties } from './Sidebar.Properties.js';
55
import { SidebarScript } from './Sidebar.Script.js';
66
import { SidebarAnimation } from './Sidebar.Animation.js';
77
import { SidebarProject } from './Sidebar.Project.js';
8-
import { SidebarHistory } from './Sidebar.History.js';
98
import { SidebarSettings } from './Sidebar.Settings.js';
9+
import { SidebarSettingsShortcuts } from './Sidebar.Settings.Shortcuts.js';
10+
import { SidebarSettingsHistory } from './Sidebar.Settings.History.js';
1011

1112
function Sidebar( editor ) {
1213

@@ -26,7 +27,8 @@ function Sidebar( editor ) {
2627

2728
var settings = new UISpan().add(
2829
new SidebarSettings( editor ),
29-
new SidebarHistory( editor )
30+
new SidebarSettingsShortcuts( editor ),
31+
new SidebarSettingsHistory( editor )
3032
);
3133

3234
container.addTab( 'scene', strings.getKey( 'sidebar/scene' ), scene );

editor/js/Strings.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ function Strings( config ) {
304304
'sidebar/settings/language': 'Language',
305305
'sidebar/settings/exportPrecision': 'Export Precision',
306306

307+
'sidebar/settings/shortcuts': 'Shortcuts',
307308
'sidebar/settings/shortcuts/translate': 'Translate',
308309
'sidebar/settings/shortcuts/rotate': 'Rotate',
309310
'sidebar/settings/shortcuts/scale': 'Scale',
@@ -628,6 +629,7 @@ function Strings( config ) {
628629
'sidebar/settings/language': 'Langue',
629630
'sidebar/settings/exportPrecision': 'Précision à l\'exportation',
630631

632+
'sidebar/settings/shortcuts': 'Shortcuts',
631633
'sidebar/settings/shortcuts/translate': 'Position',
632634
'sidebar/settings/shortcuts/rotate': 'Rotation',
633635
'sidebar/settings/shortcuts/scale': 'Échelle',
@@ -936,6 +938,7 @@ function Strings( config ) {
936938
'sidebar/settings/language': '语言',
937939
'sidebar/settings/exportPrecision': '输出精度',
938940

941+
'sidebar/settings/shortcuts': 'Shortcuts',
939942
'sidebar/settings/shortcuts/translate': '移动',
940943
'sidebar/settings/shortcuts/rotate': '旋转',
941944
'sidebar/settings/shortcuts/scale': '缩放',

editor/sw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ const assets = [
135135
'./js/Sidebar.Project.Materials.js',
136136
'./js/Sidebar.Project.Renderer.js',
137137
'./js/Sidebar.Settings.js',
138+
'./js/Sidebar.Settings.History.js',
138139
'./js/Sidebar.Settings.Shortcuts.js',
139140
'./js/Sidebar.Settings.Viewport.js',
140141
'./js/Sidebar.Properties.js',
@@ -162,7 +163,6 @@ const assets = [
162163
'./js/Sidebar.Material.js',
163164
'./js/Sidebar.Animation.js',
164165
'./js/Sidebar.Script.js',
165-
'./js/Sidebar.History.js',
166166
'./js/Strings.js',
167167
'./js/Toolbar.js',
168168
'./js/Viewport.js',

0 commit comments

Comments
 (0)