@@ -111,11 +111,10 @@ pub fn menu_button<R>(
111
111
/// Returns `None` if the menu is not open.
112
112
pub fn menu_image_button < R > (
113
113
ui : & mut Ui ,
114
- texture_id : TextureId ,
115
- image_size : impl Into < Vec2 > ,
114
+ image_button : ImageButton ,
116
115
add_contents : impl FnOnce ( & mut Ui ) -> R ,
117
116
) -> InnerResponse < Option < R > > {
118
- stationary_menu_image_impl ( ui, texture_id , image_size , Box :: new ( add_contents) )
117
+ stationary_menu_image_impl ( ui, image_button , Box :: new ( add_contents) )
119
118
}
120
119
121
120
/// Construct a nested sub menu in another menu.
@@ -202,14 +201,13 @@ fn stationary_menu_impl<'c, R>(
202
201
/// Responds to primary clicks.
203
202
fn stationary_menu_image_impl < ' c , R > (
204
203
ui : & mut Ui ,
205
- texture_id : TextureId ,
206
- image_size : impl Into < Vec2 > ,
204
+ image_button : ImageButton ,
207
205
add_contents : Box < dyn FnOnce ( & mut Ui ) -> R + ' c > ,
208
206
) -> InnerResponse < Option < R > > {
209
207
let bar_id = ui. id ( ) ;
210
208
211
209
let mut bar_state = BarState :: load ( ui. ctx ( ) , bar_id) ;
212
- let button_response = ui. add ( ImageButton :: new ( texture_id , image_size ) ) ;
210
+ let button_response = ui. add ( image_button ) ;
213
211
let inner = bar_state. bar_menu ( & button_response, add_contents) ;
214
212
215
213
bar_state. store ( ui. ctx ( ) , bar_id) ;
0 commit comments