@@ -31,7 +31,6 @@ export class InterfaceScale extends Contribution {
31
31
decrease : true ,
32
32
} ;
33
33
34
- private currentScale : InterfaceScale . ScaleSettings ;
35
34
private currentSettings : Settings ;
36
35
private updateSettingsDebounced = debounce (
37
36
async ( ) => {
@@ -45,7 +44,6 @@ export class InterfaceScale extends Contribution {
45
44
override onStart ( ) : MaybePromise < void > {
46
45
const updateCurrent = ( settings : Settings ) => {
47
46
this . currentSettings = settings ;
48
- this . currentScale = { ...settings } ;
49
47
} ;
50
48
this . settingsService . onDidChange ( ( settings ) => updateCurrent ( settings ) ) ;
51
49
this . settingsService . settings ( ) . then ( ( settings ) => updateCurrent ( settings ) ) ;
@@ -125,18 +123,13 @@ export class InterfaceScale extends Contribution {
125
123
private async updateFontSize ( mode : 'increase' | 'decrease' ) : Promise < void > {
126
124
if ( this . currentSettings . autoScaleInterface ) {
127
125
mode === 'increase'
128
- ? ( this . currentScale . interfaceScale += InterfaceScale . ZoomLevel . STEP )
129
- : ( this . currentScale . interfaceScale -= InterfaceScale . ZoomLevel . STEP ) ;
126
+ ? ( this . currentSettings . interfaceScale += InterfaceScale . ZoomLevel . STEP )
127
+ : ( this . currentSettings . interfaceScale -= InterfaceScale . ZoomLevel . STEP ) ;
130
128
} else {
131
129
mode === 'increase'
132
- ? ( this . currentScale . editorFontSize += InterfaceScale . FontSize . STEP )
133
- : ( this . currentScale . editorFontSize -= InterfaceScale . FontSize . STEP ) ;
130
+ ? ( this . currentSettings . editorFontSize += InterfaceScale . FontSize . STEP )
131
+ : ( this . currentSettings . editorFontSize -= InterfaceScale . FontSize . STEP ) ;
134
132
}
135
- this . currentSettings = {
136
- ...this . currentSettings ,
137
- editorFontSize : this . currentScale . editorFontSize ,
138
- interfaceScale : this . currentScale . interfaceScale ,
139
- } ;
140
133
let newFontScalingEnabled : InterfaceScale . FontScalingEnabled = {
141
134
increase : true ,
142
135
decrease : true ,
@@ -225,9 +218,4 @@ export namespace InterfaceScale {
225
218
increase : boolean ;
226
219
decrease : boolean ;
227
220
}
228
-
229
- export type ScaleSettings = Pick <
230
- Settings ,
231
- 'interfaceScale' | 'editorFontSize'
232
- > ;
233
221
}
0 commit comments