Skip to content

Commit

Permalink
Editor: Settings clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Feb 7, 2021
1 parent c513508 commit a501950
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { UIPanel, UIBreak, UIText } from './libs/ui.js';
import { UIBoolean, UIOutliner } from './libs/ui.three.js';

function SidebarHistory( editor ) {
function SidebarSettingsHistory( editor ) {

var strings = editor.strings;

Expand Down Expand Up @@ -130,4 +130,4 @@ function SidebarHistory( editor ) {

}

export { SidebarHistory };
export { SidebarSettingsHistory };
12 changes: 8 additions & 4 deletions editor/js/Sidebar.Settings.Shortcuts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UIDiv, UIBreak, UIText, UIRow, UIInput } from './libs/ui.js';
import { UIPanel, UIText, UIRow, UIInput } from './libs/ui.js';

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

Expand All @@ -17,8 +17,11 @@ function SidebarSettingsShortcuts( editor ) {
var config = editor.config;
var signals = editor.signals;

var container = new UIDiv();
container.add( new UIBreak() );
var container = new UIPanel();

var headerRow = new UIRow();
headerRow.add( new UIText( strings.getKey( 'sidebar/settings/shortcuts' ).toUpperCase() ) );
container.add( headerRow );

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

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

var shortcutInput = new UIInput().setWidth( '150px' ).setFontSize( '12px' );
var shortcutInput = new UIInput().setWidth( '15px' ).setFontSize( '12px' );
shortcutInput.setTextAlign( 'center' );
shortcutInput.setTextTransform( 'lowercase' );
shortcutInput.onChange( function () {

Expand Down
1 change: 0 additions & 1 deletion editor/js/Sidebar.Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ function SidebarSettings( editor ) {

//

container.add( new SidebarSettingsShortcuts( editor ) );
container.add( new SidebarSettingsViewport( editor ) );

return container;
Expand Down
6 changes: 4 additions & 2 deletions editor/js/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { SidebarProperties } from './Sidebar.Properties.js';
import { SidebarScript } from './Sidebar.Script.js';
import { SidebarAnimation } from './Sidebar.Animation.js';
import { SidebarProject } from './Sidebar.Project.js';
import { SidebarHistory } from './Sidebar.History.js';
import { SidebarSettings } from './Sidebar.Settings.js';
import { SidebarSettingsShortcuts } from './Sidebar.Settings.Shortcuts.js';
import { SidebarSettingsHistory } from './Sidebar.Settings.History.js';

function Sidebar( editor ) {

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

var settings = new UISpan().add(
new SidebarSettings( editor ),
new SidebarHistory( editor )
new SidebarSettingsShortcuts( editor ),
new SidebarSettingsHistory( editor )
);

container.addTab( 'scene', strings.getKey( 'sidebar/scene' ), scene );
Expand Down
3 changes: 3 additions & 0 deletions editor/js/Strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ function Strings( config ) {
'sidebar/settings/language': 'Language',
'sidebar/settings/exportPrecision': 'Export Precision',

'sidebar/settings/shortcuts': 'Shortcuts',
'sidebar/settings/shortcuts/translate': 'Translate',
'sidebar/settings/shortcuts/rotate': 'Rotate',
'sidebar/settings/shortcuts/scale': 'Scale',
Expand Down Expand Up @@ -628,6 +629,7 @@ function Strings( config ) {
'sidebar/settings/language': 'Langue',
'sidebar/settings/exportPrecision': 'Précision à l\'exportation',

'sidebar/settings/shortcuts': 'Shortcuts',
'sidebar/settings/shortcuts/translate': 'Position',
'sidebar/settings/shortcuts/rotate': 'Rotation',
'sidebar/settings/shortcuts/scale': 'Échelle',
Expand Down Expand Up @@ -936,6 +938,7 @@ function Strings( config ) {
'sidebar/settings/language': '语言',
'sidebar/settings/exportPrecision': '输出精度',

'sidebar/settings/shortcuts': 'Shortcuts',
'sidebar/settings/shortcuts/translate': '移动',
'sidebar/settings/shortcuts/rotate': '旋转',
'sidebar/settings/shortcuts/scale': '缩放',
Expand Down
2 changes: 1 addition & 1 deletion editor/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ const assets = [
'./js/Sidebar.Project.Materials.js',
'./js/Sidebar.Project.Renderer.js',
'./js/Sidebar.Settings.js',
'./js/Sidebar.Settings.History.js',
'./js/Sidebar.Settings.Shortcuts.js',
'./js/Sidebar.Settings.Viewport.js',
'./js/Sidebar.Properties.js',
Expand Down Expand Up @@ -162,7 +163,6 @@ const assets = [
'./js/Sidebar.Material.js',
'./js/Sidebar.Animation.js',
'./js/Sidebar.Script.js',
'./js/Sidebar.History.js',
'./js/Strings.js',
'./js/Toolbar.js',
'./js/Viewport.js',
Expand Down

0 comments on commit a501950

Please sign in to comment.