Skip to content

Commit

Permalink
fix for the non-jupyterlab half of finos#160
Browse files Browse the repository at this point in the history
  • Loading branch information
timkpaine committed Jul 23, 2018
1 parent 970d164 commit 430a0c3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
17 changes: 15 additions & 2 deletions packages/perspective-viewer-hypergrid/src/js/hypergrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ const base_grid_properties = {
halign: 'left',
headerTextWrapping: false,
hoverColumnHighlight: { enabled: false },
hoverRowHighlight: {
enabled: true,
backgroundColor: '#555'
},
hoverCellHighlight: {
enabled: true,
backgroundColor: '#333'
},
noDataMessage: '',
minimumColumnWidth: 50,
multipleSelections: false,
Expand All @@ -75,7 +83,7 @@ const base_grid_properties = {
treeHeaderForegroundSelectionFont: '12px "Arial", Helvetica, sans-serif',
useBitBlit: false,
vScrollbarClassPrefix: '',
voffset: 0
voffset: 0,
};

const light_theme_overrides = {
Expand Down Expand Up @@ -175,15 +183,20 @@ bindTemplate(TEMPLATE)(class HypergridElement extends HTMLElement {

const grid_properties = generateGridProperties(Hypergrid._default_properties || light_theme_overrides);
const style = window.getComputedStyle(this, null);

const header = window.getComputedStyle(this.querySelector('th'), null);
const style_hover = window.getComputedStyle(this.querySelector('td'), null);

grid_properties['showRowNumbers'] = grid_properties['showCheckboxes'] || grid_properties['showRowNumbers'];
grid_properties['treeHeaderBackgroundColor'] = grid_properties['backgroundColor'] = style.getPropertyValue('background-color');
grid_properties['treeHeaderColor'] = grid_properties['color'] = style.getPropertyValue('color');
grid_properties['columnHeaderBackgroundColor'] = header.getPropertyValue('background-color');
grid_properties['columnHeaderSeparatorColor'] = header.getPropertyValue('border-color');
grid_properties['columnHeaderColor'] = header.getPropertyValue('color');


grid_properties['hoverRowHighlight']['backgroundColor'] = style_hover.getPropertyValue('background-color');
grid_properties['hoverCellHighlight']['backgroundColor'] = style_hover.getPropertyValue('color');

this.grid.addProperties(grid_properties);

// Add tree cell renderer
Expand Down
6 changes: 4 additions & 2 deletions packages/perspective-viewer/src/less/material.dark.less
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ perspective-viewer #app {
}

perspective-row {

#name {
color: #666;
}
Expand Down Expand Up @@ -261,6 +260,9 @@ perspective-viewer #app {
border-color: @coolgrey700;
background-color: @coolgrey700;
}
td {
color: #444;
background-color: #555;
}
}

}

0 comments on commit 430a0c3

Please sign in to comment.