Skip to content

Commit

Permalink
Added option to scrollbar options whether to render scrollbars over f…
Browse files Browse the repository at this point in the history
…ixed areas
  • Loading branch information
bennyboer committed Aug 3, 2022
1 parent e3e0703 commit 4238c1e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/renderer/canvas/canvas-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3042,6 +3042,7 @@ export class CanvasRenderer implements ITableEngineRenderer {
const minScrollBarLength: number = scrollBarOptions.minLength;
const scrollBarOffset: number = scrollBarOptions.offset;
const cornerRadius: number = scrollBarOptions.cornerRadius;
const drawOverFixedAreas: boolean = scrollBarOptions.drawOverFixedAreas;

const scrollableViewportSize: ISize = {
width:
Expand Down
14 changes: 14 additions & 0 deletions src/renderer/options/scrollbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const DEFAULT_SCROLLBAR_COLOR: IColor = {
alpha: 0.6,
};

const DEFAULT_DRAW_OVER_FIXED_AREAS: boolean = true;

/**
* Options regarding the scrollbar to display.
*/
Expand Down Expand Up @@ -60,6 +62,11 @@ export interface IScrollBarOptions {
* Radius of the scrollbars rounded corners.
*/
cornerRadius?: number;

/**
* Whether to draw the scrollbars over the fixed areas of the table.
*/
drawOverFixedAreas?: boolean;
}

/**
Expand Down Expand Up @@ -91,5 +98,12 @@ export const fillOptions = (options?: IScrollBarOptions) => {
options.cornerRadius = DEFAULT_SCROLLBAR_RADIUS;
}

if (
options.drawOverFixedAreas === undefined ||
options.drawOverFixedAreas === null
) {
options.drawOverFixedAreas = DEFAULT_DRAW_OVER_FIXED_AREAS;
}

return options;
};

0 comments on commit 4238c1e

Please sign in to comment.