Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Tabby
提交
50ab4fc3
T
Tabby
项目概览
后端镜像
/
Tabby
通知
38
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,发现更多精彩内容 >>
提交
50ab4fc3
编写于
10月 31, 2018
作者:
E
Eugene Pankov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added a settings hotkey (fixes #487)
上级
4426d482
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
53 addition
and
5 deletion
+53
-5
terminus-settings/src/buttonProvider.ts
terminus-settings/src/buttonProvider.ts
+8
-1
terminus-settings/src/config.ts
terminus-settings/src/config.ts
+22
-0
terminus-settings/src/hotkeys.ts
terminus-settings/src/hotkeys.ts
+16
-0
terminus-settings/src/index.ts
terminus-settings/src/index.ts
+7
-4
未找到文件。
terminus-settings/src/buttonProvider.ts
浏览文件 @
50ab4fc3
import
{
Injectable
}
from
'
@angular/core
'
import
{
DomSanitizer
}
from
'
@angular/platform-browser
'
import
{
ToolbarButtonProvider
,
IToolbarButton
,
AppService
,
HostAppService
}
from
'
terminus-core
'
import
{
ToolbarButtonProvider
,
IToolbarButton
,
AppService
,
HostAppService
,
HotkeysService
}
from
'
terminus-core
'
import
{
SettingsTabComponent
}
from
'
./components/settingsTab.component
'
...
...
@@ -8,11 +8,18 @@ import { SettingsTabComponent } from './components/settingsTab.component'
export
class
ButtonProvider
extends
ToolbarButtonProvider
{
constructor
(
hostApp
:
HostAppService
,
hotkeys
:
HotkeysService
,
private
app
:
AppService
,
private
domSanitizer
:
DomSanitizer
,
)
{
super
()
hostApp
.
preferencesMenu$
.
subscribe
(()
=>
this
.
open
())
hotkeys
.
matchedHotkey
.
subscribe
(
async
(
hotkey
)
=>
{
if
(
hotkey
===
'
settings
'
)
{
this
.
open
()
}
})
}
provide
():
IToolbarButton
[]
{
...
...
terminus-settings/src/config.ts
0 → 100644
浏览文件 @
50ab4fc3
import
{
ConfigProvider
,
Platform
}
from
'
terminus-core
'
export
class
SettingsConfigProvider
extends
ConfigProvider
{
defaults
=
{
}
platformDefaults
=
{
[
Platform
.
macOS
]:
{
hotkeys
:
{
settings
:
[
'
⌘-,
'
],
}
},
[
Platform
.
Windows
]:
{
hotkeys
:
{
settings
:
[
'
Ctrl-,
'
]
}
},
[
Platform
.
Linux
]:
{
hotkeys
:
{
settings
:
[
'
Ctrl-,
'
]
}
},
}
}
terminus-settings/src/hotkeys.ts
0 → 100644
浏览文件 @
50ab4fc3
import
{
Injectable
}
from
'
@angular/core
'
import
{
IHotkeyDescription
,
HotkeyProvider
}
from
'
terminus-core
'
@
Injectable
()
export
class
SettingsHotkeyProvider
extends
HotkeyProvider
{
hotkeys
:
IHotkeyDescription
[]
=
[
{
id
:
'
settings
'
,
name
:
'
Open Settings
'
,
},
]
async
provide
():
Promise
<
IHotkeyDescription
[]
>
{
return
this
.
hotkeys
}
}
terminus-settings/src/index.ts
浏览文件 @
50ab4fc3
...
...
@@ -4,7 +4,7 @@ import { FormsModule } from '@angular/forms'
import
{
NgbModule
}
from
'
@ng-bootstrap/ng-bootstrap
'
import
{
NgPipesModule
}
from
'
ngx-pipes
'
import
{
ToolbarButtonProvider
,
TabRecoveryProvider
}
from
'
terminus-core
'
import
{
ToolbarButtonProvider
,
TabRecoveryProvider
,
HotkeyProvider
,
ConfigProvider
}
from
'
terminus-core
'
import
TerminusCorePlugin
from
'
terminus-core
'
import
{
HotkeyInputModalComponent
}
from
'
./components/hotkeyInputModal.component
'
...
...
@@ -14,6 +14,8 @@ import { SettingsTabBodyComponent } from './components/settingsTabBody.component
import
{
ButtonProvider
}
from
'
./buttonProvider
'
import
{
RecoveryProvider
}
from
'
./recoveryProvider
'
import
{
SettingsHotkeyProvider
}
from
'
./hotkeys
'
import
{
SettingsConfigProvider
}
from
'
./config
'
@
NgModule
({
imports
:
[
...
...
@@ -25,7 +27,9 @@ import { RecoveryProvider } from './recoveryProvider'
],
providers
:
[
{
provide
:
ToolbarButtonProvider
,
useClass
:
ButtonProvider
,
multi
:
true
},
{
provide
:
TabRecoveryProvider
,
useClass
:
RecoveryProvider
,
multi
:
true
}
{
provide
:
TabRecoveryProvider
,
useClass
:
RecoveryProvider
,
multi
:
true
},
{
provide
:
ConfigProvider
,
useClass
:
SettingsConfigProvider
,
multi
:
true
},
{
provide
:
HotkeyProvider
,
useClass
:
SettingsHotkeyProvider
,
multi
:
true
},
],
entryComponents
:
[
HotkeyInputModalComponent
,
...
...
@@ -38,8 +42,7 @@ import { RecoveryProvider } from './recoveryProvider'
SettingsTabBodyComponent
,
],
})
export
default
class
SettingsModule
{
}
export
default
class
SettingsModule
{
}
export
*
from
'
./api
'
export
{
SettingsTabComponent
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录