提交 c6017c33 编写于 作者: R rebornix

Add view options update for list view.

上级 b08275d5
...@@ -275,6 +275,12 @@ export class ListView<T> implements ISpliceable<T>, IDisposable { ...@@ -275,6 +275,12 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
this.layout(); this.layout();
} }
updateOptions(options: IListViewOptions<T>) {
if (options.additionalScrollHeight !== undefined) {
this.additionalScrollHeight = options.additionalScrollHeight;
}
}
triggerScrollFromMouseWheelEvent(browserEvent: IMouseWheelEvent) { triggerScrollFromMouseWheelEvent(browserEvent: IMouseWheelEvent) {
this.scrollableElement.triggerScrollFromMouseWheelEvent(browserEvent); this.scrollableElement.triggerScrollFromMouseWheelEvent(browserEvent);
} }
......
...@@ -854,6 +854,7 @@ export interface IListOptions<T> { ...@@ -854,6 +854,7 @@ export interface IListOptions<T> {
readonly mouseSupport?: boolean; readonly mouseSupport?: boolean;
readonly horizontalScrolling?: boolean; readonly horizontalScrolling?: boolean;
readonly ariaProvider?: IAriaProvider<T>; readonly ariaProvider?: IAriaProvider<T>;
readonly additionalScrollHeight?: number;
} }
export interface IListStyles { export interface IListStyles {
...@@ -1110,6 +1111,7 @@ class ListViewDragAndDrop<T> implements IListViewDragAndDrop<T> { ...@@ -1110,6 +1111,7 @@ class ListViewDragAndDrop<T> implements IListViewDragAndDrop<T> {
export interface IListOptionsUpdate { export interface IListOptionsUpdate {
readonly enableKeyboardNavigation?: boolean; readonly enableKeyboardNavigation?: boolean;
readonly automaticKeyboardNavigation?: boolean; readonly automaticKeyboardNavigation?: boolean;
readonly additionalScrollHeight?: number;
} }
export class List<T> implements ISpliceable<T>, IDisposable { export class List<T> implements ISpliceable<T>, IDisposable {
...@@ -1289,6 +1291,10 @@ export class List<T> implements ISpliceable<T>, IDisposable { ...@@ -1289,6 +1291,10 @@ export class List<T> implements ISpliceable<T>, IDisposable {
if (this.typeLabelController) { if (this.typeLabelController) {
this.typeLabelController.updateOptions(this._options); this.typeLabelController.updateOptions(this._options);
} }
if (optionsUpdate.additionalScrollHeight !== undefined) {
this.view.updateOptions(optionsUpdate);
}
} }
get options(): IListOptions<T> { get options(): IListOptions<T> {
......
...@@ -201,6 +201,7 @@ export class NotebookEditor extends BaseEditor implements INotebookEditor { ...@@ -201,6 +201,7 @@ export class NotebookEditor extends BaseEditor implements INotebookEditor {
mouseSupport: true, mouseSupport: true,
multipleSelectionSupport: false, multipleSelectionSupport: false,
enableKeyboardNavigation: true, enableKeyboardNavigation: true,
additionalScrollHeight: 0,
overrideStyles: { overrideStyles: {
listBackground: editorBackground, listBackground: editorBackground,
listActiveSelectionBackground: editorBackground, listActiveSelectionBackground: editorBackground,
...@@ -419,6 +420,7 @@ export class NotebookEditor extends BaseEditor implements INotebookEditor { ...@@ -419,6 +420,7 @@ export class NotebookEditor extends BaseEditor implements INotebookEditor {
DOM.toggleClass(this.rootElement, 'mid-width', dimension.width < 1000 && dimension.width >= 600); DOM.toggleClass(this.rootElement, 'mid-width', dimension.width < 1000 && dimension.width >= 600);
DOM.toggleClass(this.rootElement, 'narrow-width', dimension.width < 600); DOM.toggleClass(this.rootElement, 'narrow-width', dimension.width < 600);
DOM.size(this.body, dimension.width, dimension.height); DOM.size(this.body, dimension.width, dimension.height);
this.list?.updateOptions({ additionalScrollHeight: dimension.height });
this.list?.layout(dimension.height, dimension.width); this.list?.layout(dimension.height, dimension.width);
this.eventDispatcher?.emit([new NotebookLayoutChangedEvent({ width: true, fontInfo: true }, this.getLayoutInfo())]); this.eventDispatcher?.emit([new NotebookLayoutChangedEvent({ width: true, fontInfo: true }, this.getLayoutInfo())]);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册