@@ -2,14 +2,14 @@ use std::rc::Rc;
22
33use gpui:: prelude:: FluentBuilder as _;
44use gpui:: {
5- AnyElement , App , Context , DefiniteLength , Edges , EdgesRefinement , Entity , Hsla ,
5+ AnyElement , App , DefiniteLength , Edges , EdgesRefinement , Entity , Hsla ,
66 InteractiveElement as _, IntoElement , MouseButton , ParentElement as _, Rems , RenderOnce ,
77 StyleRefinement , Styled , TextAlign , Window , div, px, relative,
88} ;
99
1010use crate :: button:: { Button , ButtonVariants as _} ;
1111use crate :: input:: clear_button;
12- use crate :: menu :: PopupMenu ;
12+ use crate :: native_menu :: NativeMenu ;
1313use crate :: spinner:: Spinner ;
1414use crate :: { ActiveTheme , Colorize , v_flex} ;
1515use crate :: { IconName , Size } ;
@@ -50,9 +50,8 @@ pub struct Input {
5050
5151 /// An optional context menu builder to allow a custom context menu on the input.
5252 ///
53- /// If set, this will override the built-in context menu.
54- context_menu_builder :
55- Option < Rc < dyn Fn ( PopupMenu , & mut Window , & mut Context < PopupMenu > ) -> PopupMenu > > ,
53+ /// If set, this overrides the built-in context menu.
54+ context_menu_builder : Option < Rc < dyn Fn ( NativeMenu , & mut Window , & mut App ) -> NativeMenu > > ,
5655}
5756
5857impl Sizable for Input {
@@ -159,10 +158,12 @@ impl Input {
159158 self
160159 }
161160
162- /// Sets the context menu for the input.
161+ /// Sets a custom context menu builder for the input, shown as a native OS menu.
162+ ///
163+ /// If set, this overrides the built-in right-click context menu.
163164 pub fn context_menu (
164165 mut self ,
165- f : impl Fn ( PopupMenu , & mut Window , & mut Context < PopupMenu > ) -> PopupMenu + ' static ,
166+ f : impl Fn ( NativeMenu , & mut Window , & mut App ) -> NativeMenu + ' static ,
166167 ) -> Self {
167168 self . context_menu_builder = Some ( Rc :: new ( f) ) ;
168169 self
0 commit comments