Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Tabby
提交
e6221ee4
T
Tabby
项目概览
后端镜像
/
Tabby
通知
27
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 搜索 >>
提交
e6221ee4
编写于
3月 18, 2017
作者:
E
Eugene Pankov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
.
上级
dec11b18
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
59 addition
and
17 deletion
+59
-17
app/main.js
app/main.js
+16
-1
app/src/components/app.pug
app/src/components/app.pug
+1
-1
app/src/components/app.ts
app/src/components/app.ts
+4
-1
app/src/components/settingsPane.pug
app/src/components/settingsPane.pug
+15
-0
app/src/components/settingsPane.ts
app/src/components/settingsPane.ts
+19
-10
app/src/global.less
app/src/global.less
+4
-4
未找到文件。
app/main.js
浏览文件 @
e6221ee4
const
yaml
=
require
(
'
js-yaml
'
)
const
path
=
require
(
'
path
'
)
const
fs
=
require
(
'
fs
'
)
const
Config
=
require
(
'
electron-config
'
)
const
electron
=
require
(
'
electron
'
)
const
platform
=
require
(
'
os
'
).
platform
()
...
...
@@ -95,11 +98,19 @@ start = () => {
return
}
let
configPath
=
path
.
join
(
electron
.
app
.
getPath
(
'
userData
'
),
'
config.yaml
'
)
let
configData
if
(
fs
.
existsSync
(
configPath
))
{
configData
=
yaml
.
safeLoad
(
fs
.
readFileSync
(
configPath
,
'
utf8
'
))
}
else
{
configData
=
{}
}
let
options
=
{
width
:
800
,
height
:
400
,
//icon: `${app.getAppPath()}/assets/img/icon.png`,
title
:
'
ELEMENTS Benchmark
'
,
title
:
'
Term
'
,
minWidth
:
300
,
minHeight
:
100
,
'
web-preferences
'
:
{
'
web-security
'
:
false
},
...
...
@@ -113,6 +124,10 @@ start = () => {
options
.
titleBarStyle
=
'
hidden
'
}
if
((
configData
.
appearance
||
{}).
useNativeFrame
)
{
options
.
frame
=
true
}
app
.
commandLine
.
appendSwitch
(
'
disable-http-cache
'
)
app
.
window
=
new
electron
.
BrowserWindow
(
options
)
...
...
app/src/components/app.pug
浏览文件 @
e6221ee4
.titlebar
.titlebar
(*ngIf='!config.store.appearance.useNativeFrame')
.title((dblclick)='hostApp.maximizeWindow()') Term
button.btn-minimize((click)='hostApp.minimizeWindow()')
i.fa.fa-window-minimize
...
...
app/src/components/app.ts
浏览文件 @
e6221ee4
import
{
Component
,
ElementRef
,
trigger
,
style
,
animate
,
transition
,
state
}
from
'
@angular/core
'
import
{
ToasterConfig
}
from
'
angular2-toaster
'
import
{
ElectronService
}
from
'
services/electron
'
import
{
HostAppService
}
from
'
services/hostApp
'
import
{
HotkeysService
}
from
'
services/hotkeys
'
import
{
LogService
}
from
'
services/log
'
import
{
QuitterService
}
from
'
services/quitter
'
import
{
ToasterConfig
}
from
'
angular2-toaster
'
import
{
ConfigService
}
from
'
services/config
'
import
{
Session
,
SessionsService
}
from
'
services/sessions
'
import
'
angular2-toaster/lib/toaster.css
'
...
...
@@ -62,6 +64,7 @@ export class AppComponent {
private
sessions
:
SessionsService
,
public
hostApp
:
HostAppService
,
public
hotkeys
:
HotkeysService
,
public
config
:
ConfigService
,
log
:
LogService
,
electron
:
ElectronService
,
_quitter
:
QuitterService
,
...
...
app/src/components/settingsPane.pug
浏览文件 @
e6221ee4
.restart-bar(*ngIf='restartRequested')
button.btn.btn-default.pull-right('(click)'='restartApp()') Restart
| Restart the app to apply changes
ngb-tabset(type='tabs')
ngb-tab
template(ngbTabTitle)
| General
template(ngbTabContent)
.form-group
label.form-control
input(
type='checkbox',
'[(ngModel)]'='config.store.appearance.useNativeFrame',
'(ngModelChange)'='config.save(); requestRestart()',
)
| Use native window frame
.form-group
label.control-label Font
input.form-control(
...
...
@@ -29,3 +42,5 @@ ngb-tabset(type='tabs')
th Toggle terminal window
td
hotkey-input('[(model)]'='globalHotkey')
app/src/components/settingsPane.ts
浏览文件 @
e6221ee4
...
...
@@ -15,10 +15,19 @@ const childProcessPromise = nodeRequire('child-process-promise')
styles
:
[
require
(
'
./settingsPane.less
'
)],
})
export
class
SettingsPaneComponent
{
isWindows
:
boolean
isMac
:
boolean
isLinux
:
boolean
year
:
number
version
:
string
fonts
:
string
[]
=
[]
restartRequested
:
boolean
globalHotkey
=
[
'
Ctrl+Shift+G
'
]
constructor
(
public
config
:
ConfigService
,
private
electron
:
ElectronService
,
hostApp
:
HostAppService
,
electron
:
ElectronService
,
)
{
this
.
isWindows
=
hostApp
.
platform
==
PLATFORM_WINDOWS
this
.
isMac
=
hostApp
.
platform
==
PLATFORM_MAC
...
...
@@ -27,15 +36,6 @@ export class SettingsPaneComponent {
this
.
year
=
new
Date
().
getFullYear
()
}
isWindows
:
boolean
isMac
:
boolean
isLinux
:
boolean
year
:
number
version
:
string
fonts
:
string
[]
=
[]
globalHotkey
=
[
'
Ctrl+Shift+G
'
]
ngOnInit
()
{
childProcessPromise
.
exec
(
'
fc-list :spacing=mono
'
).
then
((
result
)
=>
{
this
.
fonts
=
result
.
stdout
...
...
@@ -58,4 +58,13 @@ export class SettingsPaneComponent {
ngOnDestroy
()
{
this
.
config
.
save
()
}
requestRestart
()
{
this
.
restartRequested
=
true
}
restartApp
()
{
this
.
electron
.
app
.
relaunch
()
this
.
electron
.
app
.
exit
()
}
}
app/src/global.less
浏览文件 @
e6221ee4
...
...
@@ -173,8 +173,8 @@ ngb-typeahead-window {
}
label.control-label {
background: rgba(0, 0, 0, .
25
);
color: #
ccc
;
background: rgba(0, 0, 0, .
4
);
color: #
aaa
;
font-size: 10px;
display: block;
margin: 0;
...
...
@@ -183,13 +183,13 @@ label.control-label {
.form-control {
-webkit-user-select: initial;
background: rgba(0, 0, 0, .
25
);
background: rgba(0, 0, 0, .
4
);
display: block;
margin: 0 0 5px;
width: 100%;
border: none;
height: 30px;
line-height: 30px;
color: #
eee
;
color: #
ccc
;
padding: 0 10px;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录