(
private config: ConfigService,
private hostApp: ElectronHostAppService,
private electron: ElectronService,
private hostWindow: ElectronHostWindow,
touchbar: TouchbarService,
docking: DockingService,
themeService: ThemesService,
app: AppService,
dockMenu: DockMenuService,
)
| 87 | }) |
| 88 | export default class ElectronModule { |
| 89 | constructor ( |
| 90 | private config: ConfigService, |
| 91 | private hostApp: ElectronHostAppService, |
| 92 | private electron: ElectronService, |
| 93 | private hostWindow: ElectronHostWindow, |
| 94 | touchbar: TouchbarService, |
| 95 | docking: DockingService, |
| 96 | themeService: ThemesService, |
| 97 | app: AppService, |
| 98 | dockMenu: DockMenuService, |
| 99 | ) { |
| 100 | config.ready$.toPromise().then(() => { |
| 101 | touchbar.update() |
| 102 | docking.dock() |
| 103 | hostWindow.windowShown$.subscribe(() => { |
| 104 | docking.dock() |
| 105 | }) |
| 106 | this.registerGlobalHotkey() |
| 107 | this.updateVibrancy() |
| 108 | this.updateWindowControlsColor() |
| 109 | }) |
| 110 | |
| 111 | config.changed$.subscribe(() => { |
| 112 | this.registerGlobalHotkey() |
| 113 | }) |
| 114 | |
| 115 | themeService.themeChanged$.subscribe(theme => { |
| 116 | if (hostApp.platform === Platform.macOS) { |
| 117 | hostWindow.setTrafficLightPosition( |
| 118 | theme.macOSWindowButtonsInsetX ?? 14, |
| 119 | theme.macOSWindowButtonsInsetY ?? 11, |
| 120 | ) |
| 121 | } |
| 122 | }) |
| 123 | |
| 124 | let lastProgress: number|null = null |
| 125 | app.tabOpened$.subscribe(tab => { |
| 126 | tab.progress$.pipe(auditTime(250)).subscribe(progress => { |
| 127 | if (lastProgress === progress) { |
| 128 | return |
| 129 | } |
| 130 | if (progress !== null) { |
| 131 | hostWindow.setProgressBar(progress / 100.0) |
| 132 | } else { |
| 133 | hostWindow.setProgressBar(-1) |
| 134 | } |
| 135 | lastProgress = progress |
| 136 | }) |
| 137 | }) |
| 138 | |
| 139 | config.changed$.subscribe(() => { |
| 140 | this.updateVibrancy() |
| 141 | this.updateDarkMode() |
| 142 | }) |
| 143 | |
| 144 | config.changed$.subscribe(() => this.updateWindowControlsColor()) |
| 145 | |
| 146 | config.ready$.toPromise().then(() => { |
nothing calls this directly
no test coverage detected