add menu hover pop behavior preference. fix contour spindle speed
This commit is contained in:
parent
de40a86443
commit
ecc86f42e1
5 changed files with 49 additions and 14 deletions
|
|
@ -600,6 +600,7 @@
|
|||
view: null,
|
||||
dark: false,
|
||||
expert: true,
|
||||
hoverPop: true,
|
||||
zoomSpeed: 1.0,
|
||||
thinRender: false,
|
||||
reverseZoom: true,
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@
|
|||
let control = settings().controller;
|
||||
let isDark = control.dark;
|
||||
control.expert = UI.expert.checked;
|
||||
control.hoverPop = UI.hoverPop.checked;
|
||||
control.showOrigin = UI.showOrigin.checked;
|
||||
control.autoLayout = UI.autoLayout.checked;
|
||||
control.freeLayout = UI.freeLayout.checked;
|
||||
|
|
@ -105,6 +106,7 @@
|
|||
API.conf.save();
|
||||
API.mode.set_expert(control.expert);
|
||||
API.platform.update_size();
|
||||
UC.setHoverPop(control.hoverPop);
|
||||
}
|
||||
|
||||
function onLayerToggle() {
|
||||
|
|
@ -1138,8 +1140,9 @@
|
|||
welcome = $('welcome'),
|
||||
gcode = $('dev-gcode'),
|
||||
tracker = $('tracker'),
|
||||
controller = settings().controller,
|
||||
dark = controller.dark;
|
||||
controller = settings().controller;
|
||||
|
||||
UC.setHoverPop(controller.hoverPop);
|
||||
|
||||
WIN.addEventListener("resize", () => {
|
||||
API.event.emit('resize');
|
||||
|
|
@ -1155,7 +1158,7 @@
|
|||
});
|
||||
|
||||
SPACE.showSkyGrid(false);
|
||||
SPACE.setSkyColor(dark ? 0 : 0xffffff);
|
||||
SPACE.setSkyColor(controller.dark ? 0 : 0xffffff);
|
||||
SPACE.init(container, function (delta) {
|
||||
if (API.var.layer_max === 0 || !delta) return;
|
||||
if (settings().controller.reverseZoom) delta = -delta;
|
||||
|
|
@ -1330,6 +1333,7 @@
|
|||
|
||||
layout: UC.newGroup(LANG.op_menu, $('prefs-gen'), {inline: true}),
|
||||
expert: UC.newBoolean(LANG.op_xprt_s, booleanSave, {title:LANG.op_xprt_l}),
|
||||
hoverPop: UC.newBoolean(LANG.op_hopo_s, booleanSave, {title:LANG.op_hopo_l}),
|
||||
dark: UC.newBoolean(LANG.op_dark_s, booleanSave, {title:LANG.op_dark_l}),
|
||||
showOrigin: UC.newBoolean(LANG.op_show_s, booleanSave, {title:LANG.op_show_l, modes:GCODE}),
|
||||
alignTop: UC.newBoolean(LANG.op_alig_s, booleanSave, {title:LANG.op_alig_l, modes:CAM}),
|
||||
|
|
@ -1708,9 +1712,6 @@
|
|||
UC.hidePoppers();
|
||||
};
|
||||
|
||||
// shortcut to load settings
|
||||
UI.settingsGroup.onclick = settingsLoad;
|
||||
|
||||
SPACE.addEventHandlers(self, [
|
||||
'keyup', keyUpHandler,
|
||||
'keydown', keyDownHandler,
|
||||
|
|
|
|||
|
|
@ -15,12 +15,14 @@
|
|||
inputAction = null,
|
||||
groups = {},
|
||||
groupShow = {},
|
||||
groupSticky = false,
|
||||
groupName = undefined,
|
||||
poppable = {},
|
||||
hasModes = [],
|
||||
isExpert = [],
|
||||
letMode = null,
|
||||
letExpert = false,
|
||||
letHoverPop = true,
|
||||
DOC = SELF.document,
|
||||
state = {},
|
||||
prefix = "tab",
|
||||
|
|
@ -36,6 +38,7 @@
|
|||
refresh: refresh,
|
||||
setMode: setMode,
|
||||
setExpert: setExpert,
|
||||
setHoverPop: setHoverPop,
|
||||
bound: bound,
|
||||
toInt: toInt,
|
||||
toFloat: toFloat,
|
||||
|
|
@ -145,6 +148,10 @@
|
|||
setMode(letMode);
|
||||
}
|
||||
|
||||
function setHoverPop(bool) {
|
||||
letHoverPop = bool;
|
||||
}
|
||||
|
||||
function checkpoint() {
|
||||
return { addTo, lastDiv, lastGroup, groupName };
|
||||
}
|
||||
|
|
@ -181,7 +188,6 @@
|
|||
popper = !opt.inline && label,
|
||||
link;
|
||||
|
||||
|
||||
if (popper) {
|
||||
let pop = DOC.createElement('div');
|
||||
pop.classList.add('set-pop');
|
||||
|
|
@ -223,7 +229,20 @@
|
|||
toggleGroup(group, dbkey);
|
||||
};
|
||||
if (popper) {
|
||||
row.onmouseenter = function(ev) {
|
||||
let saveclick = row.onclick;
|
||||
row.onclick = function(ev) {
|
||||
let showing = groupShow[group];
|
||||
if (saveclick && showing) {
|
||||
saveclick(ev);
|
||||
} else {
|
||||
row.onmouseenter(ev, true);
|
||||
}
|
||||
};
|
||||
row.onmouseenter = function(ev, click) {
|
||||
let showing = groupShow[group];
|
||||
if (!(letHoverPop || click || showing)) {
|
||||
return;
|
||||
}
|
||||
if (ev.target !== link && ev.target !== row) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -231,6 +250,9 @@
|
|||
showGroup(group);
|
||||
};
|
||||
row.onmouseleave = function(ev) {
|
||||
if (groupSticky) {
|
||||
return;
|
||||
}
|
||||
if (ev.target !== link && ev.target !== row) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -255,6 +277,7 @@
|
|||
groupShow[name] = state[group.key] = (groupname === name);
|
||||
updateGroupShow(name);
|
||||
});
|
||||
groupSticky = false;
|
||||
}
|
||||
|
||||
function toggleGroup(groupname, dbkey) {
|
||||
|
|
@ -431,7 +454,9 @@
|
|||
}
|
||||
};
|
||||
addModeControls(btn, opt);
|
||||
if (opt.title) row.setAttribute("title", options.title);
|
||||
if (opt.title) {
|
||||
row.setAttribute("title", options.title);
|
||||
}
|
||||
txt.button = btn;
|
||||
|
||||
return txt;
|
||||
|
|
@ -631,8 +656,13 @@
|
|||
if (options.title) row.setAttribute("title", options.title);
|
||||
if (options.action) action = options.action;
|
||||
}
|
||||
ip.onchange = function() { action() };
|
||||
ip.onchange = function() {
|
||||
action();
|
||||
};
|
||||
ip.setVisible = row.setVisible;
|
||||
ip.onclick = (ev) => {
|
||||
groupSticky = true;
|
||||
};
|
||||
|
||||
return ip;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1362,6 +1362,7 @@
|
|||
}
|
||||
newOutput.push(layerOut);
|
||||
layerOut = [];
|
||||
layerOut.spindle = spindle;
|
||||
}
|
||||
|
||||
function setTool(toolID, feed, plunge) {
|
||||
|
|
@ -1735,8 +1736,8 @@
|
|||
// two modes for deferred outlining: x then y or combined
|
||||
if (process.camContourCurves) {
|
||||
lastMode = CPRO.CONTOUR_X;
|
||||
setTool(process.camOutlineTool, process.camOutlineSpeed, process.camOutlinePlunge);
|
||||
spindle = Math.min(spindleMax, process.camOutlineSpindle);
|
||||
setTool(process.camContourTool, process.camContourSpeed, process.camContourPlunge);
|
||||
spindle = Math.min(spindleMax, process.camContourSpindle);
|
||||
// combined deferred contour x and y outlining
|
||||
let contourxy = [].appendAll(depthData.contourx).appendAll(depthData.contoury);
|
||||
printPoint = tip2tipEmit(contourxy, printPoint, function(el, point, count) {
|
||||
|
|
@ -1751,8 +1752,8 @@
|
|||
return lastPoint;
|
||||
});
|
||||
} else {
|
||||
setTool(process.camOutlineTool, process.camOutlineSpeed, process.camOutlinePlunge);
|
||||
spindle = Math.min(spindleMax, process.camOutlineSpindle);
|
||||
setTool(process.camContourTool, process.camContourSpeed, process.camContourPlunge);
|
||||
spindle = Math.min(spindleMax, process.camContourSpindle);
|
||||
// deferred contour x outlining
|
||||
if (depthData.contourx.length > 0) {
|
||||
lastMode = CPRO.CONTOUR_X;
|
||||
|
|
|
|||
Loading…
Reference in a new issue