aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGokul Soumya2022-03-04 00:31:51 +0000
committerGitHub2022-03-04 00:31:51 +0000
commitc484b089230b541e63edc34a041e2842f2942e23 (patch)
tree2df721f5cbc000dcceb1a1656cab1e02859b777c
parent0062af6a19d96e0a4c3f94e3e44c179230e005b9 (diff)
Rename infobox theme scopes (#1741)
This makes it play nicely with https://github.com/helix-editor/helix/pull/1714
-rw-r--r--book/src/themes.md4
-rw-r--r--helix-term/src/ui/info.rs8
-rw-r--r--runtime/themes/solarized_dark.toml4
-rw-r--r--runtime/themes/solarized_light.toml4
4 files changed, 8 insertions, 12 deletions
diff --git a/book/src/themes.md b/book/src/themes.md
index 78b4d14b..62265e28 100644
--- a/book/src/themes.md
+++ b/book/src/themes.md
@@ -218,12 +218,12 @@ These scopes are used for theming the editor interface.
| `ui.statusline` | Statusline |
| `ui.statusline.inactive` | Statusline (unfocused document) |
| `ui.popup` | |
+| `ui.popup.info` | |
| `ui.window` | |
| `ui.help` | |
| `ui.text` | |
| `ui.text.focus` | |
-| `ui.info` | |
-| `ui.info.text` | |
+| `ui.text.info` | |
| `ui.menu` | |
| `ui.menu.selected` | |
| `ui.selection` | For selections in the editing area |
diff --git a/helix-term/src/ui/info.rs b/helix-term/src/ui/info.rs
index 55b0e65d..272244c1 100644
--- a/helix-term/src/ui/info.rs
+++ b/helix-term/src/ui/info.rs
@@ -6,12 +6,8 @@ use tui::widgets::{Block, Borders, Paragraph, Widget};
impl Component for Info {
fn render(&mut self, viewport: Rect, surface: &mut Surface, cx: &mut Context) {
- let get_theme = |style, fallback| {
- let theme = &cx.editor.theme;
- 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"));
+ let text_style = cx.editor.theme.get("ui.text.info");
+ let popup_style = cx.editor.theme.get("ui.popup.info");
// 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
diff --git a/runtime/themes/solarized_dark.toml b/runtime/themes/solarized_dark.toml
index dfaa104a..e3d587d4 100644
--- a/runtime/themes/solarized_dark.toml
+++ b/runtime/themes/solarized_dark.toml
@@ -60,9 +60,9 @@
"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.text" = { fg = "base1" }
diff --git a/runtime/themes/solarized_light.toml b/runtime/themes/solarized_light.toml
index c8a3dee1..3191add3 100644
--- a/runtime/themes/solarized_light.toml
+++ b/runtime/themes/solarized_light.toml
@@ -60,9 +60,9 @@
"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.text" = { fg = "base1" }