diff --git a/examples/directory.js b/examples/directory.js index 243811c8d4..4af784d59e 100644 --- a/examples/directory.js +++ b/examples/directory.js @@ -27,6 +27,7 @@ var directoryWindow = new OverlayWebWindow({ var toolHeight = 50; var toolWidth = 50; +var TOOLBAR_MARGIN_Y = 25; function showDirectory() { @@ -53,10 +54,10 @@ var toolBar = (function() { browseDirectoryButton; function initialize() { - toolBar = new ToolBar(0, 0, ToolBar.VERTICAL, "highfidelity.directory.toolbar", function(windowDimensions, toolbar) { + toolBar = new ToolBar(0, 0, ToolBar.HORIZONTAL, "highfidelity.directory.toolbar", function(windowDimensions, toolbar) { return { - x: windowDimensions.x - 8 - toolbar.width, - y: 50 + x: windowDimensions.x / 2 - 3 * toolbar.height, // Use toolbar.height to match edit.js + y: windowDimensions.y - TOOLBAR_MARGIN_Y - toolHeight }; }); browseDirectoryButton = toolBar.addTool({ diff --git a/examples/edit.js b/examples/edit.js index f03915f5ad..929f8014dd 100644 --- a/examples/edit.js +++ b/examples/edit.js @@ -53,6 +53,7 @@ selectionManager.addEventListener(function() { var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/"; var toolHeight = 50; var toolWidth = 50; +var TOOLBAR_MARGIN_Y = 25; var DEGREES_TO_RADIANS = Math.PI / 180.0; var RADIANS_TO_DEGREES = 180.0 / Math.PI; @@ -179,10 +180,10 @@ var toolBar = (function() { newParticleButton function initialize() { - toolBar = new ToolBar(0, 0, ToolBar.VERTICAL, "highfidelity.edit.toolbar", function(windowDimensions, toolbar) { + toolBar = new ToolBar(0, 0, ToolBar.HORIZONTAL, "highfidelity.edit.toolbar", function(windowDimensions, toolbar) { return { - x: windowDimensions.x - 8 - toolbar.width, - y: (windowDimensions.y - toolbar.height) / 2 + x: windowDimensions.x / 2 + 2 * toolbar.height, // Use toolbar.height as a proxy for width of a single button + y: windowDimensions.y - TOOLBAR_MARGIN_Y - toolHeight }; }); diff --git a/examples/examples.js b/examples/examples.js index bfa85473de..1f764ebd8e 100644 --- a/examples/examples.js +++ b/examples/examples.js @@ -27,6 +27,7 @@ var examplesWindow = new OverlayWebWindow({ var toolHeight = 50; var toolWidth = 50; +var TOOLBAR_MARGIN_Y = 25; function showExamples(marketplaceID) { @@ -58,10 +59,10 @@ var toolBar = (function() { browseExamplesButton; function initialize() { - toolBar = new ToolBar(0, 0, ToolBar.VERTICAL, "highfidelity.examples.toolbar", function(windowDimensions, toolbar) { + toolBar = new ToolBar(0, 0, ToolBar.HORIXONTAL, "highfidelity.examples.toolbar", function(windowDimensions, toolbar) { return { - x: windowDimensions.x - 8 - toolbar.width, - y: 135 + x: windowDimensions.x / 2 - toolbar.height / 2, // Use toolbar.height to match edit.js + y: windowDimensions.y - TOOLBAR_MARGIN_Y - toolHeight }; }); browseExamplesButton = toolBar.addTool({