macOS touchbar support

This commit is contained in:
Eugene Pankov
2018-03-24 23:19:47 +01:00
parent 8f2d2cbe30
commit 5e07dd5442
11 changed files with 99 additions and 15 deletions

View File

@@ -11,6 +11,7 @@ import { DockingService } from '../services/docking.service'
import { TabRecoveryService } from '../services/tabRecovery.service'
import { ThemesService } from '../services/themes.service'
import { UpdaterService, Update } from '../services/updater.service'
import { TouchbarService } from '../services/touchbar.service'
import { SafeModeModalComponent } from './safeModeModal.component'
import { AppService, IToolbarButton, ToolbarButtonProvider } from '../api'
@@ -62,6 +63,7 @@ export class AppRootComponent {
private tabRecovery: TabRecoveryService,
private hotkeys: HotkeysService,
private updater: UpdaterService,
private touchbar: TouchbarService,
public hostApp: HostAppService,
public config: ConfigService,
public app: AppService,
@@ -121,6 +123,8 @@ export class AppRootComponent {
this.updater.check().then(update => {
this.appUpdate = update
})
this.touchbar.update()
}
onGlobalHotkey () {

View File

@@ -5,6 +5,7 @@ export abstract class BaseTabComponent {
private static lastTabID = 0
id: number
title: string
titleChange$ = new Subject<string>()
customTitle: string
scrollable: boolean
hasActivity = false
@@ -23,6 +24,13 @@ export abstract class BaseTabComponent {
})
}
setTitle (title: string) {
this.title = title]
if (!this.customTitle) {
this.titleChange$.next(title)
}
}
displayActivity (): void {
this.hasActivity = true
}

View File

@@ -69,6 +69,7 @@ export class TabHeaderComponent {
let modal = this.ngbModal.open(RenameTabModalComponent)
modal.componentInstance.value = this.tab.customTitle || this.tab.title
modal.result.then(result => {
this.tab.setTitle(result)
this.tab.customTitle = result
}).catch(() => null)
}