Path: blob/main/src/vs/base/browser/ui/scrollbar/scrollableElementOptions.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { ScrollbarVisibility } from '../../../common/scrollable.js';67export interface ScrollableElementCreationOptions {8/**9* The scrollable element should not do any DOM mutations until renderNow() is called.10* Defaults to false.11*/12lazyRender?: boolean;13/**14* CSS Class name for the scrollable element.15*/16className?: string;17/**18* Drop subtle horizontal and vertical shadows.19* Defaults to false.20*/21useShadows?: boolean;22/**23* Handle mouse wheel (listen to mouse wheel scrolling).24* Defaults to true25*/26handleMouseWheel?: boolean;27/**28* If mouse wheel is handled, make mouse wheel scrolling smooth.29* Defaults to true.30*/31mouseWheelSmoothScroll?: boolean;32/**33* Make scrolling inertial - mostly useful with touchpad on linux.34*/35inertialScroll?: boolean;36/**37* Flip axes. Treat vertical scrolling like horizontal and vice-versa.38* Defaults to false.39*/40flipAxes?: boolean;41/**42* If enabled, will scroll horizontally when scrolling vertical.43* Defaults to false.44*/45scrollYToX?: boolean;46/**47* Consume all mouse wheel events if a scrollbar is needed (i.e. scrollSize > size).48* Defaults to false.49*/50consumeMouseWheelIfScrollbarIsNeeded?: boolean;51/**52* Always consume mouse wheel events, even when scrolling is no longer possible.53* Defaults to false.54*/55alwaysConsumeMouseWheel?: boolean;56/**57* A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.58* Defaults to 1.59*/60mouseWheelScrollSensitivity?: number;61/**62* FastScrolling mulitplier speed when pressing `Alt`63* Defaults to 5.64*/65fastScrollSensitivity?: number;66/**67* Whether the scrollable will only scroll along the predominant axis when scrolling both68* vertically and horizontally at the same time.69* Prevents horizontal drift when scrolling vertically on a trackpad.70* Defaults to true.71*/72scrollPredominantAxis?: boolean;73/**74* Height for vertical arrows (top/bottom) and width for horizontal arrows (left/right).75* Defaults to 11.76*/77arrowSize?: number;78/**79* The dom node events should be bound to.80* If no listenOnDomNode is provided, the dom node passed to the constructor will be used for event listening.81*/82listenOnDomNode?: HTMLElement;83/**84* Control the visibility of the horizontal scrollbar.85* Accepted values: 'auto' (on mouse over), 'visible' (always visible), 'hidden' (never visible)86* Defaults to 'auto'.87*/88horizontal?: ScrollbarVisibility;89/**90* Height (in px) of the horizontal scrollbar.91* Defaults to 10.92*/93horizontalScrollbarSize?: number;94/**95* Height (in px) of the horizontal scrollbar slider.96* Defaults to `horizontalScrollbarSize`97*/98horizontalSliderSize?: number;99/**100* Render arrows (left/right) for the horizontal scrollbar.101* Defaults to false.102*/103horizontalHasArrows?: boolean;104/**105* Control the visibility of the vertical scrollbar.106* Accepted values: 'auto' (on mouse over), 'visible' (always visible), 'hidden' (never visible)107* Defaults to 'auto'.108*/109vertical?: ScrollbarVisibility;110/**111* Width (in px) of the vertical scrollbar.112* Defaults to 10.113*/114verticalScrollbarSize?: number;115/**116* Width (in px) of the vertical scrollbar slider.117* Defaults to `verticalScrollbarSize`118*/119verticalSliderSize?: number;120/**121* Render arrows (top/bottom) for the vertical scrollbar.122* Defaults to false.123*/124verticalHasArrows?: boolean;125/**126* Scroll gutter clicks move by page vs. jump to position.127* Defaults to false.128*/129scrollByPage?: boolean;130}131132export interface ScrollableElementChangeOptions {133handleMouseWheel?: boolean;134mouseWheelScrollSensitivity?: number;135fastScrollSensitivity?: number;136scrollPredominantAxis?: boolean;137horizontal?: ScrollbarVisibility;138horizontalScrollbarSize?: number;139vertical?: ScrollbarVisibility;140verticalScrollbarSize?: number;141scrollByPage?: boolean;142}143144export interface ScrollableElementResolvedOptions {145lazyRender: boolean;146className: string;147useShadows: boolean;148handleMouseWheel: boolean;149flipAxes: boolean;150scrollYToX: boolean;151consumeMouseWheelIfScrollbarIsNeeded: boolean;152alwaysConsumeMouseWheel: boolean;153mouseWheelScrollSensitivity: number;154fastScrollSensitivity: number;155scrollPredominantAxis: boolean;156mouseWheelSmoothScroll: boolean;157inertialScroll: boolean;158arrowSize: number;159listenOnDomNode: HTMLElement | null;160horizontal: ScrollbarVisibility;161horizontalScrollbarSize: number;162horizontalSliderSize: number;163horizontalHasArrows: boolean;164vertical: ScrollbarVisibility;165verticalScrollbarSize: number;166verticalSliderSize: number;167verticalHasArrows: boolean;168scrollByPage: boolean;169}170171172