Skip to content

Commit 293ed86

Browse files
mrdoobclaude
andcommitted
Editor: Improve UI layout
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 22afab9 commit 293ed86

File tree

5 files changed

+47
-33
lines changed

5 files changed

+47
-33
lines changed

editor/css/main.css

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ hr {
103103

104104
.TabbedPanel .Panels {
105105
position: absolute;
106-
top: 40px;
106+
top: 36px;
107107
display: block;
108108
width: 100%;
109109
}
@@ -303,7 +303,8 @@ hr {
303303
.Select {
304304
color: #666;
305305
background-color: #ddd;
306-
border: 0px;
306+
border: 3px solid #ddd;
307+
border-radius: 4px;
307308
text-transform: uppercase;
308309
cursor: pointer;
309310
outline: none;
@@ -318,7 +319,7 @@ hr {
318319
#resizer {
319320
position: absolute;
320321
z-index: 2; /* Above #sidebar */
321-
top: 32px;
322+
top: 36px;
322323
right: 350px;
323324
width: 5px;
324325
bottom: 0px;
@@ -339,7 +340,7 @@ hr {
339340

340341
#viewport {
341342
position: absolute;
342-
top: 32px;
343+
top: 36px;
343344
left: 0;
344345
right: 350px;
345346
bottom: 0;
@@ -352,7 +353,7 @@ hr {
352353

353354
#script {
354355
position: absolute;
355-
top: 32px;
356+
top: 36px;
356357
left: 0;
357358
right: 350px;
358359
bottom: 0;
@@ -361,7 +362,7 @@ hr {
361362

362363
#player {
363364
position: absolute;
364-
top: 32px;
365+
top: 36px;
365366
left: 0;
366367
right: 350px;
367368
bottom: 0;
@@ -370,7 +371,7 @@ hr {
370371
#menubar {
371372
position: absolute;
372373
width: 100%;
373-
height: 32px;
374+
height: 36px;
374375
background: #eee;
375376
padding: 0;
376377
margin: 0;
@@ -395,7 +396,7 @@ hr {
395396
display: inline-block;
396397
color: #888;
397398
margin: 0;
398-
padding: 8px;
399+
padding: 10px;
399400
line-height: 16px;
400401
}
401402

@@ -406,6 +407,7 @@ hr {
406407
border: 1px solid #ccc;
407408
border-radius: 4px;
408409
font-size: 9px;
410+
line-height: normal;
409411
padding: 2px 4px;
410412
right: 10px;
411413
pointer-events: none;
@@ -435,6 +437,7 @@ hr {
435437
color: #666;
436438
background-color: transparent;
437439
padding: 5px 10px;
440+
line-height: 25px;
438441
margin: 0 !important;
439442
}
440443

@@ -472,6 +475,7 @@ hr {
472475
color: #bbb;
473476
background-color: transparent;
474477
padding: 5px 10px;
478+
line-height: 25px;
475479
margin: 0 !important;
476480
cursor: not-allowed;
477481
}
@@ -481,7 +485,7 @@ hr {
481485
#sidebar {
482486
position: absolute;
483487
right: 0;
484-
top: 32px;
488+
top: 36px;
485489
bottom: 0;
486490
width: 350px;
487491
background: #eee;
@@ -530,15 +534,26 @@ hr {
530534

531535
#toolbar {
532536
position: absolute;
533-
left: 10px;
534-
top: 42px;
535-
width: 32px;
537+
left: calc(50% - 175px);
538+
transform: translateX(-50%);
539+
bottom: 20px;
540+
height: 32px;
536541
background: #eee;
537542
text-align: center;
543+
display: flex;
544+
align-items: center;
545+
gap: 2px;
546+
border-radius: 6px;
547+
border: 3px solid #eee;
548+
overflow: hidden;
538549
}
539550

540551
#toolbar .Button, #toolbar .Input {
541552
height: 32px;
553+
border-radius: 4px;
554+
display: flex;
555+
align-items: center;
556+
justify-content: center;
542557
}
543558

544559
#toolbar .Button img {
@@ -617,22 +632,22 @@ hr {
617632
#viewport {
618633
left: 0;
619634
right: 0;
620-
top: 32px;
621-
height: calc(100% - 352px);
635+
top: 36px;
636+
height: calc(100% - 356px);
622637
}
623638

624639
#script {
625640
left: 0;
626641
right: 0;
627-
top: 32px;
628-
height: calc(100% - 352px);
642+
top: 36px;
643+
height: calc(100% - 356px);
629644
}
630645

631646
#player {
632647
left: 0;
633648
right: 0;
634-
top: 32px;
635-
height: calc(100% - 352px);
649+
top: 36px;
650+
height: calc(100% - 356px);
636651
}
637652

638653
#sidebar {
@@ -642,6 +657,12 @@ hr {
642657
bottom: 0;
643658
}
644659

660+
#toolbar {
661+
left: 50%;
662+
transform: translateX(-50%);
663+
bottom: 330px;
664+
}
665+
645666
}
646667

647668
/* DARK MODE */
@@ -672,6 +693,7 @@ hr {
672693
.Select {
673694
color: #aaa;
674695
background-color: #222;
696+
border-color: #222;
675697
}
676698

677699
.Select:hover {
@@ -734,6 +756,7 @@ hr {
734756

735757
#toolbar {
736758
background-color: #111;
759+
border-color: #111;
737760
}
738761

739762
#toolbar img {

editor/js/Toolbar.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UIPanel, UIButton, UICheckbox } from './libs/ui.js';
1+
import { UIPanel, UIButton } from './libs/ui.js';
22

33
function Toolbar( editor ) {
44

@@ -50,15 +50,6 @@ function Toolbar( editor ) {
5050
} );
5151
container.add( scale );
5252

53-
const local = new UICheckbox( false );
54-
local.dom.title = strings.getKey( 'toolbar/local' );
55-
local.onChange( function () {
56-
57-
signals.spaceChanged.dispatch( this.getValue() === true ? 'local' : 'world' );
58-
59-
} );
60-
container.add( local );
61-
6253
//
6354

6455
signals.transformModeChanged.add( function ( mode ) {

editor/js/Viewport.Controls.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ function ViewportControls( editor ) {
88
container.setPosition( 'absolute' );
99
container.setRight( '10px' );
1010
container.setTop( '10px' );
11-
container.setColor( '#ffffff' );
1211

1312
// camera
1413

1514
const cameraSelect = new UISelect();
16-
cameraSelect.setMarginLeft( '10px' );
1715
cameraSelect.setMarginRight( '10px' );
1816
cameraSelect.onChange( function () {
1917

editor/js/Viewport.Info.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function ViewportInfo( editor ) {
99
container.setId( 'info' );
1010
container.setPosition( 'absolute' );
1111
container.setLeft( '10px' );
12-
container.setBottom( '20px' );
12+
container.setBottom( '50px' );
1313
container.setFontSize( '12px' );
1414
container.setColor( '#fff' );
1515
container.setTextTransform( 'lowercase' );
@@ -133,7 +133,7 @@ function ViewportInfo( editor ) {
133133
samplesText.setHidden( ! isRealisticShading );
134134
samplesUnitText.setHidden( ! isRealisticShading );
135135

136-
container.setBottom( isRealisticShading ? '32px' : '20px' );
136+
container.setBottom( isRealisticShading ? '62px' : '50px' );
137137

138138
} );
139139

editor/js/Viewport.ViewHelper.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ class ViewHelper extends ViewHelperBase {
88

99
super( editorCamera, container.dom );
1010

11+
this.location.top = 30;
12+
1113
const panel = new UIPanel();
1214
panel.setId( 'viewHelper' );
1315
panel.setPosition( 'absolute' );
1416
panel.setRight( '0px' );
15-
panel.setBottom( '0px' );
17+
panel.setTop( '30px' );
1618
panel.setHeight( '128px' );
1719
panel.setWidth( '128px' );
1820

0 commit comments

Comments
 (0)