Skip to content

Commit

Permalink
Rename infobox theme scopes (#1741)
Browse files Browse the repository at this point in the history
This makes it play nicely with #1714
  • Loading branch information
sudormrfbin authored Mar 4, 2022
1 parent 0062af6 commit c484b08
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions book/src/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
8 changes: 2 additions & 6 deletions helix-term/src/ui/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions runtime/themes/solarized_dark.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
4 changes: 2 additions & 2 deletions runtime/themes/solarized_light.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down

0 comments on commit c484b08

Please sign in to comment.