include the default color scheme in the list

This commit is contained in:
Eugene Pankov 2023-04-16 18:03:10 +02:00
parent 65756a62bc
commit 1450e0436f
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
3 changed files with 39 additions and 22 deletions

View File

@ -0,0 +1,35 @@
import { Injectable } from '@angular/core'
import { TerminalColorScheme } from './api/interfaces'
import { TerminalColorSchemeProvider } from './api/colorSchemeProvider'
@Injectable({ providedIn: 'root' })
export class DefaultColorSchemes extends TerminalColorSchemeProvider {
static defaultColorScheme: TerminalColorScheme = {
name: 'Tabby Default',
foreground: '#cacaca',
background: '#171717',
cursor: '#bbbbbb',
colors: [
'#000000',
'#ff615a',
'#b1e969',
'#ebd99c',
'#5da9f6',
'#e86aff',
'#82fff7',
'#dedacf',
'#313131',
'#f58c80',
'#ddf88f',
'#eee5b2',
'#a5c7ff',
'#ddaaff',
'#b7fff9',
'#ffffff',
],
}
async getSchemes (): Promise<TerminalColorScheme[]> {
return [DefaultColorSchemes.defaultColorScheme]
}
}

View File

@ -1,4 +1,5 @@
import { ConfigProvider, Platform } from 'tabby-core'
import { DefaultColorSchemes } from './colorSchemes'
/** @hidden */
export class TerminalConfigProvider extends ConfigProvider {
@ -32,30 +33,9 @@ export class TerminalConfigProvider extends ConfigProvider {
wordSeparator: ' ()[]{}\'"',
colorScheme: {
__nonStructural: true,
name: 'Wombat',
foreground: '#cacaca',
background: '#171717',
cursor: '#bbbbbb',
colors: [
'#000000',
'#ff615a',
'#b1e969',
'#ebd99c',
'#5da9f6',
'#e86aff',
'#82fff7',
'#dedacf',
'#313131',
'#f58c80',
'#ddf88f',
'#eee5b2',
'#a5c7ff',
'#ddaaff',
'#b7fff9',
'#ffffff',
],
selection: null,
cursorAccent: null,
...DefaultColorSchemes.defaultColorScheme,
},
customColorSchemes: [],
warnOnMultilinePaste: true,

View File

@ -33,6 +33,7 @@ import { CopyPasteContextMenu, MiscContextMenu, LegacyContextMenu, ReconnectCont
import { Frontend } from './frontends/frontend'
import { XTermFrontend, XTermWebGLFrontend } from './frontends/xtermFrontend'
import { TerminalCLIHandler } from './cli'
import { DefaultColorSchemes } from './colorSchemes'
/** @hidden */
@NgModule({
@ -61,6 +62,7 @@ import { TerminalCLIHandler } from './cli'
{ provide: TabContextMenuItemProvider, useClass: ReconnectContextMenu, multi: true },
{ provide: CLIHandler, useClass: TerminalCLIHandler, multi: true },
{ provide: TerminalColorSchemeProvider, useClass: DefaultColorSchemes, multi: true },
],
declarations: [
ColorPickerComponent,