Improve diagnostic header UI (#9888)
This PR rearranges the diagnostics to put the headers to the left of the diagnostic messages and adds an additional button to close the diagnostics. <img width="394" alt="Screenshot 2024-03-27 at 2 01 19 PM" src="https://github.com/zed-industries/zed/assets/2280405/83be4051-6441-47c6-9b48-77c75ce9c8eb"> <img width="326" alt="Screenshot 2024-03-27 at 2 01 56 PM" src="https://github.com/zed-industries/zed/assets/2280405/d849ca34-91e9-4de6-9d9c-503b75e97d60"> As a drive by, I also quieted a useless but loud log message. Release Notes: - Added a close button to the `f8` diagnostics.
This commit is contained in:
parent
80242584e7
commit
9bce5e8b82
4 changed files with 54 additions and 23 deletions
|
@ -276,7 +276,7 @@ pub enum ButtonSize {
|
|||
}
|
||||
|
||||
impl ButtonSize {
|
||||
fn height(self) -> Rems {
|
||||
pub fn rems(self) -> Rems {
|
||||
match self {
|
||||
ButtonSize::Large => rems_from_px(32.),
|
||||
ButtonSize::Default => rems_from_px(22.),
|
||||
|
@ -424,7 +424,7 @@ impl RenderOnce for ButtonLike {
|
|||
.id(self.id.clone())
|
||||
.group("")
|
||||
.flex_none()
|
||||
.h(self.height.unwrap_or(self.size.height().into()))
|
||||
.h(self.height.unwrap_or(self.size.rems().into()))
|
||||
.when_some(self.width, |this, width| this.w(width).justify_center())
|
||||
.when_some(self.rounding, |this, rounding| match rounding {
|
||||
ButtonLikeRounding::All => this.rounded_md(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue