fix hover/drop highlight. more left menu tweaks

This commit is contained in:
Stewart Allen 2022-01-14 23:30:06 -05:00
commit 0466d36f4d
4 changed files with 28 additions and 10 deletions

View file

@ -140,7 +140,7 @@ function space_init(data) {
space.event.addHandlers(self, [
'drop', (evt) => {
estop(evt);
platform.setColor(platcolor);
platform.set({ opacity: 0, color: platcolor });
call.load_files([...evt.dataTransfer.files]);
},
'dragover', evt => {
@ -148,9 +148,10 @@ function space_init(data) {
evt.dataTransfer.dropEffect = 'copy';
let color = platform.setColor(0x00ff00);
if (color !== 0x00ff00) platcolor = color;
platform.set({ opacity: 0.1 });
},
'dragleave', evt => {
platform.setColor(platcolor);
platform.set({ opacity: 0, color: platcolor });
},
'keypress', evt => {
if (api.modal.showing) {

View file

@ -286,8 +286,8 @@ let file = {
// return selection if models are invalid. can happen when called from
// even bound to a button which delivers a PointEvent argument
function fallback(models) {
return Array.isArray(models) ? models : selection.models();
function fallback(models, strict) {
return Array.isArray(models) ? models : selection.models(strict);
}
let tool = {
@ -307,6 +307,10 @@ let tool = {
});
},
split(models) {
models = fallback(models);
},
duplicate() {
for (let m of selection.models()) {
m.duplicate();

View file

@ -227,7 +227,7 @@ function ui_build() {
h.div([
// create and bind file loading elements
h.div({ _: "file", class: "head" }),
h.div({ class: "vsep" }),
// h.div({ class: "vsep" }),
h.button({ _: 'import', onclick: file.import }, [
h.input({
id: "import", type: "file", class: ["hide"], multiple: true,
@ -238,7 +238,7 @@ function ui_build() {
]),
h.div([
h.div({ _: "view", class: "head" }),
h.div({ class: "vsep" }),
// h.div({ class: "vsep" }),
h.button({ _: 'visible', onclick() { selection.visible({ toggle: true }) } }),
h.button({ _: 'bounds', onclick() { selection.boundsBox({ toggle: true }) } }),
h.button({ _: 'gridlines', onclick() { api.grid() } }),
@ -247,14 +247,15 @@ function ui_build() {
]),
h.div([
h.div({ _: "edit", class: "head" }),
h.div({ class: "vsep" }),
// h.div({ class: "vsep" }),
h.button({ _: 'duplicate', onclick: tool.duplicate }),
h.button({ _: 'merge', onclick: tool.merge }),
h.button({ _: 'split', onclick: tool.split }),
h.button({ _: 'invert', onclick: tool.invert }),
]),
h.div([
h.div({ _: "fix", class: "head" }),
h.div({ class: "vsep" }),
// h.div({ class: "vsep" }),
h.button({ _: 'analyze', onclick: tool.analyze }),
h.button({ _: 'repair', onclick: tool.repair }),
h.button({ _: 'clean', onclick: tool.clean }),

View file

@ -153,6 +153,16 @@ button:hover {
display: none;
}
.pad3 {
width: 3px;
height: 3px;
}
.pad5 {
width: 5px;
height: 5px;
}
#top-right {
position: absolute;
padding: 3px;
@ -216,6 +226,7 @@ button:hover {
}
#modal_frame > div {
flex-direction: column;
padding: 5px; /* compensate for removing padding above */
}
@ -362,10 +373,11 @@ button:hover {
}
#actions .head {
color: #444;
align-items: center;
justify-content: center;
font-family: monospace;
font-weight: bold;
font-family: 'Russo One', monospace;
font-weight: lighter;
font-size: smaller;
border-radius: 3px;
background-color: rgba(150,150,150,0.05);