@@ -8,7 +8,7 @@ import { QuickInputService } from 'vs/workbench/browser/parts/quickinput/quickIn
88import { Sash , ISashEvent , IVerticalSashLayoutProvider , IHorizontalSashLayoutProvider , Orientation } from 'vs/base/browser/ui/sash/sash' ;
99import { IPartService , Position , ILayoutOptions , Parts } from 'vs/workbench/services/part/common/partService' ;
1010import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet' ;
11- import { IStorageService , StorageScope } from 'vs/platform/storage /common/storage ' ;
11+ import { INextStorage2Service , StorageScope } from 'vs/platform/storage2 /common/storage2 ' ;
1212import { IContextViewService } from 'vs/platform/contextview/browser/contextView' ;
1313import { Disposable } from 'vs/base/common/lifecycle' ;
1414import { IThemeService } from 'vs/platform/theme/common/themeService' ;
@@ -82,7 +82,7 @@ export class WorkbenchLayout extends Disposable implements IVerticalSashLayoutPr
8282 private quickInput : QuickInputService ,
8383 private notificationsCenter : NotificationsCenter ,
8484 private notificationsToasts : NotificationsToasts ,
85- @IStorageService private storageService : IStorageService ,
85+ @INextStorage2Service private nextStorage2Service : INextStorage2Service ,
8686 @IContextViewService private contextViewService : IContextViewService ,
8787 @IPartService private partService : IPartService ,
8888 @IViewletService private viewletService : IViewletService ,
@@ -103,13 +103,13 @@ export class WorkbenchLayout extends Disposable implements IVerticalSashLayoutPr
103103 }
104104
105105 private restorePreviousState ( ) : void {
106- this . _sidebarWidth = Math . max ( this . partLayoutInfo . sidebar . minWidth , this . storageService . getInteger ( WorkbenchLayout . sashXOneWidthSettingsKey , StorageScope . GLOBAL , DEFAULT_SIDEBAR_PART_WIDTH ) ) ;
106+ this . _sidebarWidth = Math . max ( this . partLayoutInfo . sidebar . minWidth , this . nextStorage2Service . getInteger ( WorkbenchLayout . sashXOneWidthSettingsKey , StorageScope . GLOBAL , DEFAULT_SIDEBAR_PART_WIDTH ) ) ;
107107
108- this . _panelWidth = Math . max ( this . partLayoutInfo . panel . minWidth , this . storageService . getInteger ( WorkbenchLayout . sashXTwoWidthSettingsKey , StorageScope . GLOBAL , DEFAULT_PANEL_PART_SIZE ) ) ;
109- this . _panelHeight = Math . max ( this . partLayoutInfo . panel . minHeight , this . storageService . getInteger ( WorkbenchLayout . sashYHeightSettingsKey , StorageScope . GLOBAL , DEFAULT_PANEL_PART_SIZE ) ) ;
108+ this . _panelWidth = Math . max ( this . partLayoutInfo . panel . minWidth , this . nextStorage2Service . getInteger ( WorkbenchLayout . sashXTwoWidthSettingsKey , StorageScope . GLOBAL , DEFAULT_PANEL_PART_SIZE ) ) ;
109+ this . _panelHeight = Math . max ( this . partLayoutInfo . panel . minHeight , this . nextStorage2Service . getInteger ( WorkbenchLayout . sashYHeightSettingsKey , StorageScope . GLOBAL , DEFAULT_PANEL_PART_SIZE ) ) ;
110110
111111 this . panelMaximized = false ;
112- this . panelSizeBeforeMaximized = this . storageService . getInteger ( WorkbenchLayout . panelSizeBeforeMaximizedKey , StorageScope . GLOBAL , 0 ) ;
112+ this . panelSizeBeforeMaximized = this . nextStorage2Service . getInteger ( WorkbenchLayout . panelSizeBeforeMaximizedKey , StorageScope . GLOBAL , 0 ) ;
113113 }
114114
115115 private registerListeners ( ) : void {
@@ -372,34 +372,37 @@ export class WorkbenchLayout extends Disposable implements IVerticalSashLayoutPr
372372 } ) ) ;
373373
374374 this . _register ( this . sashXOne . onDidEnd ( ( ) => {
375- this . storageService . store ( WorkbenchLayout . sashXOneWidthSettingsKey , this . sidebarWidth , StorageScope . GLOBAL ) ;
375+ this . nextStorage2Service . set ( WorkbenchLayout . sashXOneWidthSettingsKey , this . sidebarWidth , StorageScope . GLOBAL ) ;
376376 } ) ) ;
377377
378378 this . _register ( this . sashY . onDidEnd ( ( ) => {
379- this . storageService . store ( WorkbenchLayout . sashYHeightSettingsKey , this . panelHeight , StorageScope . GLOBAL ) ;
379+ this . nextStorage2Service . set ( WorkbenchLayout . sashYHeightSettingsKey , this . panelHeight , StorageScope . GLOBAL ) ;
380380 } ) ) ;
381381
382382 this . _register ( this . sashXTwo . onDidEnd ( ( ) => {
383- this . storageService . store ( WorkbenchLayout . sashXTwoWidthSettingsKey , this . panelWidth , StorageScope . GLOBAL ) ;
383+ this . nextStorage2Service . set ( WorkbenchLayout . sashXTwoWidthSettingsKey , this . panelWidth , StorageScope . GLOBAL ) ;
384384 } ) ) ;
385385
386386 this . _register ( this . sashY . onDidReset ( ( ) => {
387387 this . panelHeight = this . sidebarHeight * DEFAULT_PANEL_SIZE_COEFFICIENT ;
388- this . storageService . store ( WorkbenchLayout . sashYHeightSettingsKey , this . panelHeight , StorageScope . GLOBAL ) ;
388+ this . nextStorage2Service . set ( WorkbenchLayout . sashYHeightSettingsKey , this . panelHeight , StorageScope . GLOBAL ) ;
389+
389390 this . layout ( ) ;
390391 } ) ) ;
391392
392393 this . _register ( this . sashXOne . onDidReset ( ( ) => {
393394 let activeViewlet = this . viewletService . getActiveViewlet ( ) ;
394395 let optimalWidth = activeViewlet && activeViewlet . getOptimalWidth ( ) ;
395396 this . sidebarWidth = Math . max ( optimalWidth , DEFAULT_SIDEBAR_PART_WIDTH ) ;
396- this . storageService . store ( WorkbenchLayout . sashXOneWidthSettingsKey , this . sidebarWidth , StorageScope . GLOBAL ) ;
397+ this . nextStorage2Service . set ( WorkbenchLayout . sashXOneWidthSettingsKey , this . sidebarWidth , StorageScope . GLOBAL ) ;
398+
397399 this . partService . setSideBarHidden ( false ) . then ( ( ) => this . layout ( ) ) ;
398400 } ) ) ;
399401
400402 this . _register ( this . sashXTwo . onDidReset ( ( ) => {
401403 this . panelWidth = ( this . workbenchSize . width - this . sidebarWidth - this . activitybarWidth ) * DEFAULT_PANEL_SIZE_COEFFICIENT ;
402- this . storageService . store ( WorkbenchLayout . sashXTwoWidthSettingsKey , this . panelWidth , StorageScope . GLOBAL ) ;
404+ this . nextStorage2Service . set ( WorkbenchLayout . sashXTwoWidthSettingsKey , this . panelWidth , StorageScope . GLOBAL ) ;
405+
403406 this . layout ( ) ;
404407 } ) ) ;
405408 }
@@ -472,7 +475,9 @@ export class WorkbenchLayout extends Disposable implements IVerticalSashLayoutPr
472475 this . panelSizeBeforeMaximized = panelWidth ;
473476 }
474477 }
475- this . storageService . store ( WorkbenchLayout . panelSizeBeforeMaximizedKey , this . panelSizeBeforeMaximized , StorageScope . GLOBAL ) ;
478+
479+ this . nextStorage2Service . set ( WorkbenchLayout . panelSizeBeforeMaximizedKey , this . panelSizeBeforeMaximized , StorageScope . GLOBAL ) ;
480+
476481 const panelDimension = new Dimension ( panelWidth , panelHeight ) ;
477482
478483 // Editor
@@ -527,16 +532,16 @@ export class WorkbenchLayout extends Disposable implements IVerticalSashLayoutPr
527532
528533 if ( ! isSidebarHidden ) {
529534 this . sidebarWidth = sidebarSize . width ;
530- this . storageService . store ( WorkbenchLayout . sashXOneWidthSettingsKey , this . sidebarWidth , StorageScope . GLOBAL ) ;
535+ this . nextStorage2Service . set ( WorkbenchLayout . sashXOneWidthSettingsKey , this . sidebarWidth , StorageScope . GLOBAL ) ;
531536 }
532537
533538 if ( ! isPanelHidden ) {
534539 if ( panelPosition === Position . BOTTOM ) {
535540 this . panelHeight = panelDimension . height ;
536- this . storageService . store ( WorkbenchLayout . sashYHeightSettingsKey , this . panelHeight , StorageScope . GLOBAL ) ;
541+ this . nextStorage2Service . set ( WorkbenchLayout . sashYHeightSettingsKey , this . panelHeight , StorageScope . GLOBAL ) ;
537542 } else {
538543 this . panelWidth = panelDimension . width ;
539- this . storageService . store ( WorkbenchLayout . sashXTwoWidthSettingsKey , this . panelWidth , StorageScope . GLOBAL ) ;
544+ this . nextStorage2Service . set ( WorkbenchLayout . sashXTwoWidthSettingsKey , this . panelWidth , StorageScope . GLOBAL ) ;
540545 }
541546 }
542547
0 commit comments