Skip to content

Commit

Permalink
Interactive user verification is working fully!
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinaboos committed Oct 6, 2024
1 parent 93ad810 commit 1364e58
Show file tree
Hide file tree
Showing 13 changed files with 294 additions and 307 deletions.
37 changes: 3 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ version = "0.0.1-pre-alpha"
metadata.makepad-auto-version = "zqpv-Yj-K7WNVK2I8h5Okhho46Q="

[dependencies]
makepad-widgets = { git = "https://github.com/makepad/makepad", branch = "rik" }
# makepad-widgets = { git = "https://github.com/makepad/makepad", branch = "rik" }
makepad-widgets = { path = "../makepad/widgets" }

## Including this crate automatically configures all `robius-*` crates to work with Makepad.
robius-use-makepad = "0.1.0"
robius-open = "0.1.0"
Expand Down
20 changes: 10 additions & 10 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ live_design! {
import makepad_draw::shader::std::*;

import crate::shared::styles::*;
import crate::shared::clickable_view::ClickableView
import crate::home::home_screen::HomeScreen
import crate::home::room_screen::RoomScreen
import crate::profile::my_profile_screen::MyProfileScreen
import crate::shared::clickable_view::ClickableView;
import crate::home::home_screen::HomeScreen;
import crate::home::room_screen::RoomScreen;
import crate::profile::my_profile_screen::MyProfileScreen;
import crate::verification_modal::VerificationModal;

ICON_CHAT = dep("crate://self/resources/icons/chat.svg")
ICON_CONTACTS = dep("crate://self/resources/icons/contacts.svg")
Expand Down Expand Up @@ -188,13 +189,12 @@ impl MatchEvent for App {
RoomListAction::None => { }
}

// TODO FIXME: need to add a cast_ref() method to WidgetAction
// that doesn't require the action to be clonable.
match action.as_widget_action().cast() {
VerificationAction::RequestReceived { request, response_sender } => {
log!("Received a new verification request: {:?}", request);
// `VerificationAction`s come from a background thread, so they are NOT widget actions.
// Therefore, we cannot use `as_widget_action().cast()` to match them.
match action.downcast_ref() {
Some(VerificationAction::RequestReceived(state)) => {
self.ui.verification_modal(id!(verification_modal_inner))
.initialize_with_data(request, response_sender);
.initialize_with_data(state.clone());
self.ui.modal(id!(verification_modal)).open(cx);
}
// other verification actions are handled by the verification modal itself.
Expand Down
14 changes: 7 additions & 7 deletions src/home/room_preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ live_design! {
latest_message = <HtmlOrPlaintext> {
padding: {top: 3.0}
html_view = { html = {
font_size: 9.3, line_spacing: 1.,
draw_normal: { text_style: { font_size: 9.3, line_spacing: 1. } },
draw_italic: { text_style: { font_size: 9.3, line_spacing: 1. } },
draw_bold: { text_style: { font_size: 9.3, line_spacing: 1. } },
draw_bold_italic: { text_style: { font_size: 9.3, line_spacing: 1. } },
draw_fixed: { text_style: { font_size: 9.3, line_spacing: 1. } },
font_size: 9.3,
draw_normal: { text_style: { font_size: 9.3 } },
draw_italic: { text_style: { font_size: 9.3 } },
draw_bold: { text_style: { font_size: 9.3 } },
draw_bold_italic: { text_style: { font_size: 9.3 } },
draw_fixed: { text_style: { font_size: 9.3 } },
} }
plaintext_view = { pt_label = {
draw_text: {
text_style: { font_size: 9.5, line_spacing: 1. },
text_style: { font_size: 9.5 },
}
text: "[Loading latest message]"
} }
Expand Down
Loading

0 comments on commit 1364e58

Please sign in to comment.