From 1450e0436f31b038ffab4e7ab777a5b689873458 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sun, 16 Apr 2023 18:03:10 +0200 Subject: [PATCH] include the default color scheme in the list --- tabby-terminal/src/colorSchemes.ts | 35 ++++++++++++++++++++++++++++++ tabby-terminal/src/config.ts | 24 ++------------------ tabby-terminal/src/index.ts | 2 ++ 3 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 tabby-terminal/src/colorSchemes.ts diff --git a/tabby-terminal/src/colorSchemes.ts b/tabby-terminal/src/colorSchemes.ts new file mode 100644 index 00000000..22b799c5 --- /dev/null +++ b/tabby-terminal/src/colorSchemes.ts @@ -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 { + return [DefaultColorSchemes.defaultColorScheme] + } +} diff --git a/tabby-terminal/src/config.ts b/tabby-terminal/src/config.ts index 8c4276b0..25a75317 100644 --- a/tabby-terminal/src/config.ts +++ b/tabby-terminal/src/config.ts @@ -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, diff --git a/tabby-terminal/src/index.ts b/tabby-terminal/src/index.ts index 01405dbb..f41b5007 100644 --- a/tabby-terminal/src/index.ts +++ b/tabby-terminal/src/index.ts @@ -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,