mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 16:36:54 +02:00
Auto-size load URL and file menu items in editModels and newEditEntities
And fix a couple of typos.
This commit is contained in:
parent
7e6d616f20
commit
8c3360d0a9
2 changed files with 18 additions and 12 deletions
|
@ -1125,12 +1125,12 @@ var toolBar = (function () {
|
||||||
browseModelsButton,
|
browseModelsButton,
|
||||||
loadURLMenuItem,
|
loadURLMenuItem,
|
||||||
loadFileMenuItem,
|
loadFileMenuItem,
|
||||||
menuItemWidth = 125,
|
menuItemWidth,
|
||||||
menuItemOffset,
|
menuItemOffset,
|
||||||
menuItemHeight,
|
menuItemHeight,
|
||||||
menuItemMargin = 5,
|
menuItemMargin = 5,
|
||||||
menuTextColor = { red: 255, green: 255, blue: 255 },
|
menuTextColor = { red: 255, green: 255, blue: 255 },
|
||||||
menuBackgoundColor = { red: 18, green: 66, blue: 66 };
|
menuBackgroundColor = { red: 18, green: 66, blue: 66 };
|
||||||
|
|
||||||
function initialize() {
|
function initialize() {
|
||||||
toolBar = new ToolBar(0, 0, ToolBar.VERTICAL);
|
toolBar = new ToolBar(0, 0, ToolBar.VERTICAL);
|
||||||
|
@ -1167,9 +1167,8 @@ var toolBar = (function () {
|
||||||
loadURLMenuItem = Overlays.addOverlay("text", {
|
loadURLMenuItem = Overlays.addOverlay("text", {
|
||||||
x: newModelButton.x - menuItemWidth,
|
x: newModelButton.x - menuItemWidth,
|
||||||
y: newModelButton.y + menuItemOffset,
|
y: newModelButton.y + menuItemOffset,
|
||||||
width: menuItemWidth,
|
|
||||||
height: menuItemHeight,
|
height: menuItemHeight,
|
||||||
backgroundColor: menuBackgoundColor,
|
backgroundColor: menuBackgroundColor,
|
||||||
topMargin: menuItemMargin,
|
topMargin: menuItemMargin,
|
||||||
text: "Model URL",
|
text: "Model URL",
|
||||||
alpha: 0.9,
|
alpha: 0.9,
|
||||||
|
@ -1179,15 +1178,19 @@ var toolBar = (function () {
|
||||||
loadFileMenuItem = Overlays.addOverlay("text", {
|
loadFileMenuItem = Overlays.addOverlay("text", {
|
||||||
x: newModelButton.x - menuItemWidth,
|
x: newModelButton.x - menuItemWidth,
|
||||||
y: newModelButton.y + menuItemOffset + menuItemHeight,
|
y: newModelButton.y + menuItemOffset + menuItemHeight,
|
||||||
width: menuItemWidth,
|
|
||||||
height: menuItemHeight,
|
height: menuItemHeight,
|
||||||
backgroundColor: menuBackgoundColor,
|
backgroundColor: menuBackgroundColor,
|
||||||
topMargin: menuItemMargin,
|
topMargin: menuItemMargin,
|
||||||
text: "Model File",
|
text: "Model File",
|
||||||
alpha: 0.9,
|
alpha: 0.9,
|
||||||
visible: false
|
visible: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
menuItemWidth = Math.max(Overlays.textWidth(loadURLMenuItem, "Model URL"),
|
||||||
|
Overlays.textWidth(loadFileMenuItem, "Model File")) + 20;
|
||||||
|
Overlays.editOverlay(loadURLMenuItem, { width: menuItemWidth });
|
||||||
|
Overlays.editOverlay(loadFileMenuItem, { width: menuItemWidth });
|
||||||
|
|
||||||
newCubeButton = toolBar.addTool({
|
newCubeButton = toolBar.addTool({
|
||||||
imageURL: toolIconUrl + "add-cube.svg",
|
imageURL: toolIconUrl + "add-cube.svg",
|
||||||
subImage: { x: 0, y: Tool.IMAGE_WIDTH, width: Tool.IMAGE_WIDTH, height: Tool.IMAGE_HEIGHT },
|
subImage: { x: 0, y: Tool.IMAGE_WIDTH, width: Tool.IMAGE_WIDTH, height: Tool.IMAGE_HEIGHT },
|
||||||
|
|
|
@ -83,12 +83,12 @@ var toolBar = (function () {
|
||||||
browseModelsButton,
|
browseModelsButton,
|
||||||
loadURLMenuItem,
|
loadURLMenuItem,
|
||||||
loadFileMenuItem,
|
loadFileMenuItem,
|
||||||
menuItemWidth = 125,
|
menuItemWidth,
|
||||||
menuItemOffset,
|
menuItemOffset,
|
||||||
menuItemHeight,
|
menuItemHeight,
|
||||||
menuItemMargin = 5,
|
menuItemMargin = 5,
|
||||||
menuTextColor = { red: 255, green: 255, blue: 255 },
|
menuTextColor = { red: 255, green: 255, blue: 255 },
|
||||||
menuBackgoundColor = { red: 18, green: 66, blue: 66 };
|
menuBackgroundColor = { red: 18, green: 66, blue: 66 };
|
||||||
|
|
||||||
function initialize() {
|
function initialize() {
|
||||||
toolBar = new ToolBar(0, 0, ToolBar.VERTICAL);
|
toolBar = new ToolBar(0, 0, ToolBar.VERTICAL);
|
||||||
|
@ -125,9 +125,8 @@ var toolBar = (function () {
|
||||||
loadURLMenuItem = Overlays.addOverlay("text", {
|
loadURLMenuItem = Overlays.addOverlay("text", {
|
||||||
x: newModelButton.x - menuItemWidth,
|
x: newModelButton.x - menuItemWidth,
|
||||||
y: newModelButton.y + menuItemOffset,
|
y: newModelButton.y + menuItemOffset,
|
||||||
width: menuItemWidth,
|
|
||||||
height: menuItemHeight,
|
height: menuItemHeight,
|
||||||
backgroundColor: menuBackgoundColor,
|
backgroundColor: menuBackgroundColor,
|
||||||
topMargin: menuItemMargin,
|
topMargin: menuItemMargin,
|
||||||
text: "Model URL",
|
text: "Model URL",
|
||||||
alpha: 0.9,
|
alpha: 0.9,
|
||||||
|
@ -137,15 +136,19 @@ var toolBar = (function () {
|
||||||
loadFileMenuItem = Overlays.addOverlay("text", {
|
loadFileMenuItem = Overlays.addOverlay("text", {
|
||||||
x: newModelButton.x - menuItemWidth,
|
x: newModelButton.x - menuItemWidth,
|
||||||
y: newModelButton.y + menuItemOffset + menuItemHeight,
|
y: newModelButton.y + menuItemOffset + menuItemHeight,
|
||||||
width: menuItemWidth,
|
|
||||||
height: menuItemHeight,
|
height: menuItemHeight,
|
||||||
backgroundColor: menuBackgoundColor,
|
backgroundColor: menuBackgroundColor,
|
||||||
topMargin: menuItemMargin,
|
topMargin: menuItemMargin,
|
||||||
text: "Model File",
|
text: "Model File",
|
||||||
alpha: 0.9,
|
alpha: 0.9,
|
||||||
visible: false
|
visible: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
menuItemWidth = Math.max(Overlays.textWidth(loadURLMenuItem, "Model URL"),
|
||||||
|
Overlays.textWidth(loadFileMenuItem, "Model File")) + 20;
|
||||||
|
Overlays.editOverlay(loadURLMenuItem, { width: menuItemWidth });
|
||||||
|
Overlays.editOverlay(loadFileMenuItem, { width: menuItemWidth });
|
||||||
|
|
||||||
newCubeButton = toolBar.addTool({
|
newCubeButton = toolBar.addTool({
|
||||||
imageURL: toolIconUrl + "add-cube.svg",
|
imageURL: toolIconUrl + "add-cube.svg",
|
||||||
subImage: { x: 0, y: Tool.IMAGE_WIDTH, width: Tool.IMAGE_WIDTH, height: Tool.IMAGE_HEIGHT },
|
subImage: { x: 0, y: Tool.IMAGE_WIDTH, width: Tool.IMAGE_WIDTH, height: Tool.IMAGE_HEIGHT },
|
||||||
|
|
Loading…
Reference in a new issue