Fix diagnostic popover not overflowing when necessary (#14322)

It was broken after #13996 moved rendering text one level deeper,
causing `max_h` and `overflow_y_scroll` to apply to different widgets
Release Notes:

- Fixed large diagnostic popovers not overflowing when nessesary

Before:
<img width="814" alt="Screenshot 2024-07-12 at 15 25 46"
src="https://github.com/user-attachments/assets/4f615600-2857-4470-8b77-864e3a9e38d5">

After:
<img width="813" alt="Screenshot 2024-07-12 at 15 26 10"
src="https://github.com/user-attachments/assets/83c1f344-b3b1-4929-8197-4b24a0e9c65e">
This commit is contained in:
Stanislav Alekseev 2024-07-13 00:14:11 +03:00 committed by GitHub
parent 59bc027750
commit 11178eacc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -636,8 +636,6 @@ impl DiagnosticPopover {
.when(window_is_transparent(cx), |this| { .when(window_is_transparent(cx), |this| {
this.bg(gpui::transparent_black()) this.bg(gpui::transparent_black())
}) })
.max_w(max_size.width)
.max_h(max_size.height)
.cursor(CursorStyle::PointingHand) .cursor(CursorStyle::PointingHand)
.tooltip(move |cx| Tooltip::for_action("Go To Diagnostic", &crate::GoToDiagnostic, cx)) .tooltip(move |cx| Tooltip::for_action("Go To Diagnostic", &crate::GoToDiagnostic, cx))
// Prevent a mouse move on the popover from being propagated to the editor, // Prevent a mouse move on the popover from being propagated to the editor,
@ -651,6 +649,8 @@ impl DiagnosticPopover {
div() div()
.id("diagnostic-inner") .id("diagnostic-inner")
.overflow_y_scroll() .overflow_y_scroll()
.max_w(max_size.width)
.max_h(max_size.height)
.px_2() .px_2()
.py_1() .py_1()
.bg(diagnostic_colors.background) .bg(diagnostic_colors.background)