Fix right click handler for tabs

Also, some fun test helpers

Co-Authored-By: Mikayla <mikayla@zed.dev>
This commit is contained in:
Conrad Irwin 2024-01-18 12:07:52 -07:00
parent 7b9e7fea4e
commit 920eced1d5
9 changed files with 116 additions and 11 deletions

View file

@ -24,14 +24,16 @@ pub struct IconButton {
impl IconButton {
pub fn new(id: impl Into<ElementId>, icon: IconName) -> Self {
Self {
let mut this = Self {
base: ButtonLike::new(id),
shape: IconButtonShape::Wide,
icon,
icon_size: IconSize::default(),
icon_color: Color::Default,
selected_icon: None,
}
};
this.base.base = this.base.base.debug_selector(|| format!("ICON-{:?}", icon));
this
}
pub fn shape(mut self, shape: IconButtonShape) -> Self {