Make arrows configurable via API

This commit is contained in:
Daniel Imms
2026-02-02 12:33:33 -08:00
parent fae6f03f90
commit 77695cb405
11 changed files with 65 additions and 18 deletions
+3 -7
View File
@@ -8,11 +8,6 @@ import { Widget } from './widget';
import { TimeoutTimer } from 'common/Async';
import * as dom from '../Dom';
/**
* The arrow image size.
*/
const ARROW_IMG_SIZE = 11;
export interface IScrollbarArrowOptions {
handleActivate: () => void;
className: string;
@@ -63,8 +58,9 @@ export class ScrollbarArrow extends Widget {
// this.domNode.classList.add(...ThemeIcon.asClassNameArray(opts.icon));
this.domNode.style.position = 'absolute';
this.domNode.style.width = ARROW_IMG_SIZE + 'px';
this.domNode.style.height = ARROW_IMG_SIZE + 'px';
const arrowSize = Math.min(opts.bgWidth, opts.bgHeight);
this.domNode.style.width = arrowSize + 'px';
this.domNode.style.height = arrowSize + 'px';
if (typeof opts.top !== 'undefined') {
this.domNode.style.top = opts.top + 'px';
}