change electron hide/show elements

bump rev 4.7.0
This commit is contained in:
Stewart Allen 2026-02-26 13:19:34 -05:00
commit c7a205fb25
7 changed files with 17 additions and 16 deletions

View file

@ -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' })
]

View file

@ -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');
}

View file

@ -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;