提交 74c21155 编写于 作者: S SteVen Batten

make menubarpart independent of titlebarpart

上级 60e8c7c2
...@@ -3,17 +3,16 @@ ...@@ -3,17 +3,16 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
.monaco-workbench > .part.titlebar > .menubar-container { .monaco-workbench > .part.menubar {
display: flex; display: flex;
position: relative; position: absolute;
z-index: 100;
height: 29px; height: 29px;
-webkit-app-region: no-drag;
order: 3; order: 3;
box-sizing: border-box; box-sizing: border-box;
margin-left: 35px;
} }
.monaco-workbench > .part.titlebar > .menubar-container > .menubar-menu-button { .monaco-workbench > .part.menubar > .menubar-menu-button {
display: flex; display: flex;
align-items: center; align-items: center;
line-height: 25px; line-height: 25px;
...@@ -21,15 +20,16 @@ ...@@ -21,15 +20,16 @@
box-sizing: border-box; box-sizing: border-box;
padding: 0px 5px; padding: 0px 5px;
position: relative; position: relative;
z-index: 900; z-index: 10;
cursor: pointer; cursor: pointer;
-webkit-app-region: no-drag;
} }
.monaco-workbench > .part.titlebar > .menubar-container > .menubar-menu-button:hover { .monaco-workbench > .part.menubar > .menubar-menu-button:hover {
background-color: rgba(255, 255, 255, 0.1); background-color: rgba(255, 255, 255, 0.1);
} }
.monaco-workbench > .part.titlebar.light > .menubar-container > .menubar-menu-button:hover { .monaco-workbench > .part.menubar > .menubar-menu-button:hover {
background-color: rgba(0, 0, 0, 0.1); background-color: rgba(0, 0, 0, 0.1);
} }
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
-webkit-app-region: no-drag; -webkit-app-region: no-drag;
margin: 0 10px; margin: 0 10px;
position: relative; position: relative;
z-index: 100; z-index: 99;
order: 2; order: 2;
} }
...@@ -81,15 +81,16 @@ ...@@ -81,15 +81,16 @@
margin-left: auto; margin-left: auto;
text-align: center; text-align: center;
position: relative; position: relative;
z-index: 100; z-index: 99;
bottom: calc(1.5em / 12); /* bottom: calc(1.5em / 12); */
order: 4; order: 4;
-webkit-app-region: no-drag; -webkit-app-region: no-drag;
height: 100%;
} }
.monaco-workbench > .part.titlebar > .window-controls-container > .window-icon svg { .monaco-workbench > .part.titlebar > .window-controls-container > .window-icon svg {
width: calc(10em / 12); width: calc(10em / 12);
height: calc(10em / 12); height: 100%;
shape-rendering: crispEdges; shape-rendering: crispEdges;
text-align: center; text-align: center;
} }
......
...@@ -48,7 +48,6 @@ export class TitlebarPart extends Part implements ITitleService { ...@@ -48,7 +48,6 @@ export class TitlebarPart extends Part implements ITitleService {
private static readonly TITLE_SEPARATOR = isMacintosh ? '' : ' - '; // macOS uses special - separator private static readonly TITLE_SEPARATOR = isMacintosh ? '' : ' - '; // macOS uses special - separator
private titleContainer: Builder; private titleContainer: Builder;
private menubarContainer: Builder;
private title: Builder; private title: Builder;
private pendingTitle: string; private pendingTitle: string;
private initialTitleFontSize: number; private initialTitleFontSize: number;
...@@ -242,10 +241,6 @@ export class TitlebarPart extends Part implements ITitleService { ...@@ -242,10 +241,6 @@ export class TitlebarPart extends Part implements ITitleService {
}); });
} }
if (isWindows) {
this.menubarContainer = $(this.titleContainer).div({ class: 'menubar-container' });
}
// Title // Title
this.title = $(this.titleContainer).div({ class: 'window-title' }); this.title = $(this.titleContainer).div({ class: 'window-title' });
if (this.pendingTitle) { if (this.pendingTitle) {
...@@ -445,10 +440,6 @@ export class TitlebarPart extends Part implements ITitleService { ...@@ -445,10 +440,6 @@ export class TitlebarPart extends Part implements ITitleService {
return super.layout(dimension); return super.layout(dimension);
} }
public getMenubarContainer(): Builder {
return this.menubarContainer;
}
} }
class ShowItemInFolderAction extends Action { class ShowItemInFolderAction extends Action {
......
...@@ -1257,7 +1257,11 @@ export class Workbench implements IPartService { ...@@ -1257,7 +1257,11 @@ export class Workbench implements IPartService {
} }
private createMenubarPart(): void { private createMenubarPart(): void {
const menubarContainer = this.titlebarPart.getMenubarContainer(); const menubarContainer = $(this.workbench).div({
'class': ['part', 'menubar'],
id: Identifiers.MENUBAR_PART,
role: 'menubar'
});
this.menubarPart.create(menubarContainer.getHTMLElement()); this.menubarPart.create(menubarContainer.getHTMLElement());
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册