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

Wed, 20 Apr 2016 16:33:30 +0200

author
Ansariel
date
Wed, 20 Apr 2016 16:33:30 +0200
changeset 48969
782b5ac64396
parent 48968
0eebda356b84
child 48970
ec8f85627a09

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

indra/newview/fspanellogin.cpp file | annotate | diff | revisions
indra/newview/fspanellogin.h file | annotate | diff | revisions
indra/newview/skins/default/xui/en/panel_fs_login.xml file | annotate | diff | revisions
     1.1 --- a/indra/newview/fspanellogin.cpp	Wed Apr 20 14:50:21 2016 +0200
     1.2 +++ b/indra/newview/fspanellogin.cpp	Wed Apr 20 16:33:30 2016 +0200
     1.3 @@ -79,7 +79,6 @@
     1.4  
     1.5  #include "llsdserialize.h"
     1.6  
     1.7 -const S32 BLACK_BORDER_HEIGHT = 160;
     1.8  const S32 MAX_PASSWORD_SL = 16;
     1.9  const S32 MAX_PASSWORD_OPENSIM = 255;
    1.10  
    1.11 @@ -179,7 +178,6 @@
    1.12  						 void (*callback)(S32 option, void* user_data),
    1.13  						 void *cb_data)
    1.14  :	LLPanel(),
    1.15 -	mLogoImage(),
    1.16  	mCallback(callback),
    1.17  	mCallbackData(cb_data),
    1.18  	mShowFavorites(false)
    1.19 @@ -196,9 +194,6 @@
    1.20  		login_holder->addChild(this);
    1.21  	}
    1.22  
    1.23 -	// Logo
    1.24 -	mLogoImage = LLUI::getUIImage("startup_logo");
    1.25 -
    1.26  	buildFromFile( "panel_fs_login.xml");
    1.27  
    1.28  	reshape(rect.getWidth(), rect.getHeight());
    1.29 @@ -251,8 +246,6 @@
    1.30  	LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
    1.31  	web_browser->addObserver(this);
    1.32  
    1.33 -	reshapeBrowser();
    1.34 -
    1.35  	// Show last logged in user favorites in "Start at" combo.
    1.36  	LLComboBox* username_combo(getChild<LLComboBox>("username_combo"));
    1.37  	username_combo->setCommitCallback(boost::bind(&FSPanelLogin::onSelectUser, this));
    1.38 @@ -351,21 +344,6 @@
    1.39  	LLFloaterPreference::updateShowFavoritesCheckbox(mShowFavorites);
    1.40  }
    1.41  
    1.42 -// force the size to be correct (XML doesn't seem to be sufficient to do this)
    1.43 -// (with some padding so the other login screen doesn't show through)
    1.44 -void FSPanelLogin::reshapeBrowser()
    1.45 -{
    1.46 -	LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
    1.47 -	LLRect rect = gViewerWindow->getWindowRectScaled();
    1.48 -	LLRect html_rect;
    1.49 -	html_rect.setCenterAndSize(
    1.50 -		rect.getCenterX() - 2, rect.getCenterY() + 40,
    1.51 -		rect.getWidth() + 6, rect.getHeight() - 78 );
    1.52 -	web_browser->setRect( html_rect );
    1.53 -	web_browser->reshape( html_rect.getWidth(), html_rect.getHeight(), TRUE );
    1.54 -	reshape( rect.getWidth(), rect.getHeight(), 1 );
    1.55 -}
    1.56 -
    1.57  FSPanelLogin::~FSPanelLogin()
    1.58  {
    1.59  	FSPanelLogin::sInstance = NULL;
    1.60 @@ -375,50 +353,6 @@
    1.61  	gFocusMgr.setDefaultKeyboardFocus(NULL);
    1.62  }
    1.63  
    1.64 -// virtual
    1.65 -void FSPanelLogin::draw()
    1.66 -{
    1.67 -	gGL.pushMatrix();
    1.68 -	{
    1.69 -		F32 image_aspect = 1.333333f;
    1.70 -		F32 view_aspect = (F32)getRect().getWidth() / (F32)getRect().getHeight();
    1.71 -		// stretch image to maintain aspect ratio
    1.72 -		if (image_aspect > view_aspect)
    1.73 -		{
    1.74 -			gGL.translatef(-0.5f * (image_aspect / view_aspect - 1.f) * getRect().getWidth(), 0.f, 0.f);
    1.75 -			gGL.scalef(image_aspect / view_aspect, 1.f, 1.f);
    1.76 -		}
    1.77 -
    1.78 -		S32 width = getRect().getWidth();
    1.79 -		S32 height = getRect().getHeight();
    1.80 -
    1.81 -		if (getChild<LLView>("login_widgets")->getVisible())
    1.82 -		{
    1.83 -			// draw a background box in black
    1.84 -			gl_rect_2d( 0, height - 264, width, 264, LLColor4::black );
    1.85 -			// draw the bottom part of the background image
    1.86 -			// just the blue background to the native client UI
    1.87 -			mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight());
    1.88 -		};
    1.89 -	}
    1.90 -	gGL.popMatrix();
    1.91 -
    1.92 -	LLPanel::draw();
    1.93 -}
    1.94 -
    1.95 -// virtual
    1.96 -BOOL FSPanelLogin::handleKeyHere(KEY key, MASK mask)
    1.97 -{
    1.98 -	if ( KEY_F1 == key )
    1.99 -	{
   1.100 -		LLViewerHelp* vhelp = LLViewerHelp::getInstance();
   1.101 -		vhelp->showTopic(vhelp->f1HelpTopic());
   1.102 -		return TRUE;
   1.103 -	}
   1.104 -
   1.105 -	return LLPanel::handleKeyHere(key, mask);
   1.106 -}
   1.107 -
   1.108  // virtual 
   1.109  void FSPanelLogin::setFocus(BOOL b)
   1.110  {
   1.111 @@ -483,7 +417,7 @@
   1.112  		// It seems to be part of the defunct? reg-in-client project.
   1.113  		sInstance->getChildView("login_widgets")->setVisible( true);
   1.114  		LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
   1.115 -		sInstance->reshapeBrowser();
   1.116 +
   1.117  		// *TODO: Append all the usual login parameters, like first_login=Y etc.
   1.118  		std::string splash_screen_url = LLGridManager::getInstance()->getLoginPage();
   1.119  		web_browser->navigateTo( splash_screen_url, HTTP_CONTENT_TEXT_HTML );
     2.1 --- a/indra/newview/fspanellogin.h	Wed Apr 20 14:50:21 2016 +0200
     2.2 +++ b/indra/newview/fspanellogin.h	Wed Apr 20 16:33:30 2016 +0200
     2.3 @@ -51,8 +51,6 @@
     2.4  				void *callback_data);
     2.5  	~FSPanelLogin();
     2.6  
     2.7 -	virtual BOOL handleKeyHere(KEY key, MASK mask);
     2.8 -	virtual void draw();
     2.9  	virtual void setFocus( BOOL b );
    2.10  
    2.11  	// Show the XUI first name, last name, and password widgets.  They are
    2.12 @@ -96,7 +94,6 @@
    2.13  
    2.14  private:
    2.15  	friend class LLPanelLoginListener;
    2.16 -	void reshapeBrowser();
    2.17  	void addFavoritesToStartLocation();
    2.18  	void addUsersToCombo(BOOL show_server);
    2.19  	void onSelectUser();
    2.20 @@ -119,8 +116,6 @@
    2.21  	static std::string credentialName();
    2.22  
    2.23  private:
    2.24 -	LLPointer<LLUIImage> mLogoImage;
    2.25 -
    2.26  	void			(*mCallback)(S32 option, void *userdata);
    2.27  	void*			mCallbackData;
    2.28  
     3.1 --- a/indra/newview/skins/default/xui/en/panel_fs_login.xml	Wed Apr 20 14:50:21 2016 +0200
     3.2 +++ b/indra/newview/skins/default/xui/en/panel_fs_login.xml	Wed Apr 20 16:33:30 2016 +0200
     3.3 @@ -1,13 +1,15 @@
     3.4  <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
     3.5  <panel
     3.6      follows="all"
     3.7 -    height="600"
     3.8 +    height="768"
     3.9      layout="topleft"
    3.10      left="0"
    3.11      name="panel_login"
    3.12      focus_root="true" 
    3.13 -    top="600"
    3.14 -    width="1130">
    3.15 +    background_visible="true"
    3.16 +    bg_opaque_color="0.16 0.16 0.16 1"
    3.17 +    background_opaque="true"
    3.18 +    width="1024">
    3.19    <panel.string
    3.20       name="real_url" translate="false">
    3.21       http://phoenixviewer.com/app/loginV3/
    3.22 @@ -19,20 +21,18 @@
    3.23        name="forgot_password_url">
    3.24      http://secondlife.com/account/request.php
    3.25    </panel.string>
    3.26 -  <!-- *NOTE: Custom resize logic for login_html in llpanellogin.cpp -->
    3.27    <web_browser
    3.28 -      tab_stop="false" 
    3.29 -      trusted_content="true" 
    3.30 +      tab_stop="false"
    3.31 +      trusted_content="true"
    3.32        bg_opaque_color="Black"
    3.33        border_visible="false"
    3.34 -      bottom="600"
    3.35        follows="all"
    3.36        left="0"
    3.37        name="login_html"
    3.38        start_url=""
    3.39 -      top="0"
    3.40 -      height="600"
    3.41 -      width="996"/>
    3.42 +      top="18"
    3.43 +      height="670"
    3.44 +      width="1024" />
    3.45    <layout_stack
    3.46        animate="false"
    3.47        clip="false"
    3.48 @@ -40,8 +40,8 @@
    3.49        name="login_widgets"
    3.50        layout="topleft"
    3.51        orientation="horizontal"
    3.52 -      top="519"
    3.53 -      width="1130"
    3.54 +      top="688"
    3.55 +      width="1024"
    3.56        height="80">
    3.57      <layout_panel
    3.58          auto_resize="false"

mercurial