diff --git a/Cargo.lock b/Cargo.lock index efe076a..cdd5221 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3399,6 +3399,7 @@ dependencies = [ "htmlize", "imbl", "imghdr", + "indexmap", "linkify", "makepad-widgets", "matrix-sdk", diff --git a/Cargo.toml b/Cargo.toml index de46ba3..c2cdabb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ unicode-segmentation = "1.11.0" url = "2.5.0" emojis = "0.6.1" bytesize = "1.3.0" - +indexmap = "2.6.0" ################################################################################################### #### Note: we now enable the usage of `rustls-tls` and the `bundled-sqlite` features in the 2 #### diff --git a/src/avatar_cache.rs b/src/avatar_cache.rs index 9610ae9..d527254 100644 --- a/src/avatar_cache.rs +++ b/src/avatar_cache.rs @@ -75,7 +75,6 @@ pub fn get_or_fetch_avatar( }, Entry::Occupied(occupied) => return occupied.get().clone(), } - submit_async_request(MatrixRequest::FetchAvatar { mxc_uri, on_fetched: enqueue_avatar_update, diff --git a/src/home/mod.rs b/src/home/mod.rs index 3652e8e..e4207b8 100644 --- a/src/home/mod.rs +++ b/src/home/mod.rs @@ -7,6 +7,7 @@ pub mod main_desktop_ui; pub mod main_mobile_ui; pub mod room_preview; pub mod room_screen; +pub mod room_read_receipt; pub mod rooms_list; pub mod rooms_sidebar; pub mod spaces_dock; @@ -18,6 +19,7 @@ pub fn live_design(cx: &mut Cx) { rooms_list::live_design(cx); room_preview::live_design(cx); room_screen::live_design(cx); + room_read_receipt::live_design(cx); rooms_sidebar::live_design(cx); main_mobile_ui::live_design(cx); main_desktop_ui::live_design(cx); diff --git a/src/home/room_read_receipt.rs b/src/home/room_read_receipt.rs new file mode 100644 index 0000000..5d3e411 --- /dev/null +++ b/src/home/room_read_receipt.rs @@ -0,0 +1,181 @@ +use crate::shared::avatar::{AvatarRef, AvatarWidgetRefExt}; +use crate::home::room_screen::RoomScreenTooltipActions; +use crate::utils::human_readable_list; +use indexmap::IndexMap; +use makepad_widgets::*; +use matrix_sdk::ruma::{events::receipt::Receipt, EventId, OwnedUserId, RoomId}; +use std::cmp; +const MAX_VISIBLE_AVATARS_IN_READ_RECEIPT_ROW : usize = 5; +live_design! { + import makepad_draw::shader::std::*; + import makepad_widgets::base::*; + import makepad_widgets::theme_desktop_dark::*; + import crate::shared::avatar::*; + import crate::shared::styles::*; + + AvatarRow = {{AvatarRow}} { + button: { + width: 15.0, + height: 15.0, + text_view = { text = { draw_text: { + text_style: { font_size: 6.0 } + }}} + } + margin: {top: 3, right: 10, bottom: 3, left: 10} + width: 100, + height: 50, + plus: