Fix #1331 Quad view cannot be rescaled vertically

Fix #1333 Missing translation
Fix #1332 Discord link protocol
Improve appearance of menu search bar
Smaller panel handle on top/bottom slot panels
Fix issue with saving sidebar panel order
Fix #1330 Color panel resizing issue
This commit is contained in:
JannisX11 2022-03-12 15:09:09 +01:00
parent 7fbe8abb30
commit f5beae09da
10 changed files with 35 additions and 32 deletions

View File

@ -596,8 +596,6 @@
.contextMenu .menu_search_bar {
padding: 0;
display: flex;
border: 1px solid var(--color-border);
margin: 2px;
}
.contextMenu .menu_search_bar input {
color: inherit;

View File

@ -1,6 +1,8 @@
/*Panel*/
.panel {
background-color: var(--color-ui);
display: flex;
flex-direction: column;
}
.panel.grow {
display: flex;
@ -34,17 +36,13 @@
h3.panel_handle {
display: flex;
width: 100%;
height: auto;
height: 40px;
margin: 0;
padding: 0;
font-size: inherit;
background: var(--color-ui);
place-content: space-between;
}
body > h3.panel_handle {
pointer-events: none;
box-shadow: 0 0 16px black;
width: auto;
align-items: center;
}
h3.panel_handle > label {
flex: 1 1 auto;
@ -52,11 +50,13 @@
font-size: 1.1em;
text-transform: uppercase;
color: var(--color-subtle_text);
margin: 6px 8px;
margin-right: auto;
padding: 0px 4px;
margin-left: 8px;
padding: 0 4px;
cursor: move;
}
#center h3.panel_handle {
height: 32px;
}
h3.panel_handle > label > span {
cursor: inherit;
}
@ -78,7 +78,6 @@
}
h3.panel_handle > .tool.panel_control {
flex: 0 0 24px;
margin-top: 4px;
opacity: 0.7;
cursor: pointer;
}

View File

@ -32,6 +32,7 @@
--toolbar-height: 30px;
position: relative;
display: grid;
overflow: hidden;
grid-template-columns: 332px auto 314px;
grid-template-rows: var(--toolbar-height) minmax(200px, 5000px) 26px;
grid-template-areas:

View File

@ -55,7 +55,7 @@ BARS.defineActions(() => {
<i class="icon fab fa-twitter" style="color: #1ea6ff;"></i>
<label>Twitter</label>
</a>
<a class="open-in-browser" href="https://discord.blockbench.net">
<a class="open-in-browser" href="http://discord.blockbench.net">
<i class="icon fab fa-discord" style="color: #727fff;"></i>
<label>Discord</label>
</a>

View File

@ -158,7 +158,7 @@ const Interface = {
},
position() {
this.setPosition({
top: Interface.work_screen.offsetTop,
top: 0,
bottom: 0,
left: Interface.data.left_bar_width+2
})
@ -189,7 +189,7 @@ const Interface = {
},
position() {
this.setPosition({
top: Interface.work_screen.offsetTop+30,
top: 30,
bottom: 0,
right: Interface.data.right_bar_width-2
})
@ -218,7 +218,7 @@ const Interface = {
position() {this.setPosition({
left: Interface.left_bar_width+2,
right: Interface.right_bar_width+2,
top: $('#preview').offset().top + document.getElementById('preview').clientHeight*Interface.data.quad_view_y/100
top: Interface.preview.offsetTop + 30 + Interface.preview.clientHeight*Interface.data.quad_view_y/100
})}
}),
top: new ResizeLine('top', {

View File

@ -175,6 +175,7 @@ class Menu {
let search_button = Interface.createElement('div', {}, Blockbench.getIconNode('search'));
let search_bar = Interface.createElement('li', {class: 'menu_search_bar'}, [input, search_button]);
menu_node.append(search_bar);
menu_node.append(Interface.createElement('li', {class: 'menu_separator'}));
let object_list = [];
list.forEach(function(s2, i) {

View File

@ -244,7 +244,6 @@ class Panel {
this.position_data.float_position[1] = position_before[1];
}
this.update();
saveSidebarOrder()
updateInterface()
removeEventListeners(document, 'mousemove touchmove', drag);
@ -412,6 +411,7 @@ class Panel {
}
if (slot == 'left_bar' || slot == 'right_bar') {
let change_panel_order = !!ref_panel;
if (!ref_panel && Interface.data[slot].includes(this.id)) {
let panels = Interface.data[slot].filter(id => Panels[id] && Panels[id].slot == slot || id == this.id);
let index = panels.indexOf(this.id);
@ -430,8 +430,10 @@ class Panel {
} else {
$(ref_panel.node).after(this.node);
}
Interface.data[slot].remove(this.id);
Interface.data[slot].splice(Interface.data[slot].indexOf(ref_panel.id) + (before ? 0 : 1), 0, this.id);
if (change_panel_order) {
Interface.data[slot].remove(this.id);
Interface.data[slot].splice(Interface.data[slot].indexOf(ref_panel.id) + (before ? 0 : 1), 0, this.id);
}
} else {
document.getElementById(slot).append(this.node);
Interface.data[slot].safePush(this.id);
@ -470,7 +472,6 @@ class Panel {
if (this.onResize) {
this.onResize()
}
saveSidebarOrder()
updateInterface()
}
return this;
@ -575,7 +576,6 @@ function updateInterfacePanels() {
$('.quad_canvas_wrapper.qcw_y').css('height', Interface.data.quad_view_y+'%')
$('.quad_canvas_wrapper:not(.qcw_x)').css('width', (100-Interface.data.quad_view_x)+'%')
$('.quad_canvas_wrapper:not(.qcw_y)').css('height', (100-Interface.data.quad_view_y)+'%')
//$('#timeline').css('height', Interface.data.timeline_height+'px')
for (var key in Interface.Resizers) {
var resizer = Interface.Resizers[key]
resizer.update()
@ -601,10 +601,6 @@ function setActivePanel(panel) {
Prop.active_panel = panel
}
function saveSidebarOrder() {
localStorage.setItem('interface_data', JSON.stringify(Interface.data))
}
function setupMobilePanelSelector() {
if (Blockbench.isMobile) {
Interface.PanelSelectorVue = new Vue({

View File

@ -316,9 +316,9 @@ const Settings = {
new Setting('export_empty_groups', {category: 'export', value: true});
new Setting('export_groups', {category: 'export', value: true});
new Setting('obj_face_export_mode', {category: 'export', value: 'both', type: 'select', options: {
both: 'settings.obj_face_export_mode.both',
tris: 'settings.obj_face_export_mode.tris',
quads: 'settings.obj_face_export_mode.quads',
both: tl('settings.obj_face_export_mode.both'),
tris: tl('settings.obj_face_export_mode.tris'),
quads: tl('settings.obj_face_export_mode.quads'),
}});
new Setting('animation_sample_rate',{category: 'export', value: 24, type: 'number'});
new Setting('sketchfab_token', {category: 'export', value: '', type: 'password'});

View File

@ -74,7 +74,13 @@ Interface.definePanels(() => {
$('#main_colorpicker').spectrum('reflow');
Interface.Panels.color.vue.width = 0;
Vue.nextTick(() => {
Interface.Panels.color.vue.width = this.width
let disp_before = this.vue.$refs.square_picker.style.display;
console.log(disp_before)
this.vue.$refs.square_picker.style.display = 'none';
console.log(this.height, this.vue.$el.clientHeight, this.handle.clientHeight)
let max = Math.min(460, (this.height - this.vue.$el.clientHeight - this.handle.clientHeight) * (this.vue.picker_type == 'box' ? 1.265 : 1));
Interface.Panels.color.vue.width = Math.clamp(this.width, 100, max);
this.vue.$refs.square_picker.style.display = disp_before;
})
},
component: {
@ -101,6 +107,7 @@ Interface.definePanels(() => {
methods: {
togglePickerType() {
settings.color_wheel.set(!settings.color_wheel.value);
Panels.color.onResize();
},
sort(event) {
var item = this.palette.splice(event.oldIndex, 1)[0];
@ -178,7 +185,7 @@ Interface.definePanels(() => {
</div>
<div v-show="open_tab == 'picker' || open_tab == 'both'">
<div v-show="picker_type == 'box'">
<div v-show="picker_type == 'box'" ref="square_picker" :style="{maxWidth: width + 'px'}">
<input id="main_colorpicker">
</div>
<color-wheel v-if="picker_type == 'wheel' && width" v-model="main_color" :width="width" :height="width"></color-wheel>

View File

@ -540,7 +540,7 @@
"layout.color.ui": "UI",
"layout.color.ui.desc": "Main interface color",
"layout.color.bright_ui": "Bright UI",
"layout.color.bright_ui.desc": "Context menues and tooltips",
"layout.color.bright_ui.desc": "Context menus and tooltips",
"layout.color.button": "Button",
"layout.color.button.desc": "Buttons and switches",
"layout.color.selected": "Selected",
@ -993,6 +993,8 @@
"action.add_group.desc": "Adds a new group or bone",
"action.group_elements": "Group Elements",
"action.group_elements.desc": "Wrap selected elements into a new group",
"action.resolve_group": "Resolve Group",
"action.resolve_group.desc": "Resolve the group while retaining its children in the same place",
"action.outliner_toggle": "Toggle More Options",
"action.outliner_toggle.desc": "Toggles switches for more options in the outliner",
"action.cube_counter": "Model Statistics",
@ -1399,7 +1401,6 @@
"menu.texture_mesh.texture_name": "Texture Name...",
"menu.group.sort": "Sort",
"menu.group.resolve": "Resolve",
"menu.palette.load.default": "Default",
"menu.palette.load.empty": "Blank",