@@ -86,23 +86,22 @@ script_mod! {
8686 }
8787}
8888
89+ /// Widget actions related to the room input popup menu.
8990#[ derive( Clone , Copy , Debug , Default , PartialEq ) ]
9091pub enum RoomInputPopupMenuAction {
92+ /// Emitted by the RoomInputBar when the add button is clicked,
93+ /// which is a request to show the room input popup menu.
9194 Show { button_rect : Rect } ,
95+ /// Emitted by the RoomInputPopupMenu when the upload photo/video button is clicked.
9296 UploadPhotoOrVideo ,
97+ /// Emitted by the RoomInputPopupMenu when the upload file button is clicked.
9398 UploadFile ,
99+ /// Emitted by the RoomInputPopupMenu when the send location button is clicked.
94100 SendCurrentLocation ,
95101 #[ default]
96102 None ,
97103}
98104
99- impl ActionDefaultRef for RoomInputPopupMenuAction {
100- fn default_ref ( ) -> & ' static Self {
101- static DEFAULT : RoomInputPopupMenuAction = RoomInputPopupMenuAction :: None ;
102- & DEFAULT
103- }
104- }
105-
106105#[ derive( Script , ScriptHook , Widget ) ]
107106pub struct RoomInputPopupMenu {
108107 #[ source] source : ScriptObjectRef ,
@@ -226,9 +225,9 @@ impl RoomInputPopupMenuRef {
226225 }
227226
228227 pub fn selected ( & self , actions : & Actions ) -> Option < RoomInputPopupMenuAction > {
229- match actions. find_widget_action ( self . widget_uid ( ) ) . cast_ref ( ) {
228+ match actions. find_widget_action ( self . widget_uid ( ) ) . cast ( ) {
230229 RoomInputPopupMenuAction :: None => None ,
231- action => Some ( * action) ,
230+ action => Some ( action) ,
232231 }
233232 }
234233
0 commit comments