Improve apply display preset menu

Fix draggable recent model thumbnails
This commit is contained in:
JannisX11 2022-08-17 20:28:07 +02:00
parent 28dba208d9
commit bb749a20f8
4 changed files with 10 additions and 9 deletions

View File

@ -563,6 +563,7 @@
}
.texture_drag_helper {
z-index: 100;
border: 2px solid var(--color-accent);
box-shadow: 0 0 16px black;
}
.icon_placeholder {

View File

@ -108,7 +108,7 @@
width: 180px;
height: 100px;
margin: auto;
cursor: pointer;
pointer-events: none;
}
#start_screen .recent_project.thumbnail:hover {
background-color: var(--color-accent);

View File

@ -1610,7 +1610,7 @@ BARS.defineActions(function() {
category: 'display',
condition: () => display_mode,
click: function (e) {
new Menu(this.children()).open(e.target)
new Menu('apply_display_preset', this.children(), {searchable: true}).open(e.target);
},
children: function() {
var presets = []
@ -1627,6 +1627,9 @@ BARS.defineActions(function() {
presets.push({
icon: icon,
name: p.id ? tl('display.preset.'+p.id) : p.name,
click() {
DisplayMode.applyPreset(p)
},
children: [
{name: 'action.apply_display_preset.here', icon: 'done', click() {
DisplayMode.applyPreset(p)

View File

@ -414,19 +414,16 @@ document.body.ondrop = function(event) {
forDragHandlers(event, function(handler, el) {
var fileNames = event.dataTransfer.files
var input = this;
var results = [];
var result_count = 0;
var i = 0;
var errant;
var paths = []
var paths = [];
if (isApp) {
for (var file of fileNames) {
paths.push(file.path)
if (file.path) paths.push(file.path)
}
} else {
paths = fileNames
}
if (!paths.length) return;
Blockbench.read(paths, handler, (content) => {
handler.cb(content, event)
})