Skip to content
Merged
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
67 changes: 67 additions & 0 deletions src/login/login_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,60 @@
}
}

confirm_password_wrapper := View {
width: 275, height: Fit,
visible: false,
flow: Overlay,

confirm_password_input := RobrixTextInput {
width: Fill, height: Fit
flow: Right, // do not wrap
padding: Inset{top: 10, bottom: 10, left: 10, right: 40}
empty_text: "Confirm password"
is_password: true,
}

View {
width: Fill, height: Fill
align: Align{x: 1.0, y: 0.5}

show_confirm_password_button := Button {
width: 36, height: 36,
padding: 6,
draw_bg +: {
color: #0000
color_hover: #0000
color_down: #0000
border_size: 0.0
}
draw_icon +: {
svg: (mod.widgets.ICON_EYE_CLOSED),
color: #8C8C8C,
}
icon_walk: Walk{width: 20, height: 20}
text: ""
}

hide_confirm_password_button := Button {
visible: false,
width: 36, height: 36,
padding: 6,
draw_bg +: {
color: #0000
color_hover: #0000
color_down: #0000
border_size: 0.0
}
draw_icon +: {
svg: (mod.widgets.ICON_EYE_OPEN),
color: #8C8C8C,
}
icon_walk: Walk{width: 20, height: 20}
text: ""
}
}
}

View {
width: 275, height: Fit,
flow: Down,
Expand Down Expand Up @@ -643,6 +697,8 @@
#[deref] view: View,
/// Whether the password field is currently showing plaintext.
#[rust] password_visible: bool,
/// Whether the confirm password field is currently showing plaintext.
#[rust] confirm_password_visible: bool,
/// Boolean to indicate if the SSO login process is still in flight
#[rust] sso_pending: bool,
/// The URL to redirect to after logging in with SSO.
Expand Down Expand Up @@ -1050,6 +1106,17 @@
self.redraw(cx);
}

// Handle toggling confirm password visibility
let show_confirm_pw_button = self.view.button(cx, ids!(show_confirm_password_button));
let hide_confirm_pw_button = self.view.button(cx, ids!(hide_confirm_password_button));
if show_confirm_pw_button.clicked(actions) || hide_confirm_pw_button.clicked(actions) {
self.confirm_password_visible = !self.confirm_password_visible;
confirm_password_input.toggle_is_password(cx);

Check failure on line 1114 in src/login/login_screen.rs

View workflow job for this annotation

GitHub Actions / Build Ubuntu

cannot find value `confirm_password_input` in this scope

Check failure on line 1114 in src/login/login_screen.rs

View workflow job for this annotation

GitHub Actions / Build Android (Windows Host)

cannot find value `confirm_password_input` in this scope

Check failure on line 1114 in src/login/login_screen.rs

View workflow job for this annotation

GitHub Actions / Build Android (Linux Host)

cannot find value `confirm_password_input` in this scope

Check failure on line 1114 in src/login/login_screen.rs

View workflow job for this annotation

GitHub Actions / Build Windows

cannot find value `confirm_password_input` in this scope

Check failure on line 1114 in src/login/login_screen.rs

View workflow job for this annotation

GitHub Actions / Build macOS (arm64)

cannot find value `confirm_password_input` in this scope

Check failure on line 1114 in src/login/login_screen.rs

View workflow job for this annotation

GitHub Actions / Build macOS (x86_64)

cannot find value `confirm_password_input` in this scope

Check failure on line 1114 in src/login/login_screen.rs

View workflow job for this annotation

GitHub Actions / Build iOS (macOS Host)

cannot find value `confirm_password_input` in this scope

Check failure on line 1114 in src/login/login_screen.rs

View workflow job for this annotation

GitHub Actions / clippy

cannot find value `confirm_password_input` in this scope
show_confirm_pw_button.set_visible(cx, !self.confirm_password_visible);
hide_confirm_pw_button.set_visible(cx, self.confirm_password_visible);
self.redraw(cx);
}

if mode_toggle_button.clicked(actions) {
self.suppress_login_failure_modal = true;
self.last_failure_message_shown = None;
Expand Down
Loading