@@ -4,7 +4,7 @@ use makepad_widgets::*;
44use matrix_sdk:: ruma:: { OwnedRoomId , RoomId } ;
55
66use crate :: {
7- home:: { new_message_context_menu:: NewMessageContextMenuWidgetRefExt , room_screen:: MessageAction , rooms_list:: RoomsListAction } , login:: login_screen:: LoginAction , shared:: { callout_tooltip:: { CalloutTooltipOptions , CalloutTooltipWidgetRefExt , TooltipAction } , popup_list:: PopupNotificationAction } , utils:: room_name_or_id, verification:: VerificationAction , verification_modal:: { VerificationModalAction , VerificationModalWidgetRefExt }
7+ home:: { new_message_context_menu:: NewMessageContextMenuWidgetRefExt , room_screen:: MessageAction , rooms_list:: RoomsListAction } , login:: login_screen:: LoginAction , shared:: { callout_tooltip:: { CalloutTooltipOptions , CalloutTooltipWidgetRefExt , TooltipAction } , message_search_input_bar :: MessageSearchAction , popup_list:: PopupNotificationAction } , utils:: room_name_or_id, verification:: VerificationAction , verification_modal:: { VerificationModalAction , VerificationModalWidgetRefExt }
88} ;
99
1010live_design ! {
@@ -242,6 +242,7 @@ impl MatchEvent for App {
242242 & Scope :: default ( ) . path ,
243243 StackNavigationAction :: NavigateTo ( live_id ! ( main_content_view) )
244244 ) ;
245+ self . ui . view ( id ! ( message_search_input_view) ) . set_visible ( cx, true ) ;
245246 self . ui . redraw ( cx) ;
246247 }
247248
@@ -251,6 +252,7 @@ impl MatchEvent for App {
251252 }
252253 AppStateAction :: FocusNone => {
253254 self . app_state . selected_room = None ;
255+ self . ui . view ( id ! ( message_search_input_view) ) . set_visible ( cx, false ) ;
254256 }
255257 AppStateAction :: UpgradedInviteToJoinedRoom ( room_id) => {
256258 if let Some ( selected_room) = self . app_state . selected_room . as_mut ( ) {
@@ -318,6 +320,24 @@ impl MatchEvent for App {
318320 // }
319321 // _ => {}
320322 // }
323+ match action. as_widget_action ( ) . cast ( ) {
324+ MessageSearchAction :: Click ( _) => {
325+ self . ui
326+ . view ( id ! ( main_content_view. header. content. message_search_input_mobile_view) )
327+ . apply_over ( cx, live ! {
328+ width: 220
329+ } ) ;
330+ }
331+ MessageSearchAction :: Clear => {
332+ self . ui
333+ . view ( id ! ( main_content_view. header. content. message_search_input_mobile_view) )
334+ . apply_over ( cx, live ! {
335+ width: 150
336+ } ) ;
337+ }
338+ _ => { }
339+ }
340+
321341 }
322342 }
323343}
0 commit comments