What is this junk? Dump some old crappy custom resize code for the login panel

meow-7.2.2
Ansariel 2016-04-20 16:33:30 +02:00
parent 90db320e37
commit b376d3c079
3 changed files with 13 additions and 84 deletions

View File

@ -79,7 +79,6 @@
#include "llsdserialize.h"
const S32 BLACK_BORDER_HEIGHT = 160;
const S32 MAX_PASSWORD_SL = 16;
const S32 MAX_PASSWORD_OPENSIM = 255;
@ -179,7 +178,6 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect,
void (*callback)(S32 option, void* user_data),
void *cb_data)
: LLPanel(),
mLogoImage(),
mCallback(callback),
mCallbackData(cb_data),
mShowFavorites(false)
@ -196,9 +194,6 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect,
login_holder->addChild(this);
}
// Logo
mLogoImage = LLUI::getUIImage("startup_logo");
buildFromFile( "panel_fs_login.xml");
reshape(rect.getWidth(), rect.getHeight());
@ -251,8 +246,6 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect,
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
web_browser->addObserver(this);
reshapeBrowser();
// Show last logged in user favorites in "Start at" combo.
LLComboBox* username_combo(getChild<LLComboBox>("username_combo"));
username_combo->setCommitCallback(boost::bind(&FSPanelLogin::onSelectUser, this));
@ -351,21 +344,6 @@ void FSPanelLogin::addFavoritesToStartLocation()
LLFloaterPreference::updateShowFavoritesCheckbox(mShowFavorites);
}
// force the size to be correct (XML doesn't seem to be sufficient to do this)
// (with some padding so the other login screen doesn't show through)
void FSPanelLogin::reshapeBrowser()
{
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
LLRect rect = gViewerWindow->getWindowRectScaled();
LLRect html_rect;
html_rect.setCenterAndSize(
rect.getCenterX() - 2, rect.getCenterY() + 40,
rect.getWidth() + 6, rect.getHeight() - 78 );
web_browser->setRect( html_rect );
web_browser->reshape( html_rect.getWidth(), html_rect.getHeight(), TRUE );
reshape( rect.getWidth(), rect.getHeight(), 1 );
}
FSPanelLogin::~FSPanelLogin()
{
FSPanelLogin::sInstance = NULL;
@ -375,50 +353,6 @@ FSPanelLogin::~FSPanelLogin()
gFocusMgr.setDefaultKeyboardFocus(NULL);
}
// virtual
void FSPanelLogin::draw()
{
gGL.pushMatrix();
{
F32 image_aspect = 1.333333f;
F32 view_aspect = (F32)getRect().getWidth() / (F32)getRect().getHeight();
// stretch image to maintain aspect ratio
if (image_aspect > view_aspect)
{
gGL.translatef(-0.5f * (image_aspect / view_aspect - 1.f) * getRect().getWidth(), 0.f, 0.f);
gGL.scalef(image_aspect / view_aspect, 1.f, 1.f);
}
S32 width = getRect().getWidth();
S32 height = getRect().getHeight();
if (getChild<LLView>("login_widgets")->getVisible())
{
// draw a background box in black
gl_rect_2d( 0, height - 264, width, 264, LLColor4::black );
// draw the bottom part of the background image
// just the blue background to the native client UI
mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight());
};
}
gGL.popMatrix();
LLPanel::draw();
}
// virtual
BOOL FSPanelLogin::handleKeyHere(KEY key, MASK mask)
{
if ( KEY_F1 == key )
{
LLViewerHelp* vhelp = LLViewerHelp::getInstance();
vhelp->showTopic(vhelp->f1HelpTopic());
return TRUE;
}
return LLPanel::handleKeyHere(key, mask);
}
// virtual
void FSPanelLogin::setFocus(BOOL b)
{
@ -483,7 +417,7 @@ void FSPanelLogin::showLoginWidgets()
// It seems to be part of the defunct? reg-in-client project.
sInstance->getChildView("login_widgets")->setVisible( true);
LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
sInstance->reshapeBrowser();
// *TODO: Append all the usual login parameters, like first_login=Y etc.
std::string splash_screen_url = LLGridManager::getInstance()->getLoginPage();
web_browser->navigateTo( splash_screen_url, HTTP_CONTENT_TEXT_HTML );

View File

@ -51,8 +51,6 @@ public:
void *callback_data);
~FSPanelLogin();
virtual BOOL handleKeyHere(KEY key, MASK mask);
virtual void draw();
virtual void setFocus( BOOL b );
// Show the XUI first name, last name, and password widgets. They are
@ -96,7 +94,6 @@ public:
private:
friend class LLPanelLoginListener;
void reshapeBrowser();
void addFavoritesToStartLocation();
void addUsersToCombo(BOOL show_server);
void onSelectUser();
@ -119,8 +116,6 @@ private:
static std::string credentialName();
private:
LLPointer<LLUIImage> mLogoImage;
void (*mCallback)(S32 option, void *userdata);
void* mCallbackData;

View File

@ -1,13 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
follows="all"
height="600"
height="768"
layout="topleft"
left="0"
name="panel_login"
focus_root="true"
top="600"
width="1130">
background_visible="true"
bg_opaque_color="0.16 0.16 0.16 1"
background_opaque="true"
width="1024">
<panel.string
name="real_url" translate="false">
http://phoenixviewer.com/app/loginV3/
@ -19,20 +21,18 @@
name="forgot_password_url">
http://secondlife.com/account/request.php
</panel.string>
<!-- *NOTE: Custom resize logic for login_html in llpanellogin.cpp -->
<web_browser
tab_stop="false"
trusted_content="true"
tab_stop="false"
trusted_content="true"
bg_opaque_color="Black"
border_visible="false"
bottom="600"
follows="all"
left="0"
name="login_html"
start_url=""
top="0"
height="600"
width="996"/>
top="18"
height="670"
width="1024" />
<layout_stack
animate="false"
clip="false"
@ -40,8 +40,8 @@
name="login_widgets"
layout="topleft"
orientation="horizontal"
top="519"
width="1130"
top="688"
width="1024"
height="80">
<layout_panel
auto_resize="false"