mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-24 21:40:06 +00:00
.
This commit is contained in:
parent
e6310a17f8
commit
d909c4a791
@ -13,3 +13,4 @@ export { ElectronService } from '../services/electron.service'
|
|||||||
export { Logger, LogService } from '../services/log.service'
|
export { Logger, LogService } from '../services/log.service'
|
||||||
export { HotkeysService } from '../services/hotkeys.service'
|
export { HotkeysService } from '../services/hotkeys.service'
|
||||||
export { HostAppService, Platform } from '../services/hostApp.service'
|
export { HostAppService, Platform } from '../services/hostApp.service'
|
||||||
|
export { ThemesService } from '../services/themes.service'
|
||||||
|
@ -21,6 +21,10 @@ export class ThemesService {
|
|||||||
return this.themes.find(x => x.name === name)
|
return this.themes.find(x => x.name === name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
findCurrentTheme (): Theme {
|
||||||
|
return this.findTheme(this.config.store.appearance.theme) || this.findTheme('Standard')
|
||||||
|
}
|
||||||
|
|
||||||
applyTheme (theme: Theme): void {
|
applyTheme (theme: Theme): void {
|
||||||
if (!this.styleElement) {
|
if (!this.styleElement) {
|
||||||
this.styleElement = document.createElement('style')
|
this.styleElement = document.createElement('style')
|
||||||
@ -31,10 +35,6 @@ export class ThemesService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
applyCurrentTheme (): void {
|
applyCurrentTheme (): void {
|
||||||
let theme = this.findTheme(this.config.store.appearance.theme)
|
this.applyTheme(this.findCurrentTheme())
|
||||||
if (!theme) {
|
|
||||||
theme = this.findTheme('Standard')
|
|
||||||
}
|
|
||||||
this.applyTheme(theme)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { BehaviorSubject, ReplaySubject, Subject, Subscription } from 'rxjs'
|
import { BehaviorSubject, ReplaySubject, Subject, Subscription } from 'rxjs'
|
||||||
import { Component, NgZone, Inject, ViewChild, HostBinding, Input } from '@angular/core'
|
import { Component, NgZone, Inject, ViewChild, HostBinding, Input } from '@angular/core'
|
||||||
import { AppService, ConfigService, BaseTabComponent } from 'terminus-core'
|
import { AppService, ConfigService, BaseTabComponent, ThemesService } from 'terminus-core'
|
||||||
|
|
||||||
import { Session } from '../services/sessions.service'
|
import { Session } from '../services/sessions.service'
|
||||||
|
|
||||||
@ -32,6 +32,7 @@ export class TerminalTabComponent extends BaseTabComponent {
|
|||||||
constructor(
|
constructor(
|
||||||
private zone: NgZone,
|
private zone: NgZone,
|
||||||
private app: AppService,
|
private app: AppService,
|
||||||
|
private themes: ThemesService,
|
||||||
public config: ConfigService,
|
public config: ConfigService,
|
||||||
@Inject(TerminalDecorator) private decorators: TerminalDecorator[],
|
@Inject(TerminalDecorator) private decorators: TerminalDecorator[],
|
||||||
) {
|
) {
|
||||||
@ -209,7 +210,7 @@ export class TerminalTabComponent extends BaseTabComponent {
|
|||||||
} else {
|
} else {
|
||||||
this.backgroundColor = null
|
this.backgroundColor = null
|
||||||
// hterm can't parse "transparent"
|
// hterm can't parse "transparent"
|
||||||
preferenceManager.set('background-color', 'rgba(0,0,0,0)')
|
preferenceManager.set('background-color', themes.findCurrentTheme().terminalBackground)
|
||||||
}
|
}
|
||||||
if (config.terminal.colorScheme.colors) {
|
if (config.terminal.colorScheme.colors) {
|
||||||
preferenceManager.set('color-palette-overrides', config.terminal.colorScheme.colors)
|
preferenceManager.set('color-palette-overrides', config.terminal.colorScheme.colors)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user