Change summary
crates/ui2/src/components/button/button_like.rs | 6 +-----
crates/ui2/src/components/stories/icon_button.rs | 8 ++++++++
2 files changed, 9 insertions(+), 5 deletions(-)
Detailed changes
@@ -359,11 +359,7 @@ impl RenderOnce for ButtonLike {
},
)
.when_some(self.tooltip, |this, tooltip| {
- if !self.selected {
- this.tooltip(move |cx| tooltip(cx))
- } else {
- this
- }
+ this.tooltip(move |cx| tooltip(cx))
})
.children(self.children)
}
@@ -51,5 +51,13 @@ impl Render for IconButtonStory {
.tooltip(|cx| Tooltip::text("Open messages", cx)),
),
)
+ .child(Story::label("Selected with `tooltip`"))
+ .child(
+ div().w_8().child(
+ IconButton::new("selected_with_tooltip", Icon::InlayHint)
+ .selected(true)
+ .tooltip(|cx| Tooltip::text("Toggle inlay hints", cx)),
+ ),
+ )
}
}