Refactoring and getting icons outside menu itme menu background
This commit is contained in:
1 parent
f05022e026
commit
6baa267f2a
4 files changed
+32
-29
No files matched your search
@@ -105,7 +105,7 @@ function newCircularMenuItem () {
|
||||
selfMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
|
||||
|
||||
if (thisObject.type === 'Icon & Text') {
|
||||
thisObject.container.frame.width = 150
|
||||
thisObject.container.frame.width = 185
|
||||
} else {
|
||||
thisObject.container.frame.width = 50
|
||||
}
|
||||
@@ -328,7 +328,8 @@ function newCircularMenuItem () {
|
||||
container: thisObject.container,
|
||||
borderColor: UI_COLOR.DARK,
|
||||
backgroundColor: backgroundColorToUse,
|
||||
castShadow: false
|
||||
castShadow: false,
|
||||
xOffset: 40
|
||||
}
|
||||
|
||||
if (isMouseOver === true) {
|
||||
@@ -374,7 +375,7 @@ function newCircularMenuItem () {
|
||||
|
||||
if (thisObject.currentRadius >= thisObject.targetRadius) {
|
||||
labelPoint = {
|
||||
x: menuPosition.x + thisObject.currentRadius + 10,
|
||||
x: menuPosition.x + thisObject.currentRadius + 20,
|
||||
y: menuPosition.y + fontSize * FONT_ASPECT_RATIO
|
||||
}
|
||||
|
||||
@@ -386,3 +387,4 @@ function newCircularMenuItem () {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -771,9 +771,9 @@ function newUiObjectConstructor () {
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Add Sensor',
|
||||
action: 'Add Sensor Bot Instance',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Add Sensor',
|
||||
label: 'Add Sensor Bot Instance',
|
||||
visible: true,
|
||||
relatedUiObject: 'Sensor Bot Instance',
|
||||
rawRadius: 8,
|
||||
@@ -784,9 +784,9 @@ function newUiObjectConstructor () {
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Add Indicator',
|
||||
action: 'Add Indicator Bot Instance',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Add Indicator',
|
||||
label: 'Add Indicator Bot Instance',
|
||||
visible: true,
|
||||
relatedUiObject: 'Indicator Bot Instance',
|
||||
rawRadius: 8,
|
||||
@@ -797,9 +797,9 @@ function newUiObjectConstructor () {
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Add Trading Engine',
|
||||
action: 'Add Trading Bot Instance',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Add Trading Engine',
|
||||
label: 'Add Trading Bot Instance',
|
||||
visible: true,
|
||||
relatedUiObject: 'Trading Bot Instance',
|
||||
rawRadius: 8,
|
||||
@@ -862,9 +862,9 @@ function newUiObjectConstructor () {
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Edit Sensor',
|
||||
action: 'Edit Sensor Bot Instance',
|
||||
actionFunction: uiObject.codeEditor.activate,
|
||||
label: 'Edit Sensor',
|
||||
label: 'Edit Sensor Bot Instance',
|
||||
visible: true,
|
||||
iconPathOn: 'html',
|
||||
iconPathOff: 'html',
|
||||
@@ -877,11 +877,11 @@ function newUiObjectConstructor () {
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Delete Sensor',
|
||||
action: 'Delete Sensor Bot Instance',
|
||||
askConfirmation: true,
|
||||
confirmationLabel: 'Confirm to Delete',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete Sensor',
|
||||
label: 'Delete Sensor Bot Instance',
|
||||
visible: true,
|
||||
iconPathOn: 'delete',
|
||||
iconPathOff: 'delete',
|
||||
@@ -929,9 +929,9 @@ function newUiObjectConstructor () {
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Edit Indicator',
|
||||
action: 'Edit Indicator Bot Instance',
|
||||
actionFunction: uiObject.codeEditor.activate,
|
||||
label: 'Edit Indicator',
|
||||
label: 'Edit Indicator Bot Instance',
|
||||
visible: true,
|
||||
iconPathOn: 'html',
|
||||
iconPathOff: 'html',
|
||||
@@ -944,11 +944,11 @@ function newUiObjectConstructor () {
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Delete Indicator',
|
||||
action: 'Delete Indicator Bot Instance',
|
||||
askConfirmation: true,
|
||||
confirmationLabel: 'Confirm to Delete',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete Indicator',
|
||||
label: 'Delete Indicator Bot Instance',
|
||||
visible: true,
|
||||
iconPathOn: 'delete',
|
||||
iconPathOff: 'delete',
|
||||
@@ -996,9 +996,9 @@ function newUiObjectConstructor () {
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Edit Trading Engine',
|
||||
action: 'Edit Trading Bot Instance',
|
||||
actionFunction: uiObject.codeEditor.activate,
|
||||
label: 'Edit Trading Engine',
|
||||
label: 'Edit Trading Bot Instance',
|
||||
visible: true,
|
||||
iconPathOn: 'html',
|
||||
iconPathOff: 'html',
|
||||
@@ -1011,11 +1011,11 @@ function newUiObjectConstructor () {
|
||||
)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Delete Trading Engine',
|
||||
action: 'Delete Trading Bot Instance',
|
||||
askConfirmation: true,
|
||||
confirmationLabel: 'Confirm to Delete',
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete Trading Engine',
|
||||
label: 'Delete Trading Bot Instance',
|
||||
visible: true,
|
||||
iconPathOn: 'delete',
|
||||
iconPathOff: 'delete',
|
||||
|
||||
@@ -364,17 +364,17 @@ function newWorkspace () {
|
||||
functionLibraryPartsFromNodes.addTask(payload.node)
|
||||
}
|
||||
break
|
||||
case 'Add Sensor':
|
||||
case 'Add Sensor Bot Instance':
|
||||
{
|
||||
functionLibraryPartsFromNodes.addSensor(payload.node)
|
||||
}
|
||||
break
|
||||
case 'Add Indicator':
|
||||
case 'Add Indicator Bot Instance':
|
||||
{
|
||||
functionLibraryPartsFromNodes.addIndicator(payload.node)
|
||||
}
|
||||
break
|
||||
case 'Add Trading Engine':
|
||||
case 'Add Trading Bot Instance':
|
||||
{
|
||||
functionLibraryPartsFromNodes.addTradingEngine(payload.node)
|
||||
}
|
||||
@@ -540,15 +540,15 @@ function newWorkspace () {
|
||||
functionLibraryNodeDeleter.deleteTask(payload.node, thisObject.workspaceNode.rootNodes)
|
||||
break
|
||||
}
|
||||
case 'Delete Sensor': {
|
||||
case 'Delete Sensor Bot Instance': {
|
||||
functionLibraryNodeDeleter.deleteSensor(payload.node, thisObject.workspaceNode.rootNodes)
|
||||
break
|
||||
}
|
||||
case 'Delete Indicator': {
|
||||
case 'Delete Indicator Bot Instance': {
|
||||
functionLibraryNodeDeleter.deleteIndicator(payload.node, thisObject.workspaceNode.rootNodes)
|
||||
break
|
||||
}
|
||||
case 'Delete Trading Engine': {
|
||||
case 'Delete Trading Bot Instance': {
|
||||
functionLibraryNodeDeleter.deleteTradingEngine(payload.node, thisObject.workspaceNode.rootNodes)
|
||||
break
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
function roundedCornersBackground (params) {
|
||||
if (params.xOffset === undefined) { params.xOffset = 0 }
|
||||
borderPoint1 = {
|
||||
x: params.cornerRadius,
|
||||
x: params.cornerRadius + params.xOffset,
|
||||
y: params.cornerRadius
|
||||
}
|
||||
|
||||
@@ -15,7 +16,7 @@ function roundedCornersBackground (params) {
|
||||
}
|
||||
|
||||
borderPoint4 = {
|
||||
x: params.cornerRadius,
|
||||
x: params.cornerRadius + params.xOffset,
|
||||
y: params.container.frame.height - params.cornerRadius
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user