mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-21 01:13:37 +08:00
Mobile main menu tweaks
This commit is contained in:
parent
e341012991
commit
a14e9993f2
@ -638,7 +638,7 @@
|
||||
justify-content: space-around;
|
||||
background-color: var(--color-bright_ui);
|
||||
box-shadow: 0 0px 8px rgba(0, 0, 0, 0.64);
|
||||
border-radius: 5px;
|
||||
border-radius: 4px;
|
||||
padding: 0 5px;
|
||||
z-index: 30;
|
||||
}
|
||||
@ -652,6 +652,14 @@
|
||||
background-color: var(--color-accent);
|
||||
color: var(--color-accent_text);
|
||||
}
|
||||
#mobile_menu_bar > label {
|
||||
height: 20px;
|
||||
width: 0;
|
||||
flex-basis: 100%;
|
||||
text-align: center;
|
||||
color: var(--color-bright_ui_text);
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
/* Tab Bar */
|
||||
#tab_bar {
|
||||
|
@ -273,7 +273,7 @@ const MenuBar = {
|
||||
'select_all',
|
||||
'unselect_all',
|
||||
'invert_selection'
|
||||
], {icon: 'icon-gizmo'})
|
||||
], {icon: 'edit'})
|
||||
new BarMenu('transform', [
|
||||
'scale',
|
||||
{name: 'menu.transform.rotate', id: 'rotate', icon: 'rotate_90_degrees_ccw', children: [
|
||||
@ -568,12 +568,14 @@ const MenuBar = {
|
||||
document.getElementById('mobile_menu_bar').remove();
|
||||
return;
|
||||
}
|
||||
let bar = Interface.createElement('div', {id: 'mobile_menu_bar'});
|
||||
let label = Interface.createElement('label', {});
|
||||
let bar = Interface.createElement('div', {id: 'mobile_menu_bar'}, label);
|
||||
let menu_button_nodes = [];
|
||||
let menu_position;
|
||||
let setSelected = node => {
|
||||
let setSelected = (node, menu) => {
|
||||
menu_button_nodes.forEach(n => n.classList.remove('selected'))
|
||||
node.classList.add('selected');
|
||||
label.innerText = menu.name;
|
||||
}
|
||||
for (let id in MenuBar.menus) {
|
||||
let menu = MenuBar.menus[id];
|
||||
@ -585,14 +587,15 @@ const MenuBar = {
|
||||
if (MenuBar.last_opened == menu) return;
|
||||
MenuBar.last_opened = MenuBar.open = menu;
|
||||
menu.open(menu_position);
|
||||
setSelected(node);
|
||||
setSelected(node, menu);
|
||||
})
|
||||
menu_button_nodes.push(node);
|
||||
bar.append(node);
|
||||
if (MenuBar.last_opened == menu) {
|
||||
if (MenuBar.last_opened == menu || (!MenuBar.last_opened && id == 'file')) {
|
||||
setTimeout(() => {
|
||||
MenuBar.last_opened = menu;
|
||||
menu.open(menu_position);
|
||||
setSelected(node);
|
||||
setSelected(node, menu);
|
||||
}, 1)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user