mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 00:41:26 +12:00
overlays: implement OSK password mode
This commit is contained in:
parent
088d22675b
commit
bdc5ed094b
4 changed files with 12 additions and 3 deletions
|
@ -1102,6 +1102,7 @@ namespace rsx
|
||||||
u16 vertical_scroll_offset = 0;
|
u16 vertical_scroll_offset = 0;
|
||||||
|
|
||||||
bool m_reset_caret_pulse = false;
|
bool m_reset_caret_pulse = false;
|
||||||
|
bool password_mode = false;
|
||||||
|
|
||||||
std::u32string value;
|
std::u32string value;
|
||||||
std::u32string placeholder;
|
std::u32string placeholder;
|
||||||
|
|
|
@ -108,6 +108,10 @@ namespace rsx
|
||||||
{
|
{
|
||||||
overlay_element::set_unicode_text(placeholder);
|
overlay_element::set_unicode_text(placeholder);
|
||||||
}
|
}
|
||||||
|
else if (password_mode)
|
||||||
|
{
|
||||||
|
overlay_element::set_unicode_text(std::u32string(value.size(), U"*"[0]));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
overlay_element::set_unicode_text(value);
|
overlay_element::set_unicode_text(value);
|
||||||
|
|
|
@ -260,6 +260,7 @@ namespace rsx
|
||||||
m_title.set_unicode_text(title);
|
m_title.set_unicode_text(title);
|
||||||
m_title.back_color.a = 0.f;
|
m_title.back_color.a = 0.f;
|
||||||
|
|
||||||
|
m_preview.password_mode = m_password_mode;
|
||||||
m_preview.set_placeholder(get_placeholder());
|
m_preview.set_placeholder(get_placeholder());
|
||||||
m_preview.set_unicode_text(initial_text);
|
m_preview.set_unicode_text(initial_text);
|
||||||
|
|
||||||
|
@ -814,8 +815,6 @@ namespace rsx
|
||||||
|
|
||||||
add_panel(osk_panel_password(shift_cb, layer_cb, space_cb, delete_cb, enter_cb));
|
add_panel(osk_panel_password(shift_cb, layer_cb, space_cb, delete_cb, enter_cb));
|
||||||
|
|
||||||
// TODO: hide entered text with *
|
|
||||||
|
|
||||||
m_password_mode = true;
|
m_password_mode = true;
|
||||||
}
|
}
|
||||||
else if (panel_flag == CELL_OSKDIALOG_PANELMODE_DEFAULT || panel_flag == CELL_OSKDIALOG_PANELMODE_DEFAULT_NO_JAPANESE)
|
else if (panel_flag == CELL_OSKDIALOG_PANELMODE_DEFAULT || panel_flag == CELL_OSKDIALOG_PANELMODE_DEFAULT_NO_JAPANESE)
|
||||||
|
|
|
@ -22,7 +22,7 @@ osk_dialog_frame::~osk_dialog_frame()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void osk_dialog_frame::Create(const std::string& title, const std::u16string& message, char16_t* init_text, u32 charlimit, u32 prohibit_flags, u32 /*panel_flag*/, u32 /*first_view_panel*/)
|
void osk_dialog_frame::Create(const std::string& title, const std::u16string& message, char16_t* init_text, u32 charlimit, u32 prohibit_flags, u32 panel_flag, u32 /*first_view_panel*/)
|
||||||
{
|
{
|
||||||
state = OskDialogState::Open;
|
state = OskDialogState::Open;
|
||||||
|
|
||||||
|
@ -63,6 +63,11 @@ void osk_dialog_frame::Create(const std::string& title, const std::u16string& me
|
||||||
input->setText(input_text);
|
input->setText(input_text);
|
||||||
input->setFocus();
|
input->setFocus();
|
||||||
|
|
||||||
|
if (panel_flag & CELL_OSKDIALOG_PANELMODE_PASSWORD)
|
||||||
|
{
|
||||||
|
input->setEchoMode(QLineEdit::Password); // Let's assume that games only use the password mode with single-line edit fields
|
||||||
|
}
|
||||||
|
|
||||||
if (prohibit_flags & CELL_OSKDIALOG_NO_SPACE)
|
if (prohibit_flags & CELL_OSKDIALOG_NO_SPACE)
|
||||||
{
|
{
|
||||||
input->setValidator(new QRegExpValidator(QRegExp("^\\S*$"), this));
|
input->setValidator(new QRegExpValidator(QRegExp("^\\S*$"), this));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue