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