mirror of
https://github.com/Eugeny/tabby.git
synced 2026-08-24 02:34:19 -05:00
Fix frosted glass persistence (#11083)
This commit is contained in:
@@ -40,7 +40,7 @@ h3.mb-3(translate) Window
|
||||
|
||||
toggle(
|
||||
[(ngModel)]='config.store.appearance.vibrancy',
|
||||
(ngModelChange)='saveConfiguration()'
|
||||
(ngModelChange)='config.save()'
|
||||
)
|
||||
|
||||
.form-line(*ngIf='config.store.appearance.vibrancy && isFluentVibrancySupported && config.store.hacks.enableFluentBackground')
|
||||
@@ -51,7 +51,7 @@ h3.mb-3(translate) Window
|
||||
type='radio',
|
||||
name='vibracy',
|
||||
[(ngModel)]='config.store.appearance.vibrancyType',
|
||||
(ngModelChange)='saveConfiguration()',
|
||||
(ngModelChange)='config.save()',
|
||||
id='vibrancyTypeBlur',
|
||||
[value]='"blur"'
|
||||
)
|
||||
@@ -63,7 +63,7 @@ h3.mb-3(translate) Window
|
||||
type='radio',
|
||||
name='vibracy',
|
||||
[(ngModel)]='config.store.appearance.vibrancyType',
|
||||
(ngModelChange)='saveConfiguration()',
|
||||
(ngModelChange)='config.save()',
|
||||
id='vibrancyTypeFluent',
|
||||
[value]='"fluent"'
|
||||
)
|
||||
|
||||
@@ -13,7 +13,7 @@ import { SerializeAddon } from '@xterm/addon-serialize'
|
||||
import { ImageAddon } from '@xterm/addon-image'
|
||||
import { CanvasAddon } from '@xterm/addon-canvas'
|
||||
import { BaseTerminalProfile, TerminalColorScheme } from '../api/interfaces'
|
||||
import { getTerminalBackgroundColor } from '../helpers'
|
||||
import { getXtermBackgroundColor } from '../helpers'
|
||||
import './xterm.css'
|
||||
|
||||
const COLOR_NAMES = [
|
||||
@@ -462,7 +462,7 @@ export class XTermFrontend extends Frontend {
|
||||
foreground: scheme.foreground,
|
||||
selectionBackground: scheme.selection ?? '#88888888',
|
||||
selectionForeground: scheme.selectionForeground ?? undefined,
|
||||
background: getTerminalBackgroundColor(this.configService, this.themes, scheme) ?? '#00000000',
|
||||
background: getXtermBackgroundColor(this.configService, this.themes, scheme),
|
||||
cursor: scheme.cursor,
|
||||
cursorAccent: scheme.cursorAccent,
|
||||
}
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
import { TerminalColorScheme } from './api/interfaces'
|
||||
import { ConfigService, ThemesService } from 'tabby-core'
|
||||
|
||||
function getActiveTerminalTheme (
|
||||
themes: ThemesService,
|
||||
): { appTheme: ReturnType<ThemesService['findCurrentTheme']>, appColorScheme: TerminalColorScheme } {
|
||||
const appTheme = themes.findCurrentTheme()
|
||||
const appColorScheme = themes._getActiveColorScheme() as TerminalColorScheme
|
||||
|
||||
return { appTheme, appColorScheme }
|
||||
}
|
||||
|
||||
export function getTerminalBackgroundColor (
|
||||
config: ConfigService,
|
||||
themes: ThemesService,
|
||||
scheme: TerminalColorScheme | null,
|
||||
): string|null {
|
||||
const appTheme = themes.findCurrentTheme()
|
||||
const appColorScheme = themes._getActiveColorScheme() as TerminalColorScheme
|
||||
const { appTheme, appColorScheme } = getActiveTerminalTheme(themes)
|
||||
|
||||
// Use non transparent background when:
|
||||
// - legacy theme and user choses colorScheme based BG
|
||||
@@ -19,3 +27,17 @@ export function getTerminalBackgroundColor (
|
||||
|
||||
return shouldUseCSBackground && scheme ? scheme.background : null
|
||||
}
|
||||
|
||||
export function getXtermBackgroundColor (
|
||||
config: ConfigService,
|
||||
themes: ThemesService,
|
||||
scheme: TerminalColorScheme | null,
|
||||
): string {
|
||||
const configuredBackground = getTerminalBackgroundColor(config, themes, scheme)
|
||||
if (configuredBackground) {
|
||||
return configuredBackground
|
||||
}
|
||||
|
||||
const { appTheme, appColorScheme } = getActiveTerminalTheme(themes)
|
||||
return appTheme.followsColorScheme ? appColorScheme.background : appTheme.terminalBackground
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user