Skip to content

Commit

Permalink
add two layouts and cleanup code (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
ostatni5 committed Sep 7, 2021
1 parent 05c5e74 commit e608a99
Show file tree
Hide file tree
Showing 8 changed files with 433 additions and 1,774 deletions.
4 changes: 3 additions & 1 deletion src/ThreeEditor/js/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ function Editor() {

viewportCameraChanged: new Signal(),

animationStopped: new Signal()
animationStopped: new Signal(),

layoutChanged: new Signal() // Layout signal

};

Expand Down
49 changes: 49 additions & 0 deletions src/ThreeEditor/js/Menubar.Layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { UIPanel, UIRow } from './libs/ui.js';

function MenubarLayout( editor ) {

var strings = editor.strings;

var container = new UIPanel();
container.setClass( 'menu' );

var title = new UIPanel();
title.setClass( 'title' );
title.setTextContent( 'Layout' );
container.add( title );

var options = new UIPanel();
options.setClass( 'options' );
container.add( options );

// Single view

var option = new UIRow();
option.setClass( 'option' );
option.setTextContent( 'Single View' );
option.onClick( function () {

editor.signals.layoutChanged.dispatch('singleView');

} );
options.add( option );

// Four view

var option = new UIRow();
option.setClass( 'option' );
option.setTextContent( 'Four Views' );
option.onClick( function () {

editor.signals.layoutChanged.dispatch('fourViews');

} );
options.add( option );



return container;

}

export { MenubarLayout };
2 changes: 2 additions & 0 deletions src/ThreeEditor/js/Menubar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { MenubarView } from './Menubar.View.js';
import { MenubarFile } from './Menubar.File.js';
import { MenubarHelp } from './Menubar.Help.js';
import { MenubarStatus } from './Menubar.Status.js';
import { MenubarLayout } from './Menubar.Layout.js';

function Menubar( editor ) {

Expand All @@ -17,6 +18,7 @@ function Menubar( editor ) {
container.add( new MenubarAdd( editor ) );
container.add( new MenubarView( editor ) );
container.add( new MenubarHelp( editor ) );
container.add( new MenubarLayout( editor ) );

container.add( new MenubarStatus( editor ) );

Expand Down
Loading

0 comments on commit e608a99

Please sign in to comment.