Allow toolbar spacers and linebreaks at the same time

This commit is contained in:
JannisX11 2021-08-13 20:02:35 +02:00
parent c570d85a5e
commit b1e3df0a76
3 changed files with 5 additions and 13 deletions

View File

@ -274,6 +274,10 @@
width: 100%;
overflow: hidden;
}
.toolbar > .content {
display: flex;
flex-wrap: wrap;
}
div.toolbar_wrapper {
float: none;
}

View File

@ -1118,9 +1118,6 @@ class Toolbar {
content.append(`<div class="toolbar_separator ${char == '_' ? 'border' : (char == '+' ? 'spacer' : 'linebreak')}"></div>`);
this.children.push(char + guid().substr(0,8));
if (char === '+') content[0].style.display = 'flex';
if (char === '#') content[0].style.display = 'block';
continue;
}
@ -1259,8 +1256,6 @@ class Toolbar {
separator.className = `toolbar_separator ${type}`;
content.append(separator);
}
if (item[0] === '+') content[0].style.display = 'flex';
if (item[0] === '#') content[0].style.display = 'block';
} else if (typeof item === 'object') {
if (scope.condition_cache[i]) {
@ -2027,13 +2022,7 @@ const BARS = {
if (item.type === 'separator') {
item = item.separator_code;
}
if (item == '#' && BARS.editing_bar.children.find(c => typeof c == 'string' && c[0] == '+') ||
item == '+' && BARS.editing_bar.children.find(c => typeof c == 'string' && c[0] == '#')
) {
Blockbench.showQuickMessage('dialog.toolbar_edit.incompatible_separators', 2000);
} else {
BARS.editing_bar.add(item);
}
BARS.editing_bar.add(item);
},
openContextMenu(item, event) {
new Menu([

View File

@ -347,7 +347,6 @@
"dialog.toolbar_edit.title": "Customize Toolbar",
"dialog.toolbar_edit.hidden": "Hidden",
"dialog.toolbar_edit.hidden_tools": "Some tools might be hidden because they are not available in the current mode, format, or situation.",
"dialog.toolbar_edit.incompatible_separators": "Spacers and Line Breaks are mutually exclusive, you cannot use both in the same toolbar.",
"dialog.entitylist.title": "Open Entity Model",
"dialog.entitylist.text": "Select the model you want to import",