提交 69aa29f9 编写于 作者: S SteVen Batten

handle menu/title overflow interaction

上级 a68a9750
......@@ -664,6 +664,9 @@ export class WorkbenchLayout extends Disposable implements IVerticalSashLayoutPr
this.sashXTwo.show();
}
let menubarOffset = this.parts.menubar.getMenubarItemsDimensions();
this.parts.titlebar.setTitleOffset(menubarOffset);
// Propagate to Part Layouts
this.parts.titlebar.layout(new Dimension(this.workbenchSize.width, this.titlebarHeight));
this.parts.menubar.layout(new Dimension(this.workbenchSize.width, this.menubarHeight));
......
......@@ -9,6 +9,7 @@
order: 3;
box-sizing: border-box;
padding-left: 35px;
padding-right: 150px;
}
.monaco-workbench.fullscreen > .part.menubar {
......@@ -20,6 +21,7 @@
.monaco-workbench > .part.menubar > .menubar-menu-button {
display: flex;
flex-shrink: 0;
align-items: center;
min-width: 0;
box-sizing: border-box;
......@@ -27,6 +29,7 @@
position: relative;
z-index: 10;
cursor: pointer;
overflow: hidden;
-webkit-app-region: no-drag;
}
......
......@@ -510,6 +510,14 @@ export class MenubarPart extends Part {
}
}
public getMenubarItemsDimensions(): number {
if (this.customMenus) {
return this.customMenus[this.customMenus.length - 1].titleElement.getHTMLElement().getBoundingClientRect().right;
}
return 0;
}
public createContentArea(parent: HTMLElement): HTMLElement {
this.container = $(parent);
......
......@@ -8,6 +8,7 @@
width: 100%;
font-size: 12px;
padding: 0 70px;
overflow: hidden;
flex-shrink: 0;
align-items: center;
justify-content: center;
......@@ -39,10 +40,13 @@
.monaco-workbench.windows > .part.titlebar > .window-title,
.monaco-workbench.linux > .part.titlebar > .window-title {
box-sizing: border-box;
text-align: center;
padding-right: 150px;
padding-left: 150px;
position: fixed;
margin: 1px 2px;
width: 100vw;
width: 100%;
left: calc(-100vw + 100%);
}
......
......@@ -157,6 +157,16 @@ export class TitlebarPart extends Part implements ITitleService {
return title;
}
public setTitleOffset(offset: number) {
if (this.title) {
if (offset) {
this.title.style('padding-left', offset + 'px');
} else {
this.title.style('padding-left', null);
}
}
}
public updateProperties(properties: ITitleProperties): void {
const isAdmin = typeof properties.isAdmin === 'boolean' ? properties.isAdmin : this.properties.isAdmin;
const isPure = typeof properties.isPure === 'boolean' ? properties.isPure : this.properties.isPure;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册