mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-19 16:18:58 +01:00
debt - refer to tab height also in code
This commit is contained in:
@@ -734,7 +734,7 @@
|
|||||||
"--tab-sizing-current-width",
|
"--tab-sizing-current-width",
|
||||||
"--tab-sizing-fixed-min-width",
|
"--tab-sizing-fixed-min-width",
|
||||||
"--tab-sizing-fixed-max-width",
|
"--tab-sizing-fixed-max-width",
|
||||||
"--editor-group-title-height",
|
"--editor-group-tab-height",
|
||||||
"--testMessageDecorationFontFamily",
|
"--testMessageDecorationFontFamily",
|
||||||
"--testMessageDecorationFontSize",
|
"--testMessageDecorationFontSize",
|
||||||
"--title-border-bottom-color",
|
"--title-border-bottom-color",
|
||||||
|
|||||||
@@ -93,9 +93,9 @@ export abstract class EditorTabsControl extends Themable {
|
|||||||
protected readonly groupTransfer = LocalSelectionTransfer.getInstance<DraggedEditorGroupIdentifier>();
|
protected readonly groupTransfer = LocalSelectionTransfer.getInstance<DraggedEditorGroupIdentifier>();
|
||||||
protected readonly treeItemsTransfer = LocalSelectionTransfer.getInstance<DraggedTreeItemsIdentifier>();
|
protected readonly treeItemsTransfer = LocalSelectionTransfer.getInstance<DraggedTreeItemsIdentifier>();
|
||||||
|
|
||||||
private static readonly EDITOR_TITLE_HEIGHT = {
|
private static readonly EDITOR_TAB_HEIGHT = {
|
||||||
normal: 35,
|
normal: 35 as const,
|
||||||
compact: 22
|
compact: 22 as const
|
||||||
};
|
};
|
||||||
|
|
||||||
protected breadcrumbsControl: BreadcrumbsControl | undefined = undefined;
|
protected breadcrumbsControl: BreadcrumbsControl | undefined = undefined;
|
||||||
@@ -156,7 +156,7 @@ export abstract class EditorTabsControl extends Themable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected create(parent: HTMLElement): void {
|
protected create(parent: HTMLElement): void {
|
||||||
this.updateTitleHeight();
|
this.updateTabHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected createBreadcrumbsControl(container: HTMLElement, options: IBreadcrumbsControlOptions): void {
|
protected createBreadcrumbsControl(container: HTMLElement, options: IBreadcrumbsControlOptions): void {
|
||||||
@@ -429,19 +429,19 @@ export abstract class EditorTabsControl extends Themable {
|
|||||||
return keybinding ? keybinding.getLabel() ?? undefined : undefined;
|
return keybinding ? keybinding.getLabel() ?? undefined : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get titleHeight() {
|
protected get tabHeight() {
|
||||||
return this.accessor.partOptions.tabHeight !== 'compact' ? EditorTabsControl.EDITOR_TITLE_HEIGHT.normal : EditorTabsControl.EDITOR_TITLE_HEIGHT.compact;
|
return this.accessor.partOptions.tabHeight !== 'compact' ? EditorTabsControl.EDITOR_TAB_HEIGHT.normal : EditorTabsControl.EDITOR_TAB_HEIGHT.compact;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected updateTitleHeight(): void {
|
protected updateTabHeight(): void {
|
||||||
this.parent.style.setProperty('--editor-group-title-height', `${this.titleHeight}px`);
|
this.parent.style.setProperty('--editor-group-tab-height', `${this.tabHeight}px`);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateOptions(oldOptions: IEditorPartOptions, newOptions: IEditorPartOptions): void {
|
updateOptions(oldOptions: IEditorPartOptions, newOptions: IEditorPartOptions): void {
|
||||||
|
|
||||||
// Update title height
|
// Update tab height
|
||||||
if (oldOptions.tabHeight !== newOptions.tabHeight) {
|
if (oldOptions.tabHeight !== newOptions.tabHeight) {
|
||||||
this.updateTitleHeight();
|
this.updateTabHeight();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.monaco-workbench .part.editor > .content .editor-group-container > .title .monaco-icon-label::before {
|
.monaco-workbench .part.editor > .content .editor-group-container > .title .monaco-icon-label::before {
|
||||||
height: var(--editor-group-title-height); /* tweak the icon size of the editor labels when icons are enabled */
|
height: var(--editor-group-tab-height); /* tweak the icon size of the editor labels when icons are enabled */
|
||||||
}
|
}
|
||||||
|
|
||||||
.monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .monaco-icon-label::after,
|
.monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .monaco-icon-label::after,
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
|
|
||||||
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container {
|
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: var(--editor-group-title-height);
|
height: var(--editor-group-tab-height);
|
||||||
scrollbar-width: none; /* Firefox: hide scrollbar */
|
scrollbar-width: none; /* Firefox: hide scrollbar */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height: var(--editor-group-title-height);
|
height: var(--editor-group-tab-height);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
}
|
}
|
||||||
@@ -265,7 +265,7 @@
|
|||||||
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab .tab-label {
|
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab .tab-label {
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
margin-bottom: auto;
|
margin-bottom: auto;
|
||||||
line-height: var(--editor-group-title-height); /* aligns icon and label vertically centered in the tab */
|
line-height: var(--editor-group-tab-height); /* aligns icon and label vertically centered in the tab */
|
||||||
}
|
}
|
||||||
|
|
||||||
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink .tab-label,
|
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink .tab-label,
|
||||||
@@ -473,7 +473,7 @@
|
|||||||
cursor: default;
|
cursor: default;
|
||||||
flex: initial;
|
flex: initial;
|
||||||
padding: 0 8px 0 4px;
|
padding: 0 8px 0 4px;
|
||||||
height: var(--editor-group-title-height);
|
height: var(--editor-group-tab-height);
|
||||||
}
|
}
|
||||||
|
|
||||||
.monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-item {
|
.monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-item {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* Title Label */
|
/* Title Label */
|
||||||
|
|
||||||
.monaco-workbench .part.editor > .content .editor-group-container > .title > .label-container {
|
.monaco-workbench .part.editor > .content .editor-group-container > .title > .label-container {
|
||||||
height: var(--editor-group-title-height);
|
height: var(--editor-group-tab-height);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.monaco-workbench .part.editor > .content .editor-group-container > .title > .label-container > .title-label {
|
.monaco-workbench .part.editor > .content .editor-group-container > .title > .label-container > .title-label {
|
||||||
line-height: var(--editor-group-title-height);
|
line-height: var(--editor-group-tab-height);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
flex: initial;
|
flex: initial;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
padding-right: 8px;
|
padding-right: 8px;
|
||||||
height: var(--editor-group-title-height);
|
height: var(--editor-group-tab-height);
|
||||||
}
|
}
|
||||||
|
|
||||||
.monaco-workbench .part.editor > .content .editor-group-container > .title > .title-actions .action-item {
|
.monaco-workbench .part.editor > .content .editor-group-container > .title > .title-actions .action-item {
|
||||||
|
|||||||
@@ -1550,7 +1550,7 @@ export class MultiEditorTabsControl extends EditorTabsControl {
|
|||||||
if (this.accessor.partOptions.wrapTabs && this.tabsAndActionsContainer?.classList.contains('wrapping')) {
|
if (this.accessor.partOptions.wrapTabs && this.tabsAndActionsContainer?.classList.contains('wrapping')) {
|
||||||
total = this.tabsAndActionsContainer.offsetHeight;
|
total = this.tabsAndActionsContainer.offsetHeight;
|
||||||
} else {
|
} else {
|
||||||
total = this.titleHeight;
|
total = this.tabHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
const offset = total;
|
const offset = total;
|
||||||
@@ -1708,7 +1708,7 @@ export class MultiEditorTabsControl extends EditorTabsControl {
|
|||||||
if (tabsWrapMultiLine) {
|
if (tabsWrapMultiLine) {
|
||||||
if (
|
if (
|
||||||
(tabsContainer.offsetHeight > dimensions.available.height) || // if height exceeds available height
|
(tabsContainer.offsetHeight > dimensions.available.height) || // if height exceeds available height
|
||||||
(allTabsWidth === visibleTabsWidth && tabsContainer.offsetHeight === this.titleHeight) || // if wrapping is not needed anymore
|
(allTabsWidth === visibleTabsWidth && tabsContainer.offsetHeight === this.tabHeight) || // if wrapping is not needed anymore
|
||||||
(!lastTabFitsWrapped()) // if last tab does not fit anymore
|
(!lastTabFitsWrapped()) // if last tab does not fit anymore
|
||||||
) {
|
) {
|
||||||
updateTabsWrapping(false);
|
updateTabsWrapping(false);
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ export class SingleEditorTabsControl extends EditorTabsControl {
|
|||||||
|
|
||||||
getHeight(): IEditorGroupTitleHeight {
|
getHeight(): IEditorGroupTitleHeight {
|
||||||
return {
|
return {
|
||||||
total: this.titleHeight,
|
total: this.tabHeight,
|
||||||
offset: 0
|
offset: 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user