change electron hide/show elements
bump rev 4.7.0
This commit is contained in:
parent
95fbd885de
commit
c7a205fb25
7 changed files with 17 additions and 16 deletions
|
|
@ -78,12 +78,15 @@ function createWindow() {
|
|||
if (url.endsWith('/mesh') || url.endsWith('/mesh/')) {
|
||||
return;
|
||||
}
|
||||
if (url.endsWith('/void') || url.endsWith('/void/')) {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
shell.openExternal(url);
|
||||
});
|
||||
|
||||
webContents.on('did-finish-load', () => {
|
||||
mainWindow.webContents.executeJavaScript(`{ let x = document.getElementById('app-quit'); if (x) { x.onclick = () => window.close() } }; null;`);
|
||||
// console.log('did finish load');
|
||||
});
|
||||
|
||||
if (devel) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "grid-apps",
|
||||
"version": "4.6.3",
|
||||
"version": "4.7.0",
|
||||
"description": "grid.space 3d slicing & modeling tools",
|
||||
"author": "Stewart Allen <sa@grid.space>",
|
||||
"license": "MIT",
|
||||
|
|
|
|||
|
|
@ -17,11 +17,12 @@ function tr(key, fallback) {
|
|||
return api.language?.current?.[key] || fallback || key;
|
||||
}
|
||||
|
||||
function menuItem(actions, { id, lk, xlk, text, title, iconClass, className, children }) {
|
||||
function menuItem(actions, { id, lk, xlk, text, title, iconClass, className, children, onclick }) {
|
||||
const attr = {
|
||||
...(id ? { id } : {}),
|
||||
...(title ? { title } : {}),
|
||||
...(className ? { class: className } : {}),
|
||||
...(onclick ? { onclick } : {}),
|
||||
...on(actions, id)
|
||||
};
|
||||
const lblAttr = {
|
||||
|
|
@ -122,8 +123,8 @@ function scalePanel(actions) {
|
|||
|
||||
function content(actions) {
|
||||
return [
|
||||
div({ class: 'menubar-appname', _: 'Kiri:Moto' }),
|
||||
div({ class: 'menubar-separator' }),
|
||||
div({ class: 'menubar-appname el-app-hide', _: 'Kiri:Moto' }),
|
||||
div({ class: 'menubar-separator el-app-hide' }),
|
||||
div({ class: 'f-row top-menu grow' }, [
|
||||
topMenu(actions, {
|
||||
text: 'files', lk: 'fe_menu', items: [
|
||||
|
|
@ -139,8 +140,8 @@ function content(actions) {
|
|||
menuItem(actions, { id: 'mesh-export-stl', lk: 'export-stl', text: 'save as STL', iconClass: 'fas fa-dice-d20' }),
|
||||
hr(),
|
||||
menuItem(actions, { id: 'app-export', lk: 'rc_xpws', text: 'export work', iconClass: 'fas fa-download' }),
|
||||
hr(),
|
||||
menuItem(actions, { id: 'app-quit', lk: 'quit', text: 'quit', className: 'hide' })
|
||||
hr({ class: "app-hide" }),
|
||||
menuItem(actions, { id: 'app-quit', lk: 'quit', text: 'quit', className: 'hide', onclick() { window.close() } })
|
||||
]
|
||||
}),
|
||||
topMenu(actions, {
|
||||
|
|
@ -178,7 +179,6 @@ function content(actions) {
|
|||
menuItem(actions, { id: 'render-edges', lk: 're_edgs', text: 'toggle edges', iconClass: 'fa-regular fa-square' })
|
||||
]
|
||||
}),
|
||||
// div({ class: 'menubar-separator' }),
|
||||
div({ class: 'f-row top-menu' }, [
|
||||
toolbarToolNozzle()
|
||||
]),
|
||||
|
|
@ -207,7 +207,7 @@ function content(actions) {
|
|||
menuItem(actions, { id: 'set-profs', lk: 'profs', text: 'profiles', iconClass: 'fas fa-sliders-h' }),
|
||||
menuItem(actions, { id: 'set-tools', lk: 'tools', text: 'tools', iconClass: 'fas fa-tools' }),
|
||||
menuItem(actions, { id: 'set-prefs', lk: 'prefs', text: 'prefs', iconClass: 'fa-solid fa-square-check' }),
|
||||
hr(),
|
||||
hr({ class: "el-app-hide" }),
|
||||
menuItem(actions, { id: 'install', lk: 'install', text: 'install' }),
|
||||
menuItem(actions, { id: 'uninstall', lk: 'uninstall', text: 'uninstall', className: 'hide' })
|
||||
]
|
||||
|
|
|
|||
|
|
@ -50,10 +50,7 @@ async function checkReady() {
|
|||
if (api.electron) {
|
||||
$('install').classList.add('hide');
|
||||
$('app-quit').classList.remove('hide');
|
||||
const appNameText = $('app-name-text') || document.querySelector('.menubar-appname');
|
||||
if (appNameText) appNameText.innerText = "More Info";
|
||||
const topSep = $('top-sep');
|
||||
if (topSep) topSep.style.display = 'flex';
|
||||
[...document.getElementsByClassName('el-app-hide')].forEach(el => el.classList.add('hide'));
|
||||
} else if (bootctrl) {
|
||||
$('install').classList.add('hide');
|
||||
$('uninstall').classList.remove('hide');
|
||||
|
|
@ -62,6 +59,7 @@ async function checkReady() {
|
|||
location.reload();
|
||||
}
|
||||
} else {
|
||||
[...document.getElementsByClassName('app-hide')].forEach(el => el.classList.add('hide'));
|
||||
$('install').onclick = () => {
|
||||
location.replace('/boot');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
const terms = {
|
||||
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
|
||||
LICENSE: "See the license.md file included with the source distribution",
|
||||
VERSION: "4.6.3"
|
||||
VERSION: "4.7.0"
|
||||
};
|
||||
|
||||
export const beta = 0;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
<div id="curtain" class="j-center a-center"><img id="loading">Kiri:Moto is Loading</div>
|
||||
|
||||
<!-- when running iframed, provide a separator between the menu bar and enclosing page -->
|
||||
<div id="top-sep"></div>
|
||||
<div id="top-sep" class="el-app-hide"></div>
|
||||
|
||||
<!-- top menu bar -->
|
||||
<div id="menubar" class="f-row"></div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "Kiri:Moto 4.6.3",
|
||||
"name": "Kiri:Moto 4.7.0",
|
||||
"short_name": "Kiri:Moto",
|
||||
"description": "Slicer for 3D printers, CNC mills, laser cutters and more",
|
||||
"start_url": "/boot/index.html",
|
||||
|
|
|
|||
Loading…
Reference in a new issue