From 7d898ca34de88eb41615078a28c2702a11450520 Mon Sep 17 00:00:00 2001 From: Anthony Dresser Date: Tue, 11 Sep 2018 21:21:06 -0700 Subject: [PATCH] Fix grid gaps (#2531) * modifying grid gaps * reduce gaps and increase gap for action bar --- src/sql/parts/query/editor/gridPanel.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sql/parts/query/editor/gridPanel.ts b/src/sql/parts/query/editor/gridPanel.ts index f814686c4d..42f37d8f6b 100644 --- a/src/sql/parts/query/editor/gridPanel.ts +++ b/src/sql/parts/query/editor/gridPanel.ts @@ -46,14 +46,14 @@ const ROW_HEIGHT = 29; const HEADER_HEIGHT = 26; const MIN_GRID_HEIGHT_ROWS = 8; const ESTIMATED_SCROLL_BAR_HEIGHT = 10; -const BOTTOM_PADDING = 5; +const BOTTOM_PADDING = 15; const ACTIONBAR_WIDTH = 26; // minimum height needed to show the full actionbar const ACTIONBAR_HEIGHT = 100; // this handles min size if rows is greater than the min grid visible rows -const MIN_GRID_HEIGHT = (MIN_GRID_HEIGHT_ROWS * ROW_HEIGHT) + HEADER_HEIGHT + ESTIMATED_SCROLL_BAR_HEIGHT + BOTTOM_PADDING; +const MIN_GRID_HEIGHT = (MIN_GRID_HEIGHT_ROWS * ROW_HEIGHT) + HEADER_HEIGHT + ESTIMATED_SCROLL_BAR_HEIGHT; export interface IGridTableState { @@ -245,7 +245,7 @@ class GridTable extends Disposable implements IView { readonly element: HTMLElement = this.container; // this handles if the row count is small, like 4-5 rows - private readonly maxSize = ((this.resultSet.rowCount) * ROW_HEIGHT) + HEADER_HEIGHT + ESTIMATED_SCROLL_BAR_HEIGHT + BOTTOM_PADDING; + private readonly maxSize = ((this.resultSet.rowCount) * ROW_HEIGHT) + HEADER_HEIGHT + ESTIMATED_SCROLL_BAR_HEIGHT; constructor( private runner: QueryRunner, @@ -259,7 +259,7 @@ class GridTable extends Disposable implements IView { super(); this.container.style.width = '100%'; this.container.style.height = '100%'; - this.container.style.marginBottom = BOTTOM_PADDING + 'px'; + // this.container.style.marginBottom = BOTTOM_PADDING + 'px'; this.container.className = 'grid-panel'; this.columns = this.resultSet.columnInfo.map((c, i) => { @@ -411,18 +411,18 @@ class GridTable extends Disposable implements IView { this.table.layout( new Dimension( getContentWidth(this.container) - ACTIONBAR_WIDTH, - size - BOTTOM_PADDING + size ) ); } public get minimumSize(): number { // clamp between ensuring we can show the actionbar, while also making sure we don't take too much space - return Math.max(Math.min(this.maxSize, MIN_GRID_HEIGHT), ACTIONBAR_HEIGHT); + return Math.max(Math.min(this.maxSize, MIN_GRID_HEIGHT), ACTIONBAR_HEIGHT + BOTTOM_PADDING); } public get maximumSize(): number { - return Math.max(this.maxSize, ACTIONBAR_HEIGHT); + return Math.max(this.maxSize, ACTIONBAR_HEIGHT + BOTTOM_PADDING); } private loadData(offset: number, count: number): Thenable {