From 7f5014b34a29ec39099f222f125756caf97220e6 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 14 Nov 2023 17:15:33 +0100 Subject: [PATCH] Add red background to blocks that need styling --- crates/editor2/src/editor.rs | 2 ++ crates/editor2/src/element.rs | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/editor2/src/editor.rs b/crates/editor2/src/editor.rs index d02521fac1da23887c6d19ac07f94b3b26045127..ebe78d95b3ea942e3cdcbcfb5a1b2dad5c09ed89 100644 --- a/crates/editor2/src/editor.rs +++ b/crates/editor2/src/editor.rs @@ -9974,6 +9974,8 @@ pub fn diagnostic_block_renderer(diagnostic: Diagnostic, is_valid: bool) -> Rend let message = message.clone(); v_stack() .id(cx.block_id) + .size_full() + .bg(gpui::red()) .children(highlighted_lines.iter().map(|(line, highlights)| { div() .child(HighlightedLabel::new(line.clone(), highlights.clone())) diff --git a/crates/editor2/src/element.rs b/crates/editor2/src/element.rs index 38b54ea2b156b1fcb4531385b754320bdc292524..638ed3389191e364d0a382c285b0af456db3ee92 100644 --- a/crates/editor2/src/element.rs +++ b/crates/editor2/src/element.rs @@ -21,7 +21,7 @@ use gpui::{ point, px, relative, size, transparent_black, Action, AnyElement, AvailableSpace, BorrowWindow, Bounds, Component, ContentMask, Corners, DispatchPhase, Edges, Element, ElementId, ElementInputHandler, Entity, Hsla, Line, MouseButton, MouseDownEvent, MouseMoveEvent, - MouseUpEvent, ParentElement, Pixels, ScrollWheelEvent, Size, Style, TextRun, TextStyle, + MouseUpEvent, ParentElement, Pixels, ScrollWheelEvent, Size, Style, Styled, TextRun, TextStyle, ViewContext, WindowContext, }; use itertools::Itertools; @@ -2057,12 +2057,18 @@ impl EditorElement { } h_stack() + .size_full() + .bg(gpui::red()) .child(filename.unwrap_or_else(|| "untitled".to_string())) .children(parent_path) .children(jump_icon) // .p_x(gutter_padding) } else { let text_style = style.text.clone(); - h_stack().child("⋯").children(jump_icon) // .p_x(gutter_padding) + h_stack() + .size_full() + .bg(gpui::red()) + .child("⋯") + .children(jump_icon) // .p_x(gutter_padding) }; element.render() }