@@ -32,7 +32,7 @@ use crate::{
32
32
user_profile:: { AvatarState , ShowUserProfileAction , UserProfile , UserProfileAndRoomId , UserProfilePaneInfo , UserProfileSlidingPaneRef , UserProfileSlidingPaneWidgetExt } ,
33
33
user_profile_cache,
34
34
} , shared:: {
35
- avatar:: AvatarWidgetRefExt , callout_tooltip:: TooltipAction , html_or_plaintext:: { HtmlOrPlaintextRef , HtmlOrPlaintextWidgetRefExt , RobrixHtmlLinkAction } , image_viewer_modal :: ImageViewerModalWidgetExt , jump_to_bottom_button:: { JumpToBottomButtonWidgetExt , UnreadMessageCount } , popup_list:: { enqueue_popup_notification, PopupItem , PopupKind } , restore_status_view:: RestoreStatusViewWidgetExt , styles:: COLOR_FG_DANGER_RED , text_or_image:: { TextOrImageRef , TextOrImageWidgetRefExt } , timestamp:: TimestampWidgetRefExt , typing_animation:: TypingAnimationWidgetExt
35
+ avatar:: AvatarWidgetRefExt , callout_tooltip:: TooltipAction , html_or_plaintext:: { HtmlOrPlaintextRef , HtmlOrPlaintextWidgetRefExt , RobrixHtmlLinkAction } , jump_to_bottom_button:: { JumpToBottomButtonWidgetExt , UnreadMessageCount } , popup_list:: { enqueue_popup_notification, PopupItem , PopupKind } , restore_status_view:: RestoreStatusViewWidgetExt , styles:: COLOR_FG_DANGER_RED , text_or_image:: { TextOrImageRef , TextOrImageWidgetRefExt } , timestamp:: TimestampWidgetRefExt , typing_animation:: TypingAnimationWidgetExt
36
36
} , sliding_sync:: { get_client, submit_async_request, take_timeline_endpoints, BackwardsPaginateUntilEventRequest , MatrixRequest , PaginationDirection , TimelineRequestSender , UserPowerLevels } , utils:: { self , room_name_or_id, unix_time_millis_to_datetime, ImageFormat , MEDIA_THUMBNAIL_FORMAT }
37
37
} ;
38
38
use crate :: home:: event_reaction_list:: ReactionListWidgetRefExt ;
@@ -753,7 +753,7 @@ live_design! {
753
753
// The user profile sliding pane should be displayed on top of other "static" subviews
754
754
// (on top of all other views that are always visible).
755
755
user_profile_sliding_pane = <UserProfileSlidingPane > { }
756
- image_viewer_modal = < ImageViewerModal > { }
756
+
757
757
// The loading pane appears while the user is waiting for something in the room screen
758
758
// to finish loading, e.g., when loading an older replied-to message.
759
759
//loading_pane = <LoadingPane> { }
@@ -870,7 +870,6 @@ impl Widget for RoomScreen {
870
870
// and wrap it in a `if let Event::Signal` conditional.
871
871
user_profile_cache:: process_user_profile_updates ( cx) ;
872
872
avatar_cache:: process_avatar_updates ( cx) ;
873
-
874
873
}
875
874
876
875
if let Event :: Actions ( actions) = event {
@@ -981,12 +980,6 @@ impl Widget for RoomScreen {
981
980
) ;
982
981
}
983
982
}
984
- if let Some ( crate :: shared:: image_viewer_modal:: ImageViewerAction :: Test ) = action. downcast_ref ( ) {
985
- println ! ( "test" ) ;
986
- self . view . image_viewer_modal ( id ! ( image_viewer_modal) ) . open ( cx, None ) ;
987
- }
988
-
989
-
990
983
}
991
984
992
985
/*
@@ -1200,8 +1193,6 @@ impl Widget for RoomScreen {
1200
1193
// Forward the event to the inner timeline view, but capture any actions it produces
1201
1194
// such that we can handle the ones relevant to only THIS RoomScreen widget right here and now,
1202
1195
// ensuring they are not mistakenly handled by other RoomScreen widget instances.
1203
- self . view . handle_event ( cx, event, & mut room_scope) ;
1204
- return ;
1205
1196
let mut actions_generated_within_this_room_screen = cx. capture_actions ( |cx|
1206
1197
self . view . handle_event ( cx, event, & mut room_scope)
1207
1198
) ;
@@ -3556,10 +3547,6 @@ fn populate_image_message_content(
3556
3547
} else {
3557
3548
// Add click handler for the image
3558
3549
let _mxc_uri_clone = mxc_uri. clone ( ) ;
3559
- // text_or_image_ref.set_image_click_handler(cx, move |cx| {
3560
- // let image_viewer_modal = cx.get_global::<ImageViewerModalRef>();
3561
- // image_viewer_modal.open(cx, mxc_uri_clone.clone());
3562
- // });
3563
3550
}
3564
3551
3565
3552
// We're done drawing the image, so mark it as fully drawn.
@@ -3608,13 +3595,6 @@ fn populate_image_message_content(
3608
3595
let err_str = format ! ( "{body}\n \n Failed to display image: {e:?}" ) ;
3609
3596
error ! ( "{err_str}" ) ;
3610
3597
text_or_image_ref. show_text ( cx, & err_str) ;
3611
- } else {
3612
- // Add click handler for the blurhash image
3613
- let _mxc_uri_clone = mxc_uri. clone ( ) ;
3614
- // text_or_image_ref.set_image_click_handler(cx, move |cx| {
3615
- // let image_viewer_modal = cx.get_global::<ImageViewerModalRef>();
3616
- // image_viewer_modal.open(cx, mxc_uri_clone.clone());
3617
- // });
3618
3598
}
3619
3599
}
3620
3600
fully_drawn = false ;
@@ -4283,12 +4263,8 @@ impl Widget for Message {
4283
4263
// clickable or otherwise interactive.
4284
4264
match event. hits ( cx, self . view ( id ! ( replied_to_message) ) . area ( ) ) {
4285
4265
Hit :: FingerDown ( fe) => {
4286
- // cx.set_key_focus(self.view(id!(replied_to_message)).area());
4287
- // println!("Opening context menu for replied-to message preview");
4288
- //self.view.image_viewer_modal(id!(image_viewer_modal)).open(cx, None);
4266
+ cx. set_key_focus ( self . view ( id ! ( replied_to_message) ) . area ( ) ) ;
4289
4267
if fe. device . mouse_button ( ) . is_some_and ( |b| b. is_secondary ( ) ) {
4290
- println ! ( "Opening context menu for replied-to message preview" ) ;
4291
- self . view . image_viewer_modal ( id ! ( image_viewer_modal) ) . open ( cx, None ) ;
4292
4268
cx. widget_action (
4293
4269
details. room_screen_widget_uid ,
4294
4270
& scope. path ,
@@ -4297,7 +4273,6 @@ impl Widget for Message {
4297
4273
abs_pos : fe. abs ,
4298
4274
}
4299
4275
) ;
4300
-
4301
4276
}
4302
4277
}
4303
4278
Hit :: FingerLongPress ( lp) => {
@@ -4336,11 +4311,8 @@ impl Widget for Message {
4336
4311
match event. hits ( cx, message_view_area) {
4337
4312
Hit :: FingerDown ( fe) => {
4338
4313
cx. set_key_focus ( message_view_area) ;
4339
-
4340
4314
// A right click means we should display the context menu.
4341
4315
if fe. device . mouse_button ( ) . is_some_and ( |b| b. is_secondary ( ) ) {
4342
- println ! ( "Opening context menu for replied-to message preview" ) ;
4343
- cx. action ( crate :: shared:: image_viewer_modal:: ImageViewerAction :: Test ) ;
4344
4316
cx. widget_action (
4345
4317
details. room_screen_widget_uid ,
4346
4318
& scope. path ,
0 commit comments