Rename infobox theme scopes (#1741)

This makes it play nicely with https://github.com/helix-editor/helix/pull/1714
pull/1747/head
Gokul Soumya 3 years ago committed by GitHub
parent 0062af6a19
commit c484b08923
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -218,12 +218,12 @@ These scopes are used for theming the editor interface.
| `ui.statusline` | Statusline | | `ui.statusline` | Statusline |
| `ui.statusline.inactive` | Statusline (unfocused document) | | `ui.statusline.inactive` | Statusline (unfocused document) |
| `ui.popup` | | | `ui.popup` | |
| `ui.popup.info` | |
| `ui.window` | | | `ui.window` | |
| `ui.help` | | | `ui.help` | |
| `ui.text` | | | `ui.text` | |
| `ui.text.focus` | | | `ui.text.focus` | |
| `ui.info` | | | `ui.text.info` | |
| `ui.info.text` | |
| `ui.menu` | | | `ui.menu` | |
| `ui.menu.selected` | | | `ui.menu.selected` | |
| `ui.selection` | For selections in the editing area | | `ui.selection` | For selections in the editing area |

@ -6,12 +6,8 @@ use tui::widgets::{Block, Borders, Paragraph, Widget};
impl Component for Info { impl Component for Info {
fn render(&mut self, viewport: Rect, surface: &mut Surface, cx: &mut Context) { fn render(&mut self, viewport: Rect, surface: &mut Surface, cx: &mut Context) {
let get_theme = |style, fallback| { let text_style = cx.editor.theme.get("ui.text.info");
let theme = &cx.editor.theme; let popup_style = cx.editor.theme.get("ui.popup.info");
theme.try_get(style).unwrap_or_else(|| theme.get(fallback))
};
let text_style = get_theme("ui.info.text", "ui.text");
let popup_style = text_style.patch(get_theme("ui.info", "ui.popup"));
// Calculate the area of the terminal to modify. Because we want to // Calculate the area of the terminal to modify. Because we want to
// render at the bottom right, we use the viewport's width and height // render at the bottom right, we use the viewport's width and height

@ -60,9 +60,9 @@
"ui.help" = { modifiers = ["reversed"] } "ui.help" = { modifiers = ["reversed"] }
# 快捷键窗口 # 快捷键窗口
"ui.info" = { bg = "base1" } "ui.popup.info" = { bg = "base1" }
# 快捷键字体 # 快捷键字体
"ui.info.text" = {fg = "base02", modifiers = ["bold"]} "ui.text.info" = {fg = "base02", modifiers = ["bold"]}
# 普通ui的字体样式 # 普通ui的字体样式
"ui.text" = { fg = "base1" } "ui.text" = { fg = "base1" }

@ -60,9 +60,9 @@
"ui.help" = { modifiers = ["reversed"] } "ui.help" = { modifiers = ["reversed"] }
# 快捷键窗口 # 快捷键窗口
"ui.info" = { bg = "base1" } "ui.popup.info" = { bg = "base1" }
# 快捷键字体 # 快捷键字体
"ui.info.text" = {fg = "base02", modifiers = ["bold"]} "ui.text.info" = {fg = "base02", modifiers = ["bold"]}
# 普通ui的字体样式 # 普通ui的字体样式
"ui.text" = { fg = "base1" } "ui.text" = { fg = "base1" }

Loading…
Cancel
Save