Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Aug 3, 2024
1 parent 3f0b78e commit 9b86ec0
Show file tree
Hide file tree
Showing 14 changed files with 1,263 additions and 1,247 deletions.
15 changes: 8 additions & 7 deletions app/lib/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ import { compare as compareVersions } from 'compare-versions'
import type { Application } from './app'
import { parseArgs } from './cli'

let DwmEnableBlurBehindWindow: any = null
if (process.platform === 'win32') {
DwmEnableBlurBehindWindow = require('@tabby-gang/windows-blurbehind').DwmEnableBlurBehindWindow
}

export interface WindowOptions {
hidden?: boolean
}
Expand Down Expand Up @@ -177,6 +172,10 @@ export class Window {
this.window.webContents.send('host:became-main-window')
}

setMaterial (material: string): void {
this.window.setBackgroundMaterial(material)
}

setVibrancy (enabled: boolean, type?: string, userRequested?: boolean): void {
if (userRequested ?? true) {
this.lastVibrancy = { enabled, type }
Expand All @@ -190,8 +189,6 @@ export class Window {
} catch (error) {
console.error('Failed to set window blur', error)
}
} else {
DwmEnableBlurBehindWindow(this.window.getNativeWindowHandle(), enabled)
}
} else if (process.platform === 'linux') {
this.window.setBackgroundColor(enabled ? '#00000000' : '#131d27')
Expand Down Expand Up @@ -373,6 +370,10 @@ export class Window {
this.setVibrancy(enabled, type)
})

this.on('window-set-material', (_, material) => {
this.setMaterial(material)
})

this.on('window-set-window-controls-color', (_, theme) => {
if (process.platform === 'win32') {
const symbolColor: string = theme.foreground
Expand Down
1 change: 0 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"yargs": "^17.7.2"
},
"optionalDependencies": {
"@tabby-gang/windows-blurbehind": "^3.0.0",
"macos-native-processlist": "^2.1.0",
"patch-package": "^6.5.0",
"serialport": "11.0.1",
Expand Down
1 change: 0 additions & 1 deletion app/webpack.config.main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const config = {
'source-map-support': 'commonjs source-map-support',
'windows-swca': 'commonjs windows-swca',
'windows-native-registry': 'commonjs windows-native-registry',
'@tabby-gang/windows-blurbehind': 'commonjs @tabby-gang/windows-blurbehind',
'yargs/yargs': 'commonjs yargs/yargs',
},
plugins: [
Expand Down
8 changes: 4 additions & 4 deletions tabby-community-color-schemes/yarn.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


1 change: 1 addition & 0 deletions tabby-core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const WIN_BUILD_CONPTY_SUPPORTED = 17692
export const WIN_BUILD_CONPTY_STABLE = 18309
export const WIN_BUILD_WSL_EXE_DISTRO_FLAG = 17763
export const WIN_BUILD_FLUENT_BG_SUPPORTED = 17063
export const WIN_BUILD_WINDOW_MATERIAL_SUPPORTED = 22621

export function getWindows10Build (): number|undefined {
return process.platform === 'win32' && parseFloat(os.release()) >= 10 ? parseInt(os.release().split('.')[2]) : undefined
Expand Down
18 changes: 15 additions & 3 deletions tabby-electron/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NgModule } from '@angular/core'
import { PlatformService, LogService, UpdaterService, DockingService, HostAppService, ThemesService, Platform, AppService, ConfigService, WIN_BUILD_FLUENT_BG_SUPPORTED, isWindowsBuild, HostWindowService, HotkeyProvider, ConfigProvider, FileProvider } from 'tabby-core'
import { PlatformService, LogService, UpdaterService, DockingService, HostAppService, ThemesService, Platform, AppService, ConfigService, WIN_BUILD_FLUENT_BG_SUPPORTED, isWindowsBuild, HostWindowService, HotkeyProvider, ConfigProvider, FileProvider, WIN_BUILD_WINDOW_MATERIAL_SUPPORTED } from 'tabby-core'
import { TerminalColorSchemeProvider } from 'tabby-terminal'
import { SFTPContextMenuItemProvider, SSHProfileImporter, AutoPrivateKeyLocator } from 'tabby-ssh'
import { PTYInterface, ShellProvider, UACService } from 'tabby-local'
Expand Down Expand Up @@ -164,13 +164,25 @@ export default class ElectronModule {
}

private updateVibrancy () {
this.hostWindow.setOpacity(this.config.store.appearance.opacity)

if (isWindowsBuild(WIN_BUILD_WINDOW_MATERIAL_SUPPORTED)) {
this.electron.ipcRenderer.send(
'window-set-material',
this.config.store.appearance.vibrancy
? this.config.store.appearance.vibrancyType === 'fluent'
? 'mica'
: 'acrylic'
: 'none',
)
return
}

let vibrancyType = this.config.store.appearance.vibrancyType
if (this.hostApp.platform === Platform.Windows && !isWindowsBuild(WIN_BUILD_FLUENT_BG_SUPPORTED)) {
vibrancyType = null
}
this.electron.ipcRenderer.send('window-set-vibrancy', this.config.store.appearance.vibrancy, vibrancyType)

this.hostWindow.setOpacity(this.config.store.appearance.opacity)
}

private updateWindowControlsColor () {
Expand Down
4 changes: 2 additions & 2 deletions tabby-electron/src/services/hostApp.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable, NgZone, Injector } from '@angular/core'
import { isWindowsBuild, WIN_BUILD_FLUENT_BG_SUPPORTED, HostAppService, Platform, CLIHandler } from 'tabby-core'
import { isWindowsBuild, WIN_BUILD_FLUENT_BG_SUPPORTED, HostAppService, Platform, CLIHandler, WIN_BUILD_WINDOW_MATERIAL_SUPPORTED } from 'tabby-core'
import { ElectronService } from '../services/electron.service'


Expand Down Expand Up @@ -49,7 +49,7 @@ export class ElectronHostAppService extends HostAppService {
this.configChangeBroadcast.next()
}))

if (isWindowsBuild(WIN_BUILD_FLUENT_BG_SUPPORTED)) {
if (isWindowsBuild(WIN_BUILD_FLUENT_BG_SUPPORTED) && !isWindowsBuild(WIN_BUILD_WINDOW_MATERIAL_SUPPORTED)) {
electron.ipcRenderer.send('window-set-disable-vibrancy-while-dragging', true)
}
}
Expand Down
36 changes: 18 additions & 18 deletions tabby-local/yarn.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


ansi-colors@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==

dataurl@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/dataurl/-/dataurl-0.1.0.tgz#1f4734feddec05ffe445747978d86759c4b33199"
integrity sha1-H0c0/t3sBf/kRXR5eNhnWcSzMZk=

runes@^0.4.2:
version "0.4.3"
resolved "https://registry.yarnpkg.com/runes/-/runes-0.4.3.tgz#32f7738844bc767b65cc68171528e3373c7bb355"
integrity sha512-K6p9y4ZyL9wPzA+PMDloNQPfoDGTiFYDvdlXznyGKgD10BJpcAosvATKrExRKOrNLgD8E7Um7WGW0lxsnOuNLg==
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


ansi-colors@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==

dataurl@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/dataurl/-/dataurl-0.1.0.tgz#1f4734feddec05ffe445747978d86759c4b33199"
integrity sha1-H0c0/t3sBf/kRXR5eNhnWcSzMZk=

runes@^0.4.2:
version "0.4.3"
resolved "https://registry.yarnpkg.com/runes/-/runes-0.4.3.tgz#32f7738844bc767b65cc68171528e3373c7bb355"
integrity sha512-K6p9y4ZyL9wPzA+PMDloNQPfoDGTiFYDvdlXznyGKgD10BJpcAosvATKrExRKOrNLgD8E7Um7WGW0lxsnOuNLg==
26 changes: 13 additions & 13 deletions tabby-serial/yarn.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@types/node@14.14.14":
version "14.14.14"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.14.tgz#f7fd5f3cc8521301119f63910f0fb965c7d761ae"
integrity sha512-UHnOPWVWV1z+VV8k6L1HhG7UbGBgIdghqF3l9Ny9ApPghbjICXkUJSd/b9gOgQfjM1r+37cipdw/HJ3F6ICEnQ==

ansi-colors@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@types/node@14.14.14":
version "14.14.14"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.14.tgz#f7fd5f3cc8521301119f63910f0fb965c7d761ae"
integrity sha512-UHnOPWVWV1z+VV8k6L1HhG7UbGBgIdghqF3l9Ny9ApPghbjICXkUJSd/b9gOgQfjM1r+37cipdw/HJ3F6ICEnQ==

ansi-colors@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==
7 changes: 4 additions & 3 deletions tabby-settings/src/components/windowSettingsTab.component.pug
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ h3.mb-3(translate) Window

.form-line(*ngIf='platform.supportsWindowControls')
.header
.title(*ngIf='hostApp.platform !== Platform.macOS', translate) Acrylic background
.title(*ngIf='hostApp.platform !== Platform.macOS', translate) Blurred background
.title(*ngIf='hostApp.platform === Platform.macOS', translate) Vibrancy
.description(translate) Gives the window a blurred transparent background
.description(*ngIf='hostApp.platform !== Platform.Linux', translate) Gives the window a blurred transparent background
.description(*ngIf='hostApp.platform === Platform.Linux', translate) Enables transparent windows background under KWM

toggle(
[(ngModel)]='config.store.appearance.vibrancy',
(ngModelChange)='saveConfiguration()'
)

.form-line(*ngIf='config.store.appearance.vibrancy && isFluentVibrancySupported && config.store.hacks.enableFluentBackground')
.form-line(*ngIf='config.store.appearance.vibrancy && (isWindowMaterialSupported || (isFluentVibrancySupported && config.store.hacks.enableFluentBackground))')
.header
.title(translate) Background type
.btn-group
Expand Down
3 changes: 3 additions & 0 deletions tabby-settings/src/components/windowSettingsTab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
BaseComponent,
Screen,
PlatformService,
WIN_BUILD_WINDOW_MATERIAL_SUPPORTED,
} from 'tabby-core'


Expand All @@ -24,6 +25,7 @@ export class WindowSettingsTabComponent extends BaseComponent {
screens: Screen[]
Platform = Platform
isFluentVibrancySupported = false
isWindowMaterialSupported = false

@HostBinding('class.content-box') true

Expand All @@ -48,6 +50,7 @@ export class WindowSettingsTabComponent extends BaseComponent {
}

this.isFluentVibrancySupported = isWindowsBuild(WIN_BUILD_FLUENT_BG_SUPPORTED)
this.isWindowMaterialSupported = isWindowsBuild(WIN_BUILD_WINDOW_MATERIAL_SUPPORTED)
}

@debounce(500)
Expand Down
26 changes: 13 additions & 13 deletions tabby-telnet/yarn.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@types/node@14.14.31":
version "14.14.31"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.31.tgz#72286bd33d137aa0d152d47ec7c1762563d34055"
integrity sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==

ansi-colors@^4.1.1:
version "4.1.3"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b"
integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@types/node@14.14.31":
version "14.14.31"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.31.tgz#72286bd33d137aa0d152d47ec7c1762563d34055"
integrity sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==

ansi-colors@^4.1.1:
version "4.1.3"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b"
integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==
Loading

0 comments on commit 9b86ec0

Please sign in to comment.