本文档描述了 Tabby 的用户界面系统,包括其组件架构、布局组织和外观自定义选项。有关终端功能的更多信息,请参阅终端功能,有关连接类型的具体信息,请参阅连接类型。
Tabby 的用户界面是使用 Angular 构建的,采用基于组件的架构。该 UI 系统设计灵活,支持不同的标签页布局、分屏视图以及丰富的自定义选项。
来源:tabby-core/src/components/appRoot.component.ts tabby-core/src/components/tabHeader.component.ts
AppRootComponent 是构建 Tabby UI 的顶级组件。它包含窗口标题栏、标签页栏、工具栏按钮以及显示终端标签页的主内容区域。
关键属性和方法
来源:tabby-core/src/components/appRoot.component.ts64-258 tabby-core/src/components/appRoot.component.pug1-110
用户界面布局由配置设置决定,可以进行广泛自定义。主要布局组件包括
窗口结构由以下因素决定
来源:tabby-core/src/components/appRoot.component.pug1-110 tabby-core/src/components/appRoot.component.scss1-226
标签页栏显示所有打开标签页的标题,并提供标签页操作的控制。其位置和外观可以自定义
标签页栏功能
来源:tabby-core/src/components/appRoot.component.pug15-94 tabby-core/src/components/tabHeader.component.ts1-118
内容区域显示活动标签页的内容,可以是终端、设置面板或任何其他标签页类型。它支持
内容区域实现为一个容器,用于显示活动标签页组件并隐藏其他标签页
来源:tabby-core/src/components/appRoot.component.pug99-108 tabby-core/src/components/appRoot.component.scss173-191
Tabby 的标签页系统是 UI 的核心部分,允许用户管理多个终端会话。
标签页系统特点
来源:tabby-core/src/api/tabRecovery.ts1-42 tabby-core/src/services/tabRecovery.service.ts1-84 tabby-core/src/profiles.ts1-59
分屏标签页系统允许将单个标签页划分为多个窗格,每个窗格包含独立的终端会话
分屏标签页功能
来源:tabby-core/src/components/appRoot.component.ts130-137 tabby-core/src/profiles.ts8-58
Tabby 为终端外观提供了广泛的自定义选项
主题系统包括
来源:tabby-terminal/src/components/appearanceSettingsTab.component.pug1-182 tabby-terminal/src/components/colorSchemePreview.component.pug1-67
Tabby 为自定义终端外观提供了广泛的选项
| 设置类别 | 选项 |
|---|---|
| 字体 | 字体族、大小、粗细、连字 |
| 配色方案 | 背景、前景、光标、ANSI 颜色 |
| 光标 | 形状(块、光束、下划线)、闪烁设置 |
| 终端背景 | 来自主题或配色方案 |
| 行间距 | 行内边距、字符间距 |
| 字体渲染 | 对比度、备用字体 |
这些设置通过“外观设置”标签页进行管理
来源:tabby-terminal/src/components/appearanceSettingsTab.component.pug1-182 tabby-terminal/src/components/appearanceSettingsTab.component.scss1-15
终端前端使用 XTerm.js,并为视口、滚动条和光标提供了额外的样式
XTerm.js 通过以下插件进行扩展
来源:tabby-terminal/src/frontends/xterm.css1-20 tabby-terminal/yarn.lock5-47
Tabby 提供了大量键盘快捷键,以实现高效的 UI 导航和标签页管理
AppRootComponent 订阅快捷键流并执行相应的操作
来源:tabby-core/src/components/appRoot.component.ts97-143
Tabby 使用 Angular 的 CDK 实现标签页的拖放功能
来源:tabby-core/src/components/appRoot.component.ts217-227 tabby-core/src/components/appRoot.component.pug24-29
标签页标题支持包含各种标签页操作的上下文菜单
上下文菜单提供
来源:tabby-core/src/components/tabHeader.component.ts58-79 tabby-core/src/components/tabHeader.component.ts113-116
Tabby 包含一个复杂的状体恢复系统,可在应用程序重启后恢复标签页。
恢复系统通过以下方式工作
localStorage来源:tabby-core/src/services/tabRecovery.service.ts22-31 tabby-core/src/api/tabRecovery.ts1-42
分屏布局也可以恢复并保存为配置文件
这允许用户
来源:tabby-core/src/profiles.ts45-58
Tabby 的用户界面系统为终端操作提供了一个灵活、可自定义的环境。关键方面包括
UI 的设计兼具美观性和高度功能性,并注重性能、可用性和灵活性。