Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2026-05-12 - Adding Tooltips to Icon-only Makepad Buttons
**Learning:** Tooltips for icon-only buttons like `RobrixIconButton` variants can be added by manually intercepting `Hit::FingerHoverIn` and `Hit::FingerHoverOut` in the parent view's `handle_event`, and dispatching `TooltipAction::HoverIn` / `HoverOut` actions to the UI context.
**Action:** When creating or modifying standalone icon buttons that lack built-in tooltip props, handle their hover area bounds manually using `cx.widget_action` with `CalloutTooltipOptions` to ensure accessibility.
40 changes: 40 additions & 0 deletions src/room/room_input_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,46 @@ impl Widget for RoomInputBar {
_ => {}
}

match event.hits(cx, self.view.button(cx, ids!(location_button)).area()) {
Hit::FingerHoverIn(_) => {
cx.widget_action(
self.widget_uid(),
TooltipAction::HoverIn {
widget_rect: self.view.button(cx, ids!(location_button)).area().rect(cx),
text: "Share location".to_string(),
options: CalloutTooltipOptions {
position: TooltipPosition::Top,
..Default::default()
},
},
);
}
Hit::FingerHoverOut(_) => {
cx.widget_action(self.widget_uid(), TooltipAction::HoverOut);
}
_ => {}
}

match event.hits(cx, self.view.button(cx, ids!(send_message_button)).area()) {
Hit::FingerHoverIn(_) => {
cx.widget_action(
self.widget_uid(),
TooltipAction::HoverIn {
widget_rect: self.view.button(cx, ids!(send_message_button)).area().rect(cx),
text: "Send message".to_string(),
options: CalloutTooltipOptions {
position: TooltipPosition::Top,
..Default::default()
},
},
);
}
Hit::FingerHoverOut(_) => {
cx.widget_action(self.widget_uid(), TooltipAction::HoverOut);
}
_ => {}
}

if let Event::Actions(actions) = event {
// Handle changes to the `send_on_enter` preference.
for action in actions {
Expand Down
Loading