Give no-error diagnostic indicator a hover state

This commit is contained in:
Max Brunsfeld 2022-04-28 12:35:20 -07:00
parent 6578ae5393
commit e48a975b1e
11 changed files with 751 additions and 563 deletions

View file

@ -226,73 +226,96 @@
"background": "#58526052" "background": "#58526052"
} }
}, },
"diagnostics": { "diagnostic_message": {
"height": 16, "family": "Zed Sans",
"summary_ok": { "color": "#8b8792",
"corner_radius": 6, "size": 14,
"padding": { "hover": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#e2dfe7",
"size": 14,
"hover": {
"background": "#58526052"
}
},
"summary_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#e2dfe7",
"size": 14,
"background": "#a06e3b26",
"border": {
"color": "#a06e3b26",
"width": 1
},
"hover": {
"background": "#a06e3b33"
}
},
"summary_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#e2dfe7",
"size": 14,
"background": "#be467826",
"border": {
"color": "#be467826",
"width": 1
},
"hover": {
"background": "#be467833"
}
},
"message": {
"family": "Zed Sans", "family": "Zed Sans",
"color": "#8b8792", "color": "#8b8792",
"size": 14, "size": 14
"hover": { }
"family": "Zed Sans", },
"color": "#8b8792", "diagnostic_summary": {
"size": 14 "height": 16,
} "icon_width": 14,
"icon_spacing": 2,
"summary_spacing": 6,
"text": {
"family": "Zed Sans",
"color": "#e2dfe7",
"size": 14
}, },
"icon_color_ok": "#8b8792", "icon_color_ok": "#8b8792",
"icon_color_warning": "#a06e3b", "icon_color_warning": "#a06e3b",
"icon_color_error": "#be4678", "icon_color_error": "#be4678",
"icon_width": 14, "container_ok": {
"icon_spacing": 2, "corner_radius": 6,
"summary_spacing": 6 "padding": {
"left": 6,
"right": 6
},
"background": "#58526052"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#a06e3b26",
"border": {
"color": "#a06e3b26",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#be467826",
"border": {
"color": "#be467826",
"width": 1
}
},
"hover": {
"icon_color_ok": "#e2dfe7",
"container_ok": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#58526052"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#a06e3b33",
"border": {
"color": "#a06e3b26",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#be467833",
"border": {
"color": "#be467826",
"width": 1
}
}
}
}, },
"sidebar_buttons": { "sidebar_buttons": {
"group_left": {}, "group_left": {},

View file

@ -226,73 +226,96 @@
"background": "#8b87921f" "background": "#8b87921f"
} }
}, },
"diagnostics": { "diagnostic_message": {
"height": 16, "family": "Zed Sans",
"summary_ok": { "color": "#585260",
"corner_radius": 6, "size": 14,
"padding": { "hover": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#26232a",
"size": 14,
"hover": {
"background": "#8b87921f"
}
},
"summary_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#26232a",
"size": 14,
"background": "#a06e3b26",
"border": {
"color": "#a06e3b26",
"width": 1
},
"hover": {
"background": "#a06e3b33"
}
},
"summary_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#26232a",
"size": 14,
"background": "#be467826",
"border": {
"color": "#be467826",
"width": 1
},
"hover": {
"background": "#be467833"
}
},
"message": {
"family": "Zed Sans", "family": "Zed Sans",
"color": "#585260", "color": "#585260",
"size": 14, "size": 14
"hover": { }
"family": "Zed Sans", },
"color": "#585260", "diagnostic_summary": {
"size": 14 "height": 16,
} "icon_width": 14,
"icon_spacing": 2,
"summary_spacing": 6,
"text": {
"family": "Zed Sans",
"color": "#26232a",
"size": 14
}, },
"icon_color_ok": "#585260", "icon_color_ok": "#585260",
"icon_color_warning": "#a06e3b", "icon_color_warning": "#a06e3b",
"icon_color_error": "#be4678", "icon_color_error": "#be4678",
"icon_width": 14, "container_ok": {
"icon_spacing": 2, "corner_radius": 6,
"summary_spacing": 6 "padding": {
"left": 6,
"right": 6
},
"background": "#8b87921f"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#a06e3b26",
"border": {
"color": "#a06e3b26",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#be467826",
"border": {
"color": "#be467826",
"width": 1
}
},
"hover": {
"icon_color_ok": "#26232a",
"container_ok": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#8b87921f"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#a06e3b33",
"border": {
"color": "#a06e3b26",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#be467833",
"border": {
"color": "#be467826",
"width": 1
}
}
}
}, },
"sidebar_buttons": { "sidebar_buttons": {
"group_left": {}, "group_left": {},

View file

@ -226,73 +226,96 @@
"background": "#232323" "background": "#232323"
} }
}, },
"diagnostics": { "diagnostic_message": {
"family": "Zed Sans",
"color": "#808080",
"size": 14,
"hover": {
"family": "Zed Sans",
"color": "#9c9c9c",
"size": 14
}
},
"diagnostic_summary": {
"height": 16, "height": 16,
"summary_ok": { "icon_width": 14,
"corner_radius": 6, "icon_spacing": 2,
"padding": { "summary_spacing": 6,
"left": 6, "text": {
"right": 6
},
"family": "Zed Sans", "family": "Zed Sans",
"color": "#f1f1f1", "color": "#f1f1f1",
"size": 14, "size": 14
"hover": {
"background": "#232323"
}
},
"summary_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#f1f1f1",
"size": 14,
"background": "#f6a72426",
"border": {
"color": "#f6a72426",
"width": 1
},
"hover": {
"background": "#f6a72433"
}
},
"summary_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#f1f1f1",
"size": 14,
"background": "#c9181826",
"border": {
"color": "#eb2d2d26",
"width": 1
},
"hover": {
"background": "#c9181833"
}
},
"message": {
"family": "Zed Sans",
"color": "#808080",
"size": 14,
"hover": {
"family": "Zed Sans",
"color": "#9c9c9c",
"size": 14
}
}, },
"icon_color_ok": "#9c9c9c", "icon_color_ok": "#9c9c9c",
"icon_color_warning": "#f6a724", "icon_color_warning": "#f6a724",
"icon_color_error": "#eb2d2d", "icon_color_error": "#eb2d2d",
"icon_width": 14, "container_ok": {
"icon_spacing": 2, "corner_radius": 6,
"summary_spacing": 6 "padding": {
"left": 6,
"right": 6
},
"background": "#232323"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#f6a72426",
"border": {
"color": "#f6a72426",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#c9181826",
"border": {
"color": "#eb2d2d26",
"width": 1
}
},
"hover": {
"icon_color_ok": "#c6c6c6",
"container_ok": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#232323"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#f6a72433",
"border": {
"color": "#f6a72426",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#c9181833",
"border": {
"color": "#eb2d2d26",
"width": 1
}
}
}
}, },
"sidebar_buttons": { "sidebar_buttons": {
"group_left": {}, "group_left": {},

View file

@ -226,73 +226,96 @@
"background": "#eaeaea" "background": "#eaeaea"
} }
}, },
"diagnostics": { "diagnostic_message": {
"family": "Zed Sans",
"color": "#636363",
"size": 14,
"hover": {
"family": "Zed Sans",
"color": "#474747",
"size": 14
}
},
"diagnostic_summary": {
"height": 16, "height": 16,
"summary_ok": { "icon_width": 14,
"corner_radius": 6, "icon_spacing": 2,
"padding": { "summary_spacing": 6,
"left": 6, "text": {
"right": 6
},
"family": "Zed Sans", "family": "Zed Sans",
"color": "#2b2b2b", "color": "#2b2b2b",
"size": 14, "size": 14
"hover": {
"background": "#eaeaea"
}
},
"summary_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#2b2b2b",
"size": 14,
"background": "#f6a72426",
"border": {
"color": "#f6a72426",
"width": 1
},
"hover": {
"background": "#f6a72433"
}
},
"summary_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#2b2b2b",
"size": 14,
"background": "#c9181826",
"border": {
"color": "#eb2d2d26",
"width": 1
},
"hover": {
"background": "#c9181833"
}
},
"message": {
"family": "Zed Sans",
"color": "#636363",
"size": 14,
"hover": {
"family": "Zed Sans",
"color": "#474747",
"size": 14
}
}, },
"icon_color_ok": "#717171", "icon_color_ok": "#717171",
"icon_color_warning": "#f7bf17", "icon_color_warning": "#f7bf17",
"icon_color_error": "#c91818", "icon_color_error": "#c91818",
"icon_width": 14, "container_ok": {
"icon_spacing": 2, "corner_radius": 6,
"summary_spacing": 6 "padding": {
"left": 6,
"right": 6
},
"background": "#eaeaea"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#f6a72426",
"border": {
"color": "#f6a72426",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#c9181826",
"border": {
"color": "#eb2d2d26",
"width": 1
}
},
"hover": {
"icon_color_ok": "#393939",
"container_ok": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#eaeaea"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#f6a72433",
"border": {
"color": "#f6a72426",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#c9181833",
"border": {
"color": "#eb2d2d26",
"width": 1
}
}
}
}, },
"sidebar_buttons": { "sidebar_buttons": {
"group_left": {}, "group_left": {},

View file

@ -226,73 +226,96 @@
"background": "#586e7552" "background": "#586e7552"
} }
}, },
"diagnostics": { "diagnostic_message": {
"height": 16, "family": "Zed Sans",
"summary_ok": { "color": "#93a1a1",
"corner_radius": 6, "size": 14,
"padding": { "hover": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#eee8d5",
"size": 14,
"hover": {
"background": "#586e7552"
}
},
"summary_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#eee8d5",
"size": 14,
"background": "#b5890026",
"border": {
"color": "#b5890026",
"width": 1
},
"hover": {
"background": "#b5890033"
}
},
"summary_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#eee8d5",
"size": 14,
"background": "#dc322f26",
"border": {
"color": "#dc322f26",
"width": 1
},
"hover": {
"background": "#dc322f33"
}
},
"message": {
"family": "Zed Sans", "family": "Zed Sans",
"color": "#93a1a1", "color": "#93a1a1",
"size": 14, "size": 14
"hover": { }
"family": "Zed Sans", },
"color": "#93a1a1", "diagnostic_summary": {
"size": 14 "height": 16,
} "icon_width": 14,
"icon_spacing": 2,
"summary_spacing": 6,
"text": {
"family": "Zed Sans",
"color": "#eee8d5",
"size": 14
}, },
"icon_color_ok": "#93a1a1", "icon_color_ok": "#93a1a1",
"icon_color_warning": "#b58900", "icon_color_warning": "#b58900",
"icon_color_error": "#dc322f", "icon_color_error": "#dc322f",
"icon_width": 14, "container_ok": {
"icon_spacing": 2, "corner_radius": 6,
"summary_spacing": 6 "padding": {
"left": 6,
"right": 6
},
"background": "#586e7552"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#b5890026",
"border": {
"color": "#b5890026",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#dc322f26",
"border": {
"color": "#dc322f26",
"width": 1
}
},
"hover": {
"icon_color_ok": "#eee8d5",
"container_ok": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#586e7552"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#b5890033",
"border": {
"color": "#b5890026",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#dc322f33",
"border": {
"color": "#dc322f26",
"width": 1
}
}
}
}, },
"sidebar_buttons": { "sidebar_buttons": {
"group_left": {}, "group_left": {},

View file

@ -226,73 +226,96 @@
"background": "#93a1a11f" "background": "#93a1a11f"
} }
}, },
"diagnostics": { "diagnostic_message": {
"height": 16, "family": "Zed Sans",
"summary_ok": { "color": "#586e75",
"corner_radius": 6, "size": 14,
"padding": { "hover": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#073642",
"size": 14,
"hover": {
"background": "#93a1a11f"
}
},
"summary_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#073642",
"size": 14,
"background": "#b5890026",
"border": {
"color": "#b5890026",
"width": 1
},
"hover": {
"background": "#b5890033"
}
},
"summary_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#073642",
"size": 14,
"background": "#dc322f26",
"border": {
"color": "#dc322f26",
"width": 1
},
"hover": {
"background": "#dc322f33"
}
},
"message": {
"family": "Zed Sans", "family": "Zed Sans",
"color": "#586e75", "color": "#586e75",
"size": 14, "size": 14
"hover": { }
"family": "Zed Sans", },
"color": "#586e75", "diagnostic_summary": {
"size": 14 "height": 16,
} "icon_width": 14,
"icon_spacing": 2,
"summary_spacing": 6,
"text": {
"family": "Zed Sans",
"color": "#073642",
"size": 14
}, },
"icon_color_ok": "#586e75", "icon_color_ok": "#586e75",
"icon_color_warning": "#b58900", "icon_color_warning": "#b58900",
"icon_color_error": "#dc322f", "icon_color_error": "#dc322f",
"icon_width": 14, "container_ok": {
"icon_spacing": 2, "corner_radius": 6,
"summary_spacing": 6 "padding": {
"left": 6,
"right": 6
},
"background": "#93a1a11f"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#b5890026",
"border": {
"color": "#b5890026",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#dc322f26",
"border": {
"color": "#dc322f26",
"width": 1
}
},
"hover": {
"icon_color_ok": "#073642",
"container_ok": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#93a1a11f"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#b5890033",
"border": {
"color": "#b5890026",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#dc322f33",
"border": {
"color": "#dc322f26",
"width": 1
}
}
}
}, },
"sidebar_buttons": { "sidebar_buttons": {
"group_left": {}, "group_left": {},

View file

@ -226,73 +226,96 @@
"background": "#5e668752" "background": "#5e668752"
} }
}, },
"diagnostics": { "diagnostic_message": {
"height": 16, "family": "Zed Sans",
"summary_ok": { "color": "#979db4",
"corner_radius": 6, "size": 14,
"padding": { "hover": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#dfe2f1",
"size": 14,
"hover": {
"background": "#5e668752"
}
},
"summary_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#dfe2f1",
"size": 14,
"background": "#c08b3026",
"border": {
"color": "#c08b3026",
"width": 1
},
"hover": {
"background": "#c08b3033"
}
},
"summary_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#dfe2f1",
"size": 14,
"background": "#c9492226",
"border": {
"color": "#c9492226",
"width": 1
},
"hover": {
"background": "#c9492233"
}
},
"message": {
"family": "Zed Sans", "family": "Zed Sans",
"color": "#979db4", "color": "#979db4",
"size": 14, "size": 14
"hover": { }
"family": "Zed Sans", },
"color": "#979db4", "diagnostic_summary": {
"size": 14 "height": 16,
} "icon_width": 14,
"icon_spacing": 2,
"summary_spacing": 6,
"text": {
"family": "Zed Sans",
"color": "#dfe2f1",
"size": 14
}, },
"icon_color_ok": "#979db4", "icon_color_ok": "#979db4",
"icon_color_warning": "#c08b30", "icon_color_warning": "#c08b30",
"icon_color_error": "#c94922", "icon_color_error": "#c94922",
"icon_width": 14, "container_ok": {
"icon_spacing": 2, "corner_radius": 6,
"summary_spacing": 6 "padding": {
"left": 6,
"right": 6
},
"background": "#5e668752"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#c08b3026",
"border": {
"color": "#c08b3026",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#c9492226",
"border": {
"color": "#c9492226",
"width": 1
}
},
"hover": {
"icon_color_ok": "#dfe2f1",
"container_ok": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#5e668752"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#c08b3033",
"border": {
"color": "#c08b3026",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#c9492233",
"border": {
"color": "#c9492226",
"width": 1
}
}
}
}, },
"sidebar_buttons": { "sidebar_buttons": {
"group_left": {}, "group_left": {},

View file

@ -226,73 +226,96 @@
"background": "#979db41f" "background": "#979db41f"
} }
}, },
"diagnostics": { "diagnostic_message": {
"height": 16, "family": "Zed Sans",
"summary_ok": { "color": "#5e6687",
"corner_radius": 6, "size": 14,
"padding": { "hover": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#293256",
"size": 14,
"hover": {
"background": "#979db41f"
}
},
"summary_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#293256",
"size": 14,
"background": "#c08b3026",
"border": {
"color": "#c08b3026",
"width": 1
},
"hover": {
"background": "#c08b3033"
}
},
"summary_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"family": "Zed Sans",
"color": "#293256",
"size": 14,
"background": "#c9492226",
"border": {
"color": "#c9492226",
"width": 1
},
"hover": {
"background": "#c9492233"
}
},
"message": {
"family": "Zed Sans", "family": "Zed Sans",
"color": "#5e6687", "color": "#5e6687",
"size": 14, "size": 14
"hover": { }
"family": "Zed Sans", },
"color": "#5e6687", "diagnostic_summary": {
"size": 14 "height": 16,
} "icon_width": 14,
"icon_spacing": 2,
"summary_spacing": 6,
"text": {
"family": "Zed Sans",
"color": "#293256",
"size": 14
}, },
"icon_color_ok": "#5e6687", "icon_color_ok": "#5e6687",
"icon_color_warning": "#c08b30", "icon_color_warning": "#c08b30",
"icon_color_error": "#c94922", "icon_color_error": "#c94922",
"icon_width": 14, "container_ok": {
"icon_spacing": 2, "corner_radius": 6,
"summary_spacing": 6 "padding": {
"left": 6,
"right": 6
},
"background": "#979db41f"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#c08b3026",
"border": {
"color": "#c08b3026",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#c9492226",
"border": {
"color": "#c9492226",
"width": 1
}
},
"hover": {
"icon_color_ok": "#293256",
"container_ok": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#979db41f"
},
"container_warning": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#c08b3033",
"border": {
"color": "#c08b3026",
"width": 1
}
},
"container_error": {
"corner_radius": 6,
"padding": {
"left": 6,
"right": 6
},
"background": "#c9492233",
"border": {
"color": "#c9492226",
"width": 1
}
}
}
}, },
"sidebar_buttons": { "sidebar_buttons": {
"group_left": {}, "group_left": {},

View file

@ -95,20 +95,11 @@ impl View for DiagnosticIndicator {
.theme .theme
.workspace .workspace
.status_bar .status_bar
.diagnostics; .diagnostic_summary;
let style = if state.hovered {
let summary_style = if self.summary.error_count > 0 { style.hover()
&style.summary_error
} else if self.summary.warning_count > 0 {
&style.summary_warning
} else { } else {
&style.summary_ok &style.default
};
let summary_style = if state.hovered {
summary_style.hover()
} else {
&summary_style.default
}; };
let mut summary_row = Flex::row(); let mut summary_row = Flex::row();
@ -122,12 +113,9 @@ impl View for DiagnosticIndicator {
.contained() .contained()
.with_margin_right(style.icon_spacing) .with_margin_right(style.icon_spacing)
.named("error-icon"), .named("error-icon"),
Label::new( Label::new(self.summary.error_count.to_string(), style.text.clone())
self.summary.error_count.to_string(), .aligned()
summary_style.text.clone(), .boxed(),
)
.aligned()
.boxed(),
]); ]);
} }
@ -146,12 +134,9 @@ impl View for DiagnosticIndicator {
0. 0.
}) })
.named("warning-icon"), .named("warning-icon"),
Label::new( Label::new(self.summary.warning_count.to_string(), style.text.clone())
self.summary.warning_count.to_string(), .aligned()
summary_style.text.clone(), .boxed(),
)
.aligned()
.boxed(),
]); ]);
} }
@ -170,7 +155,13 @@ impl View for DiagnosticIndicator {
.constrained() .constrained()
.with_height(style.height) .with_height(style.height)
.contained() .contained()
.with_style(summary_style.container) .with_style(if self.summary.error_count > 0 {
style.container_error
} else if self.summary.warning_count > 0 {
style.container_warning
} else {
style.container_ok
})
.boxed() .boxed()
}) })
.with_cursor_style(CursorStyle::PointingHand) .with_cursor_style(CursorStyle::PointingHand)
@ -181,20 +172,22 @@ impl View for DiagnosticIndicator {
let style = &cx.global::<Settings>().theme.workspace.status_bar; let style = &cx.global::<Settings>().theme.workspace.status_bar;
let item_spacing = style.item_spacing; let item_spacing = style.item_spacing;
let message_style = &style.diagnostics.message;
if in_progress { if in_progress {
element.add_child( element.add_child(
Label::new("checking…".into(), message_style.default.text.clone()) Label::new(
.aligned() "checking…".into(),
.contained() style.diagnostic_message.default.text.clone(),
.with_margin_left(item_spacing) )
.boxed(), .aligned()
.contained()
.with_margin_left(item_spacing)
.boxed(),
); );
} else if let Some(diagnostic) = &self.current_diagnostic { } else if let Some(diagnostic) = &self.current_diagnostic {
let message_style = message_style.clone(); let message_style = style.diagnostic_message.clone();
element.add_child( element.add_child(
MouseEventHandler::new::<Message, _, _>(0, cx, |state, _| { MouseEventHandler::new::<Message, _, _>(1, cx, |state, _| {
Label::new( Label::new(
diagnostic.message.split('\n').next().unwrap().to_string(), diagnostic.message.split('\n').next().unwrap().to_string(),
if state.hovered { if state.hovered {

View file

@ -144,7 +144,8 @@ pub struct StatusBar {
pub auto_update_done_message: TextStyle, pub auto_update_done_message: TextStyle,
pub lsp_status: Interactive<StatusBarLspStatus>, pub lsp_status: Interactive<StatusBarLspStatus>,
pub sidebar_buttons: StatusBarSidebarButtons, pub sidebar_buttons: StatusBarSidebarButtons,
pub diagnostics: StatusBarDiagnostics, pub diagnostic_summary: Interactive<StatusBarDiagnosticSummary>,
pub diagnostic_message: Interactive<ContainedText>,
} }
#[derive(Deserialize, Default)] #[derive(Deserialize, Default)]
@ -155,14 +156,14 @@ pub struct StatusBarSidebarButtons {
} }
#[derive(Deserialize, Default)] #[derive(Deserialize, Default)]
pub struct StatusBarDiagnostics { pub struct StatusBarDiagnosticSummary {
pub message: Interactive<ContainedText>, pub container_ok: ContainerStyle,
pub summary_ok: Interactive<ContainedText>, pub container_warning: ContainerStyle,
pub summary_warning: Interactive<ContainedText>, pub container_error: ContainerStyle,
pub summary_error: Interactive<ContainedText>, pub text: TextStyle,
pub icon_color_ok: Color, pub icon_color_ok: Color,
pub icon_color_error: Color,
pub icon_color_warning: Color, pub icon_color_warning: Color,
pub icon_color_error: Color,
pub height: f32, pub height: f32,
pub icon_width: f32, pub icon_width: f32,
pub icon_spacing: f32, pub icon_spacing: f32,

View file

@ -33,12 +33,6 @@ export default function workspace(theme: Theme) {
}, },
}; };
const diagnosticSummary = {
cornerRadius: 6,
padding: { left: 6, right: 6 },
...text(theme, "sans", "primary", { size: "sm" }),
};
return { return {
background: backgroundColor(theme, 300), background: backgroundColor(theme, 300),
leaderBorderOpacity: 0.7, leaderBorderOpacity: 0.7,
@ -89,40 +83,56 @@ export default function workspace(theme: Theme) {
background: backgroundColor(theme, 300, "hovered"), background: backgroundColor(theme, 300, "hovered"),
} }
}, },
diagnostics: { diagnosticMessage: {
...text(theme, "sans", "muted"),
hover: text(theme, "sans", "secondary"),
},
diagnosticSummary: {
height: 16, height: 16,
summaryOk: {
...diagnosticSummary,
hover: {
background: backgroundColor(theme, 300, "hovered"),
}
},
summaryWarning: {
...diagnosticSummary,
background: backgroundColor(theme, "warning"),
border: border(theme, "warning"),
hover: {
background: backgroundColor(theme, "warning", "hovered"),
}
},
summaryError: {
...diagnosticSummary,
background: backgroundColor(theme, "error"),
border: border(theme, "error"),
hover: {
background: backgroundColor(theme, "error", "hovered"),
}
},
message: {
...text(theme, "sans", "muted"),
hover: text(theme, "sans", "secondary"),
},
iconColorOk: iconColor(theme, "secondary"),
iconColorWarning: iconColor(theme, "warning"),
iconColorError: iconColor(theme, "error"),
iconWidth: 14, iconWidth: 14,
iconSpacing: 2, iconSpacing: 2,
summarySpacing: 6, summarySpacing: 6,
text: text(theme, "sans", "primary", { size: "sm" }),
iconColorOk: iconColor(theme, "secondary"),
iconColorWarning: iconColor(theme, "warning"),
iconColorError: iconColor(theme, "error"),
containerOk: {
cornerRadius: 6,
padding: { left: 6, right: 6 },
background: backgroundColor(theme, 300, "hovered"),
},
containerWarning: {
cornerRadius: 6,
padding: { left: 6, right: 6 },
background: backgroundColor(theme, "warning"),
border: border(theme, "warning"),
},
containerError: {
cornerRadius: 6,
padding: { left: 6, right: 6 },
background: backgroundColor(theme, "error"),
border: border(theme, "error"),
},
hover: {
iconColorOk: iconColor(theme, "primary"),
containerOk: {
cornerRadius: 6,
padding: { left: 6, right: 6 },
background: backgroundColor(theme, 300, "hovered"),
},
containerWarning: {
cornerRadius: 6,
padding: { left: 6, right: 6 },
background: backgroundColor(theme, "warning", "hovered"),
border: border(theme, "warning"),
},
containerError: {
cornerRadius: 6,
padding: { left: 6, right: 6 },
background: backgroundColor(theme, "error", "hovered"),
border: border(theme, "error"),
}
},
}, },
sidebarButtons: { sidebarButtons: {
groupLeft: {}, groupLeft: {},