Skip to content

Commit

Permalink
always apply zoom fast before watcher kicks in
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Oct 7, 2016
1 parent 59e5346 commit 39c9f26
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/vs/workbench/electron-browser/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,17 @@ export abstract class BaseZoomAction extends Action {
target = ConfigurationTarget.WORKSPACE;
}

this.configurationEditingService.writeConfiguration(target, { key: BaseZoomAction.SETTING_KEY, value: level }).done(null, error => {

// Fallback to apply on window
const applyZoom = (error?: Error) => {
webFrame.setZoomLevel(level);
browser.setZoomLevel(level); // Ensure others can listen to zoom level changes

// Inform user
this.messageService.show(Severity.Error, error);
});
if (error) {
this.messageService.show(Severity.Error, error);
}
};

this.configurationEditingService.writeConfiguration(target, { key: BaseZoomAction.SETTING_KEY, value: level }).done(() => applyZoom(), error => applyZoom(error));
}
}

Expand Down

0 comments on commit 39c9f26

Please sign in to comment.