mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-20 02:18:01 +00:00
fixed touchbar activity indicators
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import * as glasstron from 'glasstron'
|
||||
|
||||
import { Subject, Observable, debounceTime } from 'rxjs'
|
||||
import { BrowserWindow, app, ipcMain, Rectangle, Menu, screen, BrowserWindowConstructorOptions, TouchBar } from 'electron'
|
||||
import { BrowserWindow, app, ipcMain, Rectangle, Menu, screen, BrowserWindowConstructorOptions, TouchBar, nativeImage } from 'electron'
|
||||
import ElectronConfig = require('electron-config')
|
||||
import * as os from 'os'
|
||||
import * as path from 'path'
|
||||
@@ -28,6 +28,8 @@ abstract class GlasstronWindow extends BrowserWindow {
|
||||
|
||||
const macOSVibrancyType = process.platform === 'darwin' ? compareVersions.compare(macOSRelease().version, '10.14', '>=') ? 'fullscreen-ui' : 'dark' : null
|
||||
|
||||
const activityIcon = nativeImage.createFromPath(`${app.getAppPath()}/assets/activity.png`)
|
||||
|
||||
export class Window {
|
||||
ready: Promise<void>
|
||||
private visible = new Subject<boolean>()
|
||||
@@ -367,7 +369,10 @@ export class Window {
|
||||
})
|
||||
|
||||
ipcMain.on('window-set-touch-bar', (_event, segments, selectedIndex) => {
|
||||
this.touchBarControl.segments = segments
|
||||
this.touchBarControl.segments = segments.map(s => ({
|
||||
label: s.label,
|
||||
icon: s.hasActivity ? activityIcon : undefined,
|
||||
})
|
||||
this.touchBarControl.selectedIndex = selectedIndex
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user