add back button, more prominent help

This commit is contained in:
Stewart Allen 2020-06-08 14:21:10 -04:00
commit 7fed16a47c
4 changed files with 43 additions and 16 deletions

View file

@ -1437,15 +1437,22 @@
drag.mdat = drag.mid = UI.sliderMid.clientHeight; drag.mdat = drag.mid = UI.sliderMid.clientHeight;
drag.mdmax = drag.height - 20 - drag.hiat; drag.mdmax = drag.height - 20 - drag.hiat;
drag.himax = drag.height - 20 - drag.mdat; drag.himax = drag.height - 20 - drag.mdat;
tracker.onmousemove = (ev) => { let cancel_drag = tracker.onmouseup = (ev) => {
ev.stopPropagation(); if (ev) {
if (delta) delta(ev.screenY - drag.start); ev.stopPropagation();
}; ev.preventDefault();
tracker.onmouseout = tracker.onmouseup = (ev) => { }
ev.stopPropagation();
slider.onmousemove = undefined; slider.onmousemove = undefined;
tracker.style.display = 'none'; tracker.style.display = 'none';
}; };
tracker.onmousemove = (ev) => {
ev.stopPropagation();
ev.preventDefault();
if (ev.buttons === 0) {
return cancel_drag();
}
if (delta) delta(ev.screenY - drag.start);
};
}; };
} }
@ -1717,7 +1724,7 @@
API.focus(); API.focus();
// restore expert setting preference // restore expert setting preference
UC.setExpert(control.expert); API.mode.set_expert(control.expert);
// setup tab visibility watcher // setup tab visibility watcher
// DOC.addEventListener('visibilitychange', function() { document.title = document.hidden }); // DOC.addEventListener('visibilitychange', function() { document.title = document.hidden });
@ -1770,8 +1777,10 @@
$('set-tools').onclick = (ev) => { ev.stopPropagation(); showTools() }; $('set-tools').onclick = (ev) => { ev.stopPropagation(); showTools() };
$('set-prefs').onclick = (ev) => { ev.stopPropagation(); API.modal.show('prefs') }; $('set-prefs').onclick = (ev) => { ev.stopPropagation(); API.modal.show('prefs') };
$('set-help').onclick = (ev) => { ev.stopPropagation(); API.help.show() }; $('set-help').onclick = (ev) => { ev.stopPropagation(); API.help.show() };
$('acct-help').onclick = (ev) => { ev.stopPropagation(); API.help.show() };
$('file-recent').onclick = () => { API.modal.show('files') }; $('file-recent').onclick = () => { API.modal.show('files') };
$('file-import').onclick = () => { API.event.import() }; $('file-import').onclick = () => { API.event.import() };
$('lt-back').onclick = API.platform.layout;
$('lt-action').onclick = API.platform.layout; $('lt-action').onclick = API.platform.layout;
$('act-slice').onclick = (ev) => { ev.stopPropagation(); API.function.slice() }; $('act-slice').onclick = (ev) => { ev.stopPropagation(); API.function.slice() };
$('act-preview').onclick = (ev) => { ev.stopPropagation(); API.function.print() }; $('act-preview').onclick = (ev) => { ev.stopPropagation(); API.function.print() };

View file

@ -1858,15 +1858,18 @@
updateSelectedInfo(); updateSelectedInfo();
switch (mode) { switch (mode) {
case VIEWS.ARRANGE: case VIEWS.ARRANGE:
$('lt-back').style.display = '';
KIRI.work.clear(); KIRI.work.clear();
hideSlider(); hideSlider();
clearWidgetCache(); clearWidgetCache();
updateSliderMax(); updateSliderMax();
break; break;
case VIEWS.SLICE: case VIEWS.SLICE:
$('lt-back').style.display = 'flex';
updateSliderMax(); updateSliderMax();
break; break;
case VIEWS.PREVIEW: case VIEWS.PREVIEW:
$('lt-back').style.display = 'flex';
break; break;
default: default:
DBUG.log("invalid view mode: "+mode); DBUG.log("invalid view mode: "+mode);
@ -1877,6 +1880,8 @@
function setExpert(bool) { function setExpert(bool) {
UC.setExpert(UI.expert.checked = settings.controller.expert = bool); UC.setExpert(UI.expert.checked = settings.controller.expert = bool);
$('lt-sep-help').style.display = bool ? 'none' : '';
$('set-help').style.display = bool ? 'none' : '';
} }
function getMode() { function getMode() {

View file

@ -262,15 +262,16 @@ th, tr, td {
} }
#acct-pop > div { #acct-pop > div {
margin-top: 5px; margin-top: 5px;
align-items: stretch;
background-color: white; background-color: white;
border: 1px solid #ddd; border: 1px solid #ddd;
border-radius: 3px; border-radius: 3px;
padding: 5px 0 5px 0; padding: 0;
} }
#acct-pop > div > div { #acct-pop > div > div {
padding: 0 5px 0 5px; padding: 5px;
} }
#acct-pop > div:hover { #acct-pop > div > div:hover {
color: #000; color: #000;
background-color: #f4f4f4; background-color: #f4f4f4;
} }
@ -281,7 +282,7 @@ th, tr, td {
display: none; display: none;
position: absolute; position: absolute;
right: 100%; right: 100%;
top: -6px; top: -1px;
align-items: stretch; align-items: stretch;
text-align: right; text-align: right;
border-radius: 3px; border-radius: 3px;
@ -289,7 +290,7 @@ th, tr, td {
background-color: white; background-color: white;
} }
#lang-pop > div { #lang-pop > div {
padding: 4px 6px 4px 6px; padding: 5px 7px 5px 7px;
} }
#lang-pop > div:hover { #lang-pop > div:hover {
color: #000; color: #000;
@ -320,7 +321,12 @@ th, tr, td {
left: -5px; left: -5px;
} }
#lt-sep { #lt-back {
position: absolute;
display: none;
top: 0;
}
#lt-sep, #lt-sep-help {
background-color: var(--bg-gray); background-color: var(--bg-gray);
height: 10px; height: 10px;
left: -5px; left: -5px;

View file

@ -51,6 +51,9 @@
<div id="lset-da">danish</div> <div id="lset-da">danish</div>
</div> </div>
</div> </div>
<div id="acct-help" class="col a-end">
<label>help</label>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -59,6 +62,9 @@
<div id="mid" class="grow row"> <div id="mid" class="grow row">
<div id="progress"><div id="progbar"><div id="progtxt">loading</div></div></div> <div id="progress"><div id="progbar"><div id="progtxt">loading</div></div></div>
<div id="mid-lcol" class="col j-center noshow"> <div id="mid-lcol" class="col j-center noshow">
<div id="lt-back" class="lt-menu">
<i class="fas fa-arrow-circle-left"></i>
</div>
<div id="lt-top"></div> <div id="lt-top"></div>
<div id="lt-setup" class="lt-menu"> <div id="lt-setup" class="lt-menu">
<i class="fas fa-cogs"></i> <i class="fas fa-cogs"></i>
@ -76,10 +82,6 @@
<i class="fas fa-sliders-h"></i> <i class="fas fa-sliders-h"></i>
<label>prefs<label> <label>prefs<label>
</div> </div>
<div id="set-help">
<i class="far fa-question-circle"></i>
<label>help<label>
</div>
</div> </div>
</div> </div>
<div id="lt-file" class="lt-menu"> <div id="lt-file" class="lt-menu">
@ -182,6 +184,11 @@
<label>nozzle</label> <label>nozzle</label>
<div id="pop-nozzle" class="pop-lcol row fillh russo"></div> <div id="pop-nozzle" class="pop-lcol row fillh russo"></div>
</div> </div>
<div id="lt-sep-help"></div>
<div id="set-help" class="lt-menu">
<i class="far fa-question-circle"></i>
<label>help<label>
</div>
<div id="lt-end"></div> <div id="lt-end"></div>
</div> </div>
<div id="mid-mcol" class="grow"> <div id="mid-mcol" class="grow">