fix hover/drop highlight. more left menu tweaks
This commit is contained in:
parent
c0caa7016b
commit
0466d36f4d
4 changed files with 28 additions and 10 deletions
|
|
@ -140,7 +140,7 @@ function space_init(data) {
|
||||||
space.event.addHandlers(self, [
|
space.event.addHandlers(self, [
|
||||||
'drop', (evt) => {
|
'drop', (evt) => {
|
||||||
estop(evt);
|
estop(evt);
|
||||||
platform.setColor(platcolor);
|
platform.set({ opacity: 0, color: platcolor });
|
||||||
call.load_files([...evt.dataTransfer.files]);
|
call.load_files([...evt.dataTransfer.files]);
|
||||||
},
|
},
|
||||||
'dragover', evt => {
|
'dragover', evt => {
|
||||||
|
|
@ -148,9 +148,10 @@ function space_init(data) {
|
||||||
evt.dataTransfer.dropEffect = 'copy';
|
evt.dataTransfer.dropEffect = 'copy';
|
||||||
let color = platform.setColor(0x00ff00);
|
let color = platform.setColor(0x00ff00);
|
||||||
if (color !== 0x00ff00) platcolor = color;
|
if (color !== 0x00ff00) platcolor = color;
|
||||||
|
platform.set({ opacity: 0.1 });
|
||||||
},
|
},
|
||||||
'dragleave', evt => {
|
'dragleave', evt => {
|
||||||
platform.setColor(platcolor);
|
platform.set({ opacity: 0, color: platcolor });
|
||||||
},
|
},
|
||||||
'keypress', evt => {
|
'keypress', evt => {
|
||||||
if (api.modal.showing) {
|
if (api.modal.showing) {
|
||||||
|
|
|
||||||
|
|
@ -286,8 +286,8 @@ let file = {
|
||||||
|
|
||||||
// return selection if models are invalid. can happen when called from
|
// return selection if models are invalid. can happen when called from
|
||||||
// even bound to a button which delivers a PointEvent argument
|
// even bound to a button which delivers a PointEvent argument
|
||||||
function fallback(models) {
|
function fallback(models, strict) {
|
||||||
return Array.isArray(models) ? models : selection.models();
|
return Array.isArray(models) ? models : selection.models(strict);
|
||||||
}
|
}
|
||||||
|
|
||||||
let tool = {
|
let tool = {
|
||||||
|
|
@ -307,6 +307,10 @@ let tool = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
split(models) {
|
||||||
|
models = fallback(models);
|
||||||
|
},
|
||||||
|
|
||||||
duplicate() {
|
duplicate() {
|
||||||
for (let m of selection.models()) {
|
for (let m of selection.models()) {
|
||||||
m.duplicate();
|
m.duplicate();
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ function ui_build() {
|
||||||
h.div([
|
h.div([
|
||||||
// create and bind file loading elements
|
// create and bind file loading elements
|
||||||
h.div({ _: "file", class: "head" }),
|
h.div({ _: "file", class: "head" }),
|
||||||
h.div({ class: "vsep" }),
|
// h.div({ class: "vsep" }),
|
||||||
h.button({ _: 'import', onclick: file.import }, [
|
h.button({ _: 'import', onclick: file.import }, [
|
||||||
h.input({
|
h.input({
|
||||||
id: "import", type: "file", class: ["hide"], multiple: true,
|
id: "import", type: "file", class: ["hide"], multiple: true,
|
||||||
|
|
@ -238,7 +238,7 @@ function ui_build() {
|
||||||
]),
|
]),
|
||||||
h.div([
|
h.div([
|
||||||
h.div({ _: "view", class: "head" }),
|
h.div({ _: "view", class: "head" }),
|
||||||
h.div({ class: "vsep" }),
|
// h.div({ class: "vsep" }),
|
||||||
h.button({ _: 'visible', onclick() { selection.visible({ toggle: true }) } }),
|
h.button({ _: 'visible', onclick() { selection.visible({ toggle: true }) } }),
|
||||||
h.button({ _: 'bounds', onclick() { selection.boundsBox({ toggle: true }) } }),
|
h.button({ _: 'bounds', onclick() { selection.boundsBox({ toggle: true }) } }),
|
||||||
h.button({ _: 'gridlines', onclick() { api.grid() } }),
|
h.button({ _: 'gridlines', onclick() { api.grid() } }),
|
||||||
|
|
@ -247,14 +247,15 @@ function ui_build() {
|
||||||
]),
|
]),
|
||||||
h.div([
|
h.div([
|
||||||
h.div({ _: "edit", class: "head" }),
|
h.div({ _: "edit", class: "head" }),
|
||||||
h.div({ class: "vsep" }),
|
// h.div({ class: "vsep" }),
|
||||||
h.button({ _: 'duplicate', onclick: tool.duplicate }),
|
h.button({ _: 'duplicate', onclick: tool.duplicate }),
|
||||||
h.button({ _: 'merge', onclick: tool.merge }),
|
h.button({ _: 'merge', onclick: tool.merge }),
|
||||||
|
h.button({ _: 'split', onclick: tool.split }),
|
||||||
h.button({ _: 'invert', onclick: tool.invert }),
|
h.button({ _: 'invert', onclick: tool.invert }),
|
||||||
]),
|
]),
|
||||||
h.div([
|
h.div([
|
||||||
h.div({ _: "fix", class: "head" }),
|
h.div({ _: "fix", class: "head" }),
|
||||||
h.div({ class: "vsep" }),
|
// h.div({ class: "vsep" }),
|
||||||
h.button({ _: 'analyze', onclick: tool.analyze }),
|
h.button({ _: 'analyze', onclick: tool.analyze }),
|
||||||
h.button({ _: 'repair', onclick: tool.repair }),
|
h.button({ _: 'repair', onclick: tool.repair }),
|
||||||
h.button({ _: 'clean', onclick: tool.clean }),
|
h.button({ _: 'clean', onclick: tool.clean }),
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,16 @@ button:hover {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pad3 {
|
||||||
|
width: 3px;
|
||||||
|
height: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pad5 {
|
||||||
|
width: 5px;
|
||||||
|
height: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
#top-right {
|
#top-right {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
|
|
@ -216,6 +226,7 @@ button:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
#modal_frame > div {
|
#modal_frame > div {
|
||||||
|
flex-direction: column;
|
||||||
padding: 5px; /* compensate for removing padding above */
|
padding: 5px; /* compensate for removing padding above */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -362,10 +373,11 @@ button:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
#actions .head {
|
#actions .head {
|
||||||
|
color: #444;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
font-family: monospace;
|
font-family: 'Russo One', monospace;
|
||||||
font-weight: bold;
|
font-weight: lighter;
|
||||||
font-size: smaller;
|
font-size: smaller;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
background-color: rgba(150,150,150,0.05);
|
background-color: rgba(150,150,150,0.05);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue