@@ -9,17 +9,50 @@ var OverviewManager = class {
99 constructor ( settings , keybindins ) {
1010 this . _settings = settings ;
1111 this . _keybindins = keybindins ;
12- this . _overrideProperties = { } ;
12+
1313 this . _thumbnailsBoxOverride = new ThumbnailsBox . ThumbnailsBox ( this . _settings , this . _keybindins ) ;
1414 this . _workspacesViewOverride = new WorkspacesView . WorkspacesView ( this . _settings , this . _keybindins ) ;
1515 this . _controlsManagerLayoutOverride = new ControlsManagerLayout . ControlsManagerLayout ( this . _settings , this . _keybindins ) ;
1616 this . _secondaryMonitorDisplayOverride = new SecondaryMonitorDisplay . SecondaryMonitorDisplay ( this . _settings , this . _keybindins ) ;
17+
18+ this . _handleShowOverviewGridChanged ( ) ;
19+ this . _connectSettings ( ) ;
20+ }
21+
22+ _connectSettings ( ) {
23+ this . settingsHandlerShowOverviewGrid = this . _settings . connect (
24+ 'changed::show-overview-grid' ,
25+ this . _handleShowOverviewGridChanged . bind ( this )
26+ ) ;
27+ }
28+
29+ _disconnectSettings ( ) {
30+ this . _settings . disconnect ( this . settingsHandlerShowOverviewGrid ) ;
31+ }
32+
33+ _handleShowOverviewGridChanged ( ) {
34+ this . showOvervieGrid = this . _settings . get_boolean ( 'show-overview-grid' ) ;
35+ if ( this . showOvervieGrid )
36+ this . override ( ) ;
37+ else
38+ this . restore ( ) ;
39+ }
40+
41+ override ( ) {
42+ this . _thumbnailsBoxOverride . overrideOriginalProperties ( ) ;
43+ this . _workspacesViewOverride . overrideOriginalProperties ( ) ;
44+ this . _controlsManagerLayoutOverride . overrideOriginalProperties ( ) ;
45+ this . _secondaryMonitorDisplayOverride . overrideOriginalProperties ( ) ;
46+ }
47+
48+ restore ( ) {
49+ this . _thumbnailsBoxOverride . restoreOriginalProperties ( ) ;
50+ this . _workspacesViewOverride . restoreOriginalProperties ( ) ;
51+ this . _controlsManagerLayoutOverride . restoreOriginalProperties ( ) ;
52+ this . _secondaryMonitorDisplayOverride . restoreOriginalProperties ( ) ;
1753 }
1854
1955 destroy ( ) {
20- this . _thumbnailsBoxOverride . destroy ( ) ;
21- this . _workspacesViewOverride . destroy ( ) ;
22- this . _controlsManagerLayoutOverride . destroy ( ) ;
23- this . _secondaryMonitorDisplayOverride . destroy ( ) ;
56+ this . _disconnectSettings ( ) ;
2457 }
2558}
0 commit comments