Skip to content
Closed

Popup #462

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use makepad_widgets::*;
use matrix_sdk::ruma::{OwnedRoomId, RoomId};

use crate::{
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}
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, popup_notification::RobrixPopupNotificationWidgetRefExt}, utils::room_name_or_id, verification::VerificationAction, verification_modal::{VerificationModalAction, VerificationModalWidgetRefExt}
};

live_design! {
Expand All @@ -19,6 +19,7 @@ live_design! {
use crate::shared::popup_list::PopupList;
use crate::home::new_message_context_menu::*;
use crate::shared::callout_tooltip::CalloutTooltip;
use crate::shared::popup_notification::RobrixPopupNotification;


APP_TAB_COLOR = #344054
Expand Down Expand Up @@ -141,6 +142,10 @@ live_design! {
verification_modal_inner = <VerificationModal> {}
}
}

test_popup = <RobrixPopupNotification> {
text: "Test notification",
}
}
} // end of body
}
Expand Down Expand Up @@ -199,6 +204,7 @@ impl MatchEvent for App {
log!("Received LoginAction::LoginSuccess, hiding login view.");
self.app_state.logged_in = true;
self.update_login_visibility(cx);
self.ui.robrix_popup_notification(id!(test_popup)).open(cx);
self.ui.redraw(cx);
}

Expand Down
12 changes: 11 additions & 1 deletion src/home/room_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ use crate::{
user_profile::{AvatarState, ShowUserProfileAction, UserProfile, UserProfileAndRoomId, UserProfilePaneInfo, UserProfileSlidingPaneRef, UserProfileSlidingPaneWidgetExt},
user_profile_cache,
}, shared::{
avatar::AvatarWidgetRefExt, callout_tooltip::TooltipAction, html_or_plaintext::{HtmlOrPlaintextRef, HtmlOrPlaintextWidgetRefExt, RobrixHtmlLinkAction}, jump_to_bottom_button::{JumpToBottomButtonWidgetExt, UnreadMessageCount}, popup_list::enqueue_popup_notification, styles::COLOR_DANGER_RED, text_or_image::{TextOrImageRef, TextOrImageWidgetRefExt}, typing_animation::TypingAnimationWidgetExt
avatar::AvatarWidgetRefExt, callout_tooltip::TooltipAction, html_or_plaintext::{HtmlOrPlaintextRef, HtmlOrPlaintextWidgetRefExt, RobrixHtmlLinkAction}, jump_to_bottom_button::{JumpToBottomButtonWidgetExt, UnreadMessageCount}, popup_list::enqueue_popup_notification, popup_notification::RobrixPopupNotificationWidgetExt, styles::COLOR_DANGER_RED, text_or_image::{TextOrImageRef, TextOrImageWidgetRefExt}, typing_animation::TypingAnimationWidgetExt
}, 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}

};
use crate::home::event_reaction_list::ReactionListWidgetRefExt;
use crate::home::room_read_receipt::AvatarRowWidgetRefExt;
Expand Down Expand Up @@ -60,9 +61,11 @@ live_design! {
use crate::home::loading_pane::*;
use crate::home::location_preview::*;
use crate::room::room_input_bar::*;
use crate::shared::popup_notification::RobrixPopupNotification;
use crate::room::room_input_bar::*;
use crate::home::room_read_receipt::*;


IMG_DEFAULT_AVATAR = dep("crate://self/resources/img/default_avatar.png")

ICO_LOCATION_PERSON = dep("crate://self/resources/icons/location-person.svg")
Expand Down Expand Up @@ -770,6 +773,11 @@ live_design! {
// to finish loading, e.g., when loading an older replied-to message.
loading_pane = <LoadingPane> { }

popup = <RobrixPopupNotification> {
text: "Click success",
duration: 5.0,
}


/*
* TODO: add the action bar back in as a series of floating buttons.
Expand Down Expand Up @@ -1049,8 +1057,10 @@ impl Widget for RoomScreen {

self.clear_replying_to(cx);
message_input.set_text(cx, "");
self.robrix_popup_notification(id!(popup)).open(cx);
room_input_bar.enable_send_message_button(cx, false);


}
}

Expand Down
2 changes: 2 additions & 0 deletions src/shared/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub mod text_or_image;
pub mod typing_animation;
pub mod unread_badge;
pub mod verification_badge;
pub mod popup_notification;


pub fn live_design(cx: &mut Cx) {
Expand All @@ -34,4 +35,5 @@ pub fn live_design(cx: &mut Cx) {
verification_badge::live_design(cx);
callout_tooltip::live_design(cx);
mentionable_text_input::live_design(cx);
popup_notification::live_design(cx);
}
Loading