Merge remote-tracking branch 'origin/master'
commit
bc16b7fcbc
|
|
@ -191,6 +191,7 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect,
|
|||
setBackgroundOpaque(true);
|
||||
|
||||
mPasswordModified = false;
|
||||
mShowPassword = false;
|
||||
|
||||
sInstance = this;
|
||||
|
||||
|
|
@ -316,6 +317,10 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect,
|
|||
username_combo->setFocusLostCallback(boost::bind(&FSPanelLogin::onSelectUser, this));
|
||||
mPreviousUsername = username_combo->getValue().asString();
|
||||
|
||||
childSetAction("password_show_btn", onShowHidePasswordClick, this);
|
||||
childSetAction("password_hide_btn", onShowHidePasswordClick, this);
|
||||
syncShowHidePasswordButton();
|
||||
|
||||
mInitialized = true;
|
||||
}
|
||||
|
||||
|
|
@ -1058,6 +1063,37 @@ void FSPanelLogin::onClickForgotPassword(void*)
|
|||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void FSPanelLogin::onShowHidePasswordClick(void*)
|
||||
{
|
||||
if (sInstance)
|
||||
{ // mShowPassword is not saved between sessions, it's just for short-term use
|
||||
sInstance->mShowPassword = !sInstance->mShowPassword;
|
||||
LL_INFOS("AppInit") << "Showing password text now " << (sInstance->mShowPassword ? "on" : "off") << LL_ENDL;
|
||||
|
||||
sInstance->syncShowHidePasswordButton();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FSPanelLogin::syncShowHidePasswordButton()
|
||||
{ // Show or hide the two 'eye' buttons for password visibility
|
||||
LLButton* show_password_btn = sInstance->findChild<LLButton>("password_show_btn");
|
||||
if (show_password_btn)
|
||||
{
|
||||
show_password_btn->setVisible(!mShowPassword);
|
||||
}
|
||||
LLButton* hide_password_btn = sInstance->findChild<LLButton>("password_hide_btn");
|
||||
if (hide_password_btn)
|
||||
{
|
||||
hide_password_btn->setVisible(mShowPassword);
|
||||
}
|
||||
|
||||
// Update the edit field to replace password text with dots ... or not. Will redraw
|
||||
sInstance->getChild<LLLineEditor>("password_edit")->setDrawAsterixes(!mShowPassword);
|
||||
}
|
||||
|
||||
|
||||
//static
|
||||
void FSPanelLogin::onClickHelp(void*)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ private:
|
|||
void onSelectServer();
|
||||
void onLocationSLURL();
|
||||
void onUsernameTextChanged();
|
||||
void syncShowHidePasswordButton(); // Update which button is shown based on mShowPassword
|
||||
|
||||
static void onClickConnect(void*);
|
||||
static void onClickNewAccount(void*);
|
||||
|
|
@ -110,6 +111,7 @@ private:
|
|||
static void onRemoveCallback(const LLSD& notification, const LLSD& response);
|
||||
static void onClickGridMgrHelp(void*);
|
||||
static void onClickGridBuilder(void*);
|
||||
static void onShowHidePasswordClick(void*);
|
||||
static std::string credentialName();
|
||||
|
||||
private:
|
||||
|
|
@ -121,6 +123,8 @@ private:
|
|||
void* mCallbackData;
|
||||
|
||||
bool mPasswordModified;
|
||||
bool mShowPassword; // Show password in normal text vs. hidden by dots
|
||||
|
||||
bool mShowFavorites;
|
||||
|
||||
static FSPanelLogin* sInstance;
|
||||
|
|
|
|||
|
|
@ -274,6 +274,30 @@
|
|||
top_pad="1"
|
||||
name="remember_check"
|
||||
width="145" />
|
||||
<button
|
||||
name="password_show_btn"
|
||||
tool_tip="Show password text"
|
||||
follows="left|bottom"
|
||||
left="256"
|
||||
bottom_delta="0"
|
||||
height="20"
|
||||
width="20"
|
||||
image_pressed="Profile_Group_Visibility_Off_Pressed"
|
||||
image_unselected="Profile_Group_Visibility_Off"
|
||||
tab_stop="false"
|
||||
visible="true" />
|
||||
<button
|
||||
name="password_hide_btn"
|
||||
tool_tip="Hide password text"
|
||||
follows="left|bottom"
|
||||
left="256"
|
||||
bottom_delta="0"
|
||||
height="20"
|
||||
width="20"
|
||||
image_pressed="Profile_Group_Visibility_On_Pressed"
|
||||
image_unselected="Profile_Group_Visibility_On"
|
||||
tab_stop="false"
|
||||
visible="false" />
|
||||
</layout_panel>
|
||||
<layout_panel
|
||||
tab_stop="false"
|
||||
|
|
|
|||
|
|
@ -184,6 +184,30 @@
|
|||
top_pad="10"
|
||||
name="remember_check"
|
||||
width="204" />
|
||||
<button
|
||||
name="password_show_btn"
|
||||
tool_tip="Show password text"
|
||||
follows="left|bottom"
|
||||
left="194"
|
||||
bottom_delta="0"
|
||||
height="20"
|
||||
width="20"
|
||||
image_pressed="Profile_Group_Visibility_Off_Pressed"
|
||||
image_unselected="Profile_Group_Visibility_Off"
|
||||
tab_stop="false"
|
||||
visible="true" />
|
||||
<button
|
||||
name="password_hide_btn"
|
||||
tool_tip="Hide password text"
|
||||
follows="left|bottom"
|
||||
left="194"
|
||||
bottom_delta="0"
|
||||
height="20"
|
||||
width="20"
|
||||
image_pressed="Profile_Group_Visibility_On_Pressed"
|
||||
image_unselected="Profile_Group_Visibility_On"
|
||||
tab_stop="false"
|
||||
visible="false" />
|
||||
</layout_panel> <!-- password_container -->
|
||||
<layout_panel
|
||||
auto_resize="false"
|
||||
|
|
|
|||
Loading…
Reference in New Issue