diff options
-rw-r--r-- | indra/llui/lltextbox.cpp | 26 | ||||
-rw-r--r-- | indra/llui/lltextbox.h | 21 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/inspect_group.xml | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_login.xml | 33 |
4 files changed, 37 insertions, 47 deletions
diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 20bceb4675..00f1d833a3 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -45,6 +45,9 @@ LLTextBox::LLTextBox(const LLTextBox::Params& p) mClickedCallback(NULL) {} +LLTextBox::~LLTextBox() +{} + BOOL LLTextBox::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = LLTextBase::handleMouseDown(x, y, mask); @@ -97,6 +100,18 @@ BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask) return handled; } +BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask) +{ + BOOL handled = LLTextBase::handleHover(x, y, mask); + if (!handled && mClickedCallback) + { + // Clickable text boxes change the cursor to a hand + LLUI::getWindow()->setCursor(UI_CURSOR_HAND); + return TRUE; + } + return handled; +} + void LLTextBox::setText(const LLStringExplicit& text) { // does string argument insertion @@ -105,6 +120,11 @@ void LLTextBox::setText(const LLStringExplicit& text) LLTextBase::setText(mText.getString()); } +void LLTextBox::setClickedCallback( boost::function<void (void*)> cb, void* userdata /*= NULL */ ) +{ + mClickedCallback = boost::bind(cb, userdata); +} + S32 LLTextBox::getTextPixelWidth() { return getContentsRect().getWidth(); @@ -115,6 +135,12 @@ S32 LLTextBox::getTextPixelHeight() return getContentsRect().getHeight(); } + +LLSD LLTextBox::getValue() const +{ + return LLSD(getText()); +} + BOOL LLTextBox::setTextArg( const std::string& key, const LLStringExplicit& text ) { mText.setArg(key, text); diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index da0bcbe972..73f8a7c299 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -33,8 +33,6 @@ #ifndef LL_LLTEXTBOX_H #define LL_LLTEXTBOX_H -#include "v4color.h" -#include "llstring.h" #include "lluistring.h" #include "lltextbase.h" @@ -54,28 +52,25 @@ protected: friend class LLUICtrlFactory; public: - virtual ~LLTextBox() {} + virtual ~LLTextBox(); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ void setText( const LLStringExplicit& text ); + /*virtual*/ void setText( const LLStringExplicit& text ); void setRightAlign() { mHAlign = LLFontGL::RIGHT; } void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } - void setClickedCallback( boost::function<void (void*)> cb, void* userdata = NULL ){ mClickedCallback = boost::bind(cb, userdata); } // mouse down and up within button - - //const LLFontGL* getFont() const { return mDefaultFont; } - //void setFont(const LLFontGL* font) { mDefaultFont = font; } + void setClickedCallback( boost::function<void (void*)> cb, void* userdata = NULL ); void reshapeToFitText(); - //const std::string& getText() const { return mText.getString(); } S32 getTextPixelWidth(); S32 getTextPixelHeight(); - virtual LLSD getValue() const { return LLSD(getText()); } - virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); + /*virtual*/ LLSD getValue() const; + /*virtual*/ BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); protected: void onUrlLabelUpdated(const std::string &url, const std::string &label); diff --git a/indra/newview/skins/default/xui/en/inspect_group.xml b/indra/newview/skins/default/xui/en/inspect_group.xml index db12daa6e0..42a492090d 100644 --- a/indra/newview/skins/default/xui/en/inspect_group.xml +++ b/indra/newview/skins/default/xui/en/inspect_group.xml @@ -73,6 +73,8 @@ L$123 to join name="group_icon" top="24" width="38" /> + <!-- Must be tab_stop="true" so something can hold focus even when the + other buttons are disabled or invisible, otherwise inspector closes --> <button follows="top|left" height="18" @@ -84,7 +86,7 @@ L$123 to join right="-8" top="35" left_delta="110" - tab_stop="false" + tab_stop="true" width="18" commit_callback.function="InspectGroup.ViewProfile" /> <button diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index afe00271f7..317c79e08f 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -23,19 +23,15 @@ border_visible="false" bottom="600" follows="all" - layout="topleft" left="0" name="login_html" right="-1" start_url="" top="1" /> <text - type="string" - length="1" follows="left|bottom" font="SansSerif" height="16" - layout="topleft" left="32" name="first_name_text" top="530" @@ -46,7 +42,6 @@ follows="left|bottom" handle_edit_keys_directly="true" height="20" - layout="topleft" left_delta="0" max_length="31" name="first_name_edit" @@ -55,12 +50,9 @@ top_pad="2" width="120" /> <text - type="string" - length="1" follows="left|bottom" font="SansSerif" height="16" - layout="topleft" left="164" name="last_name_text" top="530" @@ -72,7 +64,6 @@ font="SansSerif" handle_edit_keys_directly="true" height="20" - layout="topleft" left_delta="0" max_length="31" name="last_name_edit" @@ -81,12 +72,9 @@ top_pad="2" width="120" /> <text - type="string" - length="1" follows="left|bottom" font="SansSerif" height="16" - layout="topleft" left="296" name="password_text" top="530" @@ -98,7 +86,6 @@ font="SansSerif" handle_edit_keys_directly="true" height="20" - layout="topleft" left_delta="0" max_length="16" name="password_edit" @@ -124,12 +111,9 @@ name="server_combo" width="100" /> <text - type="string" - length="1" follows="left|bottom" font="SansSerif" height="16" - layout="topleft" left="32" name="start_location_text" top="576" @@ -141,7 +125,6 @@ control_name="LoginLocation" follows="left|bottom" height="23" - layout="topleft" left_pad="0" max_chars="128" name="start_location_combo" @@ -165,20 +148,14 @@ follows="left|bottom" height="16" label="Remember password" - layout="topleft" left_pad="10" name="remember_check" top_delta="3" width="138" /> <text - type="string" - length="1" follows="right|bottom" halign="right" height="16" - hover="true" - hover_color="0.2 0.45 0.72 1" - layout="topleft" left="-210" name="create_new_account_text" top="539" @@ -186,14 +163,9 @@ Create a new account </text> <text - type="string" - length="1" follows="right|bottom" halign="right" height="16" - hover="true" - hover_color="0.2 0.45 0.72 1" - layout="topleft" left_delta="0" name="forgot_password_text" top_pad="4" @@ -201,14 +173,9 @@ Forgot your name or password? </text> <text - type="string" - length="1" follows="right|bottom" halign="right" height="16" - hover="true" - hover_color="0.2 0.45 0.72 1" - layout="topleft" left="-310" name="channel_text" top="579" |