on master help sign in
Rename infobox theme scopes (#1741)

This makes it play nicely with https://github.com/helix-editor/helix/pull/1714

commitc484b089230b541e63edc34a041e2842f2942e23 authorGokul Soumya <gokulps15@gmail.com> dateFri 4 Mar 2022, 06:01 (5 years ago) parent0062af6
4 files changed+8−12
book/src/themes.md+2−2 helix-term/src/ui/info.rs+2−6 runtime/themes/solarized_dark.toml+2−2 runtime/themes/solarized_light.toml+2−2
book/src/themes.md+2−2
@@ -218,12 +218,12 @@ These scopes are used for theming the editor interface.
218218| `ui.statusline` | Statusline |
219219| `ui.statusline.inactive` | Statusline (unfocused document) |
220220| `ui.popup` | |
221+| `ui.popup.info` | |
221222| `ui.window` | |
222223| `ui.help` | |
223224| `ui.text` | |
224225| `ui.text.focus` | |
225−| `ui.info` | |
226−| `ui.info.text` | |
226+| `ui.text.info` | |
227227| `ui.menu` | |
228228| `ui.menu.selected` | |
229229| `ui.selection` | For selections in the editing area |
helix-term/src/ui/info.rs+2−6
@@ -6,12 +6,8 @@ use tui::widgets::{Block, Borders, Paragraph, Widget};
66
77impl Component for Info {
88 fn render(&mut self, viewport: Rect, surface: &mut Surface, cx: &mut Context) {
9− let get_theme = |style, fallback| {
10− let theme = &cx.editor.theme;
11− theme.try_get(style).unwrap_or_else(|| theme.get(fallback))
12− };
13− let text_style = get_theme("ui.info.text", "ui.text");
14− let popup_style = text_style.patch(get_theme("ui.info", "ui.popup"));
9+ let text_style = cx.editor.theme.get("ui.text.info");
10+ let popup_style = cx.editor.theme.get("ui.popup.info");
1511
1612 // Calculate the area of the terminal to modify. Because we want to
1713 // render at the bottom right, we use the viewport's width and height
runtime/themes/solarized_dark.toml+2−2
@@ -60,9 +60,9 @@
6060"ui.help" = { modifiers = ["reversed"] }
6161
6262# 快捷键窗口
63−"ui.info" = { bg = "base1" }
63+"ui.popup.info" = { bg = "base1" }
6464# 快捷键字体
65−"ui.info.text" = {fg = "base02", modifiers = ["bold"]}
65+"ui.text.info" = {fg = "base02", modifiers = ["bold"]}
6666
6767# 普通ui的字体样式
6868"ui.text" = { fg = "base1" }
runtime/themes/solarized_light.toml+2−2
@@ -60,9 +60,9 @@
6060"ui.help" = { modifiers = ["reversed"] }
6161
6262# 快捷键窗口
63−"ui.info" = { bg = "base1" }
63+"ui.popup.info" = { bg = "base1" }
6464# 快捷键字体
65−"ui.info.text" = {fg = "base02", modifiers = ["bold"]}
65+"ui.text.info" = {fg = "base02", modifiers = ["bold"]}
6666
6767# 普通ui的字体样式
6868"ui.text" = { fg = "base1" }