on master help sign in
Add ui.menu text style (#664)
d6a9c2cCossonLeo
book/src/themes.md+3
@@ -91,6 +91,9 @@ Possible keys:
91| `ui.help` | |
91| `ui.help` | |
92| `ui.text` | |
92| `ui.text` | |
93| `ui.text.focus` | |
93| `ui.text.focus` | |
94+| `ui.info` | |
95+| `ui.info.text` | |
96+| `ui.menu` | |
94| `ui.menu.selected` | |
97| `ui.menu.selected` | |
95| `ui.selection` | For selections in the editing area |
98| `ui.selection` | For selections in the editing area |
96| `ui.selection.primary` | |
99| `ui.selection.primary` | |
helix-term/src/ui/menu.rs+5−2
@@ -259,8 +259,11 @@ impl<T: Item + 'static> Component for Menu<T> {
259 // TODO: required size should re-trigger when we filter items so we can draw a smaller menu
259 // TODO: required size should re-trigger when we filter items so we can draw a smaller menu
260
260
261 fn render(&mut self, area: Rect, surface: &mut Surface, cx: &mut Context) {
261 fn render(&mut self, area: Rect, surface: &mut Surface, cx: &mut Context) {
262+ let theme = &cx.editor.theme;
263+ let style = theme
264+ .try_get("ui.menu")
262− let style = cx.editor.theme.get("ui.text");
265+ .unwrap_or_else(|| theme.get("ui.text"));
263− let selected = cx.editor.theme.get("ui.menu.selected");
266+ let selected = theme.get("ui.menu.selected");
264
267
265 let scroll = self.scroll;
268 let scroll = self.scroll;
266
269