File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed
packages/application-extension Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 2222 "title" : " Top Bar Visibility" ,
2323 "description" : " Whether to show the top bar or not" ,
2424 "default" : true
25+ },
26+ "adjustToScreen" : {
27+ "type" : " boolean" ,
28+ "title" : " Automatic Top Bar Visibility" ,
29+ "description" : " Whether to automatically adjust top bar visibility according to screen size, overriding above visible setting" ,
30+ "default" : true
2531 }
2632 },
2733 "additionalProperties" : false ,
Original file line number Diff line number Diff line change @@ -488,15 +488,24 @@ const topVisibility: JupyterFrontEndPlugin<void> = {
488488 isToggled : ( ) => top . isVisible ,
489489 } ) ;
490490
491- let settingsOverride = false ;
491+ let noAdjust = false ;
492492
493493 if ( settingRegistry ) {
494494 const loadSettings = settingRegistry . load ( pluginId ) ;
495495 const updateSettings = ( settings : ISettingRegistry . ISettings ) : void => {
496- const visible = settings . get ( 'visible' ) . composite ;
496+ // 'visible' property from user preferences or default settings
497+ let visible = settings . get ( 'visible' ) . composite ;
497498 if ( settings . user . visible !== undefined ) {
498- settingsOverride = true ;
499- top . setHidden ( ! visible ) ;
499+ visible = settings . user . visible ;
500+ }
501+ top . setHidden ( ! visible ) ;
502+ // 'adjustToScreen' property from user preferences or default settings
503+ let adjustToScreen = settings . get ( 'adjustToScreen' ) . composite ;
504+ if ( settings . user . adjustToScreen !== undefined ) {
505+ adjustToScreen = settings . user . adjustToScreen ;
506+ }
507+ if ( ! adjustToScreen ) {
508+ noAdjust = true ;
500509 }
501510 } ;
502511
@@ -517,7 +526,7 @@ const topVisibility: JupyterFrontEndPlugin<void> = {
517526 }
518527
519528 const onChanged = ( ) : void => {
520- if ( settingsOverride ) {
529+ if ( noAdjust ) {
521530 return ;
522531 }
523532 if ( app . format === 'desktop' ) {
You can’t perform that action at this time.
0 commit comments