fixes #93344
parent
0937991cee
commit
48248fac23
|
@ -52,7 +52,6 @@
|
|||
.monaco-workbench .pane > .pane-body > .welcome-view {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0 20px 0 20px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -70,6 +69,15 @@
|
|||
display: block;
|
||||
}
|
||||
|
||||
.monaco-workbench .pane > .pane-body .welcome-view-content {
|
||||
padding: 0 20px 0 20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.monaco-workbench .pane > .pane-body .welcome-view-content > *:last-child {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.customview-tree .monaco-list-row .monaco-tl-contents.align-icon-with-twisty::before {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,8 @@ import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar';
|
|||
import { CompositeProgressIndicator } from 'vs/workbench/services/progress/browser/progressIndicator';
|
||||
import { IProgressIndicator } from 'vs/platform/progress/common/progress';
|
||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||
import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
|
||||
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
|
||||
|
||||
export interface IPaneColors extends IColorMapping {
|
||||
dropBackground?: ColorIdentifier;
|
||||
|
@ -309,9 +311,20 @@ export abstract class ViewPane extends Pane implements IView {
|
|||
this._onDidChangeTitleArea.fire();
|
||||
}
|
||||
|
||||
private scrollableElement!: DomScrollableElement;
|
||||
|
||||
protected renderBody(container: HTMLElement): void {
|
||||
this.bodyContainer = container;
|
||||
this.viewWelcomeContainer = append(container, $('.welcome-view', { tabIndex: 0 }));
|
||||
|
||||
const viewWelcomeContainer = append(container, $('.welcome-view'));
|
||||
this.viewWelcomeContainer = $('.welcome-view-content', { tabIndex: 0 });
|
||||
this.scrollableElement = this._register(new DomScrollableElement(this.viewWelcomeContainer, {
|
||||
alwaysConsumeMouseWheel: true,
|
||||
horizontal: ScrollbarVisibility.Hidden,
|
||||
vertical: ScrollbarVisibility.Visible,
|
||||
}));
|
||||
|
||||
append(viewWelcomeContainer, this.scrollableElement.getDomNode());
|
||||
|
||||
const onViewWelcomeChange = Event.any(this.viewWelcomeController.onDidChange, this.onDidChangeViewWelcomeState);
|
||||
this._register(onViewWelcomeChange(this.updateViewWelcome, this));
|
||||
|
@ -319,7 +332,9 @@ export abstract class ViewPane extends Pane implements IView {
|
|||
}
|
||||
|
||||
protected layoutBody(height: number, width: number): void {
|
||||
// noop
|
||||
this.viewWelcomeContainer.style.height = `${height}px`;
|
||||
this.viewWelcomeContainer.style.width = `${width}px`;
|
||||
this.scrollableElement.scanDomNode();
|
||||
}
|
||||
|
||||
getProgressIndicator() {
|
||||
|
@ -410,6 +425,7 @@ export abstract class ViewPane extends Pane implements IView {
|
|||
if (!this.shouldShowWelcome()) {
|
||||
removeClass(this.bodyContainer, 'welcome');
|
||||
this.viewWelcomeContainer.innerHTML = '';
|
||||
this.scrollableElement.scanDomNode();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -418,6 +434,7 @@ export abstract class ViewPane extends Pane implements IView {
|
|||
if (contents.length === 0) {
|
||||
removeClass(this.bodyContainer, 'welcome');
|
||||
this.viewWelcomeContainer.innerHTML = '';
|
||||
this.scrollableElement.scanDomNode();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -482,6 +499,7 @@ export abstract class ViewPane extends Pane implements IView {
|
|||
}
|
||||
}
|
||||
|
||||
this.scrollableElement.scanDomNode();
|
||||
this.viewWelcomeDisposable = disposables;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,8 +89,4 @@ export class EmptyView extends ViewPane {
|
|||
this.updateTitle(this.title);
|
||||
}
|
||||
}
|
||||
|
||||
layoutBody(_size: number): void {
|
||||
// no-op
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue