From 044be720380d557dd0b7cdb17586eb9706c97493 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Wed, 19 Feb 2025 12:14:28 -0300 Subject: [PATCH] popover_menu: Add docs to the `trigger_with_tooltip` method (#25158) Felt like this was relevant particularly as we're living with both `trigger` and `trigger_with_tooltip`. At some point, I believe there should be only one (`trigger_with_tooltip`) and that should be then renamed to just `trigger` back again! We're supporting both for now just for ease of migration/avoiding big changes. Release Notes: - N/A --- crates/ui/src/components/popover_menu.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/ui/src/components/popover_menu.rs b/crates/ui/src/components/popover_menu.rs index 095b05793a773afb792170fe9eb7ce4f9202b5ff..e3ce37b43e0b74c2817d70049731a9a901293afd 100644 --- a/crates/ui/src/components/popover_menu.rs +++ b/crates/ui/src/components/popover_menu.rs @@ -178,6 +178,7 @@ impl PopoverMenu { self } + /// This method prevents the trigger button tooltip from being seen when the menu is open. pub fn trigger_with_tooltip( mut self, t: T, @@ -200,26 +201,26 @@ impl PopoverMenu { self } - /// anchor defines which corner of the menu to anchor to the attachment point - /// (by default the cursor position, but see attach) + /// Defines which corner of the menu to anchor to the attachment point. + /// By default, it uses the cursor position. Also see the `attach` method. pub fn anchor(mut self, anchor: Corner) -> Self { self.anchor = anchor; self } - /// attach defines which corner of the handle to attach the menu's anchor to + /// Defines which corner of the handle to attach the menu's anchor to. pub fn attach(mut self, attach: Corner) -> Self { self.attach = Some(attach); self } - /// offset offsets the position of the content by that many pixels. + /// Offsets the position of the content by that many pixels. pub fn offset(mut self, offset: Point) -> Self { self.offset = Some(offset); self } - /// attach something upon opening the menu + /// Attaches something upon opening the menu. pub fn on_open(mut self, on_open: Rc) -> Self { self.on_open = Some(on_open); self