Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Tabby
提交
f5f88d3d
T
Tabby
项目概览
后端镜像
/
Tabby
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Tabby
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
f5f88d3d
编写于
8月 16, 2021
作者:
E
Eugene Pankov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed touchbar activity indicators
上级
64955bfc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
14 deletion
+10
-14
app/lib/window.ts
app/lib/window.ts
+7
-2
tabby-electron/src/services/electron.service.ts
tabby-electron/src/services/electron.service.ts
+1
-3
tabby-electron/src/services/touchbar.service.ts
tabby-electron/src/services/touchbar.service.ts
+2
-9
未找到文件。
app/lib/window.ts
浏览文件 @
f5f88d3d
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
})
...
...
tabby-electron/src/services/electron.service.ts
浏览文件 @
f5f88d3d
import
{
Injectable
}
from
'
@angular/core
'
import
{
App
,
IpcRenderer
,
Shell
,
Dialog
,
Clipboard
,
GlobalShortcut
,
Screen
,
Remote
,
AutoUpdater
,
TouchBar
,
BrowserWindow
,
Menu
,
MenuItem
,
NativeImage
,
PowerSaveBlocker
}
from
'
electron
'
import
{
App
,
IpcRenderer
,
Shell
,
Dialog
,
Clipboard
,
GlobalShortcut
,
Screen
,
Remote
,
AutoUpdater
,
TouchBar
,
BrowserWindow
,
Menu
,
MenuItem
,
PowerSaveBlocker
}
from
'
electron
'
import
*
as
remote
from
'
@electron/remote
'
export
interface
MessageBoxResponse
{
...
...
@@ -15,7 +15,6 @@ export class ElectronService {
dialog
:
Dialog
clipboard
:
Clipboard
globalShortcut
:
GlobalShortcut
nativeImage
:
typeof
NativeImage
screen
:
Screen
remote
:
Remote
process
:
any
...
...
@@ -38,7 +37,6 @@ export class ElectronService {
this
.
screen
=
remote
.
screen
this
.
dialog
=
remote
.
dialog
this
.
globalShortcut
=
remote
.
globalShortcut
this
.
nativeImage
=
remote
.
nativeImage
this
.
autoUpdater
=
remote
.
autoUpdater
this
.
powerSaveBlocker
=
remote
.
powerSaveBlocker
this
.
TouchBar
=
remote
.
TouchBar
...
...
tabby-electron/src/services/touchbar.service.ts
浏览文件 @
f5f88d3d
import
{
ipcRenderer
,
NativeImage
}
from
'
electron
'
import
{
ipcRenderer
}
from
'
electron
'
import
{
Injectable
,
NgZone
}
from
'
@angular/core
'
import
{
AppService
,
HostAppService
,
Platform
}
from
'
tabby-core
'
import
{
ElectronService
}
from
'
../services/electron.service
'
/** @hidden */
@
Injectable
({
providedIn
:
'
root
'
})
export
class
TouchbarService
{
private
activityIcon
:
NativeImage
private
constructor
(
private
app
:
AppService
,
private
hostApp
:
HostAppService
,
private
electron
:
ElectronService
,
private
zone
:
NgZone
,
)
{
if
(
this
.
hostApp
.
platform
!==
Platform
.
macOS
)
{
...
...
@@ -20,9 +16,6 @@ export class TouchbarService {
app
.
tabsChanged$
.
subscribe
(()
=>
this
.
update
())
app
.
activeTabChange$
.
subscribe
(()
=>
this
.
update
())
const
activityIconPath
=
`
${
electron
.
app
.
getAppPath
()}
/assets/activity.png`
this
.
activityIcon
=
this
.
electron
.
nativeImage
.
createFromPath
(
activityIconPath
)
app
.
tabOpened$
.
subscribe
(
tab
=>
{
tab
.
titleChange$
.
subscribe
(()
=>
this
.
update
())
tab
.
activity$
.
subscribe
(()
=>
this
.
update
())
...
...
@@ -40,7 +33,7 @@ export class TouchbarService {
const
tabSegments
=
this
.
app
.
tabs
.
map
(
tab
=>
({
label
:
this
.
shortenTitle
(
tab
.
title
),
icon
:
this
.
app
.
activeTab
!==
tab
&&
tab
.
hasActivity
?
this
.
activityIcon
:
undefined
,
hasActivity
:
this
.
app
.
activeTab
!==
tab
&&
tab
.
hasActivity
,
}))
ipcRenderer
.
send
(
'
window-set-touch-bar
'
,
tabSegments
,
this
.
app
.
activeTab
?
this
.
app
.
tabs
.
indexOf
(
this
.
app
.
activeTab
)
:
undefined
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录