on master help sign in
Rename infobox theme scopes (#1741)
c484b08Gokul Soumya
book/src/themes.md+2−2
@@ -218,12 +218,12 @@ These scopes are used for theming the editor interface.
218| `ui.statusline` | Statusline |
218| `ui.statusline` | Statusline |
219| `ui.statusline.inactive` | Statusline (unfocused document) |
219| `ui.statusline.inactive` | Statusline (unfocused document) |
220| `ui.popup` | |
220| `ui.popup` | |
221+| `ui.popup.info` | |
221| `ui.window` | |
222| `ui.window` | |
222| `ui.help` | |
223| `ui.help` | |
223| `ui.text` | |
224| `ui.text` | |
224| `ui.text.focus` | |
225| `ui.text.focus` | |
225−| `ui.info` | |
226−| `ui.info.text` | |
226+| `ui.text.info` | |
227| `ui.menu` | |
227| `ui.menu` | |
228| `ui.menu.selected` | |
228| `ui.menu.selected` | |
229| `ui.selection` | For selections in the editing area |
229| `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};
6
6
7impl Component for Info {
7impl Component for Info {
8 fn render(&mut self, viewport: Rect, surface: &mut Surface, cx: &mut Context) {
8 fn render(&mut self, viewport: Rect, surface: &mut Surface, cx: &mut Context) {
9− let get_theme = |style, fallback| {
10− let theme = &cx.editor.theme;
9+ let text_style = cx.editor.theme.get("ui.text.info");
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"));
10+ let popup_style = cx.editor.theme.get("ui.popup.info");
15
11
16 // Calculate the area of the terminal to modify. Because we want to
12 // Calculate the area of the terminal to modify. Because we want to
17 // render at the bottom right, we use the viewport's width and height
13 // render at the bottom right, we use the viewport's width and height
runtime/themes/solarized_dark.toml+2−2
@@ -60,9 +60,9 @@
60"ui.help" = { modifiers = ["reversed"] }
60"ui.help" = { modifiers = ["reversed"] }
61
61
62# 快捷键窗口
62# 快捷键窗口
63−"ui.info" = { bg = "base1" }
63+"ui.popup.info" = { bg = "base1" }
64# 快捷键字体
64# 快捷键字体
65−"ui.info.text" = {fg = "base02", modifiers = ["bold"]}
65+"ui.text.info" = {fg = "base02", modifiers = ["bold"]}
66
66
67# 普通ui的字体样式
67# 普通ui的字体样式
68"ui.text" = { fg = "base1" }
68"ui.text" = { fg = "base1" }
runtime/themes/solarized_light.toml+2−2
@@ -60,9 +60,9 @@
60"ui.help" = { modifiers = ["reversed"] }
60"ui.help" = { modifiers = ["reversed"] }
61
61
62# 快捷键窗口
62# 快捷键窗口
63−"ui.info" = { bg = "base1" }
63+"ui.popup.info" = { bg = "base1" }
64# 快捷键字体
64# 快捷键字体
65−"ui.info.text" = {fg = "base02", modifiers = ["bold"]}
65+"ui.text.info" = {fg = "base02", modifiers = ["bold"]}
66
66
67# 普通ui的字体样式
67# 普通ui的字体样式
68"ui.text" = { fg = "base1" }
68"ui.text" = { fg = "base1" }