File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -268,8 +268,7 @@ export
268268 class DataGridView extends DOMWidgetView {
269269 _createElement ( tagName : string ) {
270270 this . pWidget = new JupyterPhosphorPanelWidget ( { view : this } ) ;
271- // initialize to light theme unless set earlier
272- this . _isLightTheme = this . _isLightTheme === undefined ? true : this . _isLightTheme ;
271+ this . _initializeTheme ( ) ;
273272 return this . pWidget . node ;
274273 }
275274
@@ -434,6 +433,19 @@ export
434433 this . grid . renderers = renderers ;
435434 }
436435
436+ private _initializeTheme ( ) {
437+ // initialize theme unless set earlier
438+ if ( this . _isLightTheme !== undefined ) {
439+ return ;
440+ }
441+
442+ // initialize theme based on application settings
443+ this . _isLightTheme = ! (
444+ document . body . classList . contains ( 'theme-dark' ) /* jupyter notebook or voila */ ||
445+ document . body . dataset . jpThemeLight === 'false' /* jupyter lab */
446+ ) ;
447+ }
448+
437449 renderers : Dict < CellRendererView > ;
438450 default_renderer : CellRendererView ;
439451 grid : FeatherGrid ;
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ function main() {
233233 buttonBoxPanel . addWidget ( bw ) ;
234234 const spacer = new Widget ( ) ;
235235 buttonBoxPanel . addWidget ( spacer ) ;
236- BoxPanel . setSizeBasis ( bw , 100 ) ;
236+ BoxPanel . setSizeBasis ( bw , 120 ) ;
237237 BoxPanel . setStretch ( spacer , 1 ) ;
238238
239239 boxPanel . addWidget ( buttonBoxPanel ) ;
You can’t perform that action at this time.
0 commit comments