From bc5ad04d6164d186cf504212ea559405b8608811 Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Fri, 5 Feb 2010 09:41:54 +0200 Subject: applying patch for EXT-2357 --HG-- branch : product-engine --- indra/llui/lltabcontainer.cpp | 152 +++++++++++++++++++++++++++++++++++++++--- indra/llui/lltabcontainer.h | 26 +++++++- 2 files changed, 169 insertions(+), 9 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 6be76605fd..52fc2adb25 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -35,7 +35,6 @@ #include "lltabcontainer.h" #include "llfocusmgr.h" -#include "llbutton.h" #include "lllocalcliprect.h" #include "llrect.h" #include "llresizehandle.h" @@ -96,6 +95,92 @@ public: //---------------------------------------------------------------------------- +//============================================================================ +/* + * @file lltabcontainer.cpp + * @brief class implements LLButton with LLIconCtrl on it + */ +class LLCustomButtonIconCtrl : public LLButton +{ +public: + struct Params + : public LLInitParam::Block + { + // LEFT, RIGHT, TOP, BOTTOM paddings of LLIconCtrl in this class has same value + Optional icon_ctrl_pad; + + Optional icon_ctrl_width, + icon_ctrl_height; + Params(): + icon_ctrl_pad("icon_ctrl_pad", 0), + icon_ctrl_width("icon_ctrl_width", 16), + icon_ctrl_height("icon_ctrl_height", 16) + {} + }; + +protected: + friend class LLUICtrlFactory; + LLCustomButtonIconCtrl(const Params& p): + LLButton(p), + mIcon(NULL), + mIconCtrlPad(p.icon_ctrl_pad), + mIconCtrlWidht(p.icon_ctrl_width), + mIconCtrlHeight(p.icon_ctrl_height) + {} + +public: + + void updateLayout() + { + LLRect button_rect = getRect(); + LLRect icon_rect = mIcon->getRect(); + S32 pad = mIconCtrlPad * 2; + + switch(mIconAlignment) + { + case LLFontGL::LEFT: + icon_rect.setLeftTopAndSize(button_rect.mLeft + mIconCtrlPad, button_rect.mTop - mIconCtrlPad, mIconCtrlWidht - pad, mIconCtrlHeight - pad); + setLeftHPad(mIconCtrlWidht + pad); + break; + case LLFontGL::HCENTER: + //*TODO implement for HCENTER icon alignment + break; + case LLFontGL::RIGHT: + //*TODO implement for RIGHT icon alignment + break; + default: + break; + } + mIcon->setRect(icon_rect); + } + + void setIcon(LLIconCtrl* icon, LLFontGL::HAlign alignment = LLFontGL::LEFT) + { + if(icon) + { + if(mIcon) + { + removeChild(mIcon); + mIcon->die(); + } + mIcon = icon; + mIconAlignment = alignment; + + addChild(mIcon); + updateLayout(); + } + } + + +private: + LLIconCtrl* mIcon; + LLFontGL::HAlign mIconAlignment; + S32 mIconCtrlPad; + S32 mIconCtrlWidht; + S32 mIconCtrlHeight; +}; +//============================================================================ + struct LLPlaceHolderPanel : public LLPanel { // create dummy param block to register with "placeholder" nane @@ -127,7 +212,12 @@ LLTabContainer::Params::Params() tab_padding_right("tab_padding_right"), first_tab("first_tab"), middle_tab("middle_tab"), - last_tab("last_tab") + last_tab("last_tab"), + use_custom_icon_ctrl("use_custom_icon_ctrl", false), + tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0), + tab_icon_ctrl_width("tab_icon_ctrl_width"), + tab_icon_ctrl_height("tab_icon_ctrl_height") + { name(std::string("tab_container")); mouse_opaque = false; @@ -162,7 +252,11 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) mFont(p.font), mFirstTabParams(p.first_tab), mMiddleTabParams(p.middle_tab), - mLastTabParams(p.last_tab) + mLastTabParams(p.last_tab), + mCustomIconCtrlUsed(p.use_custom_icon_ctrl), + mTabIconCtrlPad(p.tab_icon_ctrl_pad), + mTabIconCtrlWidth(p.tab_icon_ctrl_width), + mTabIconCtrlHeight(p.tab_icon_ctrl_height) { static LLUICachedControl tabcntr_vert_tab_min_width ("UITabCntrVertTabMinWidth", 0); @@ -942,7 +1036,14 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) { p.pad_left(indent); } - btn = LLUICtrlFactory::create(p); + if(mCustomIconCtrlUsed) + { + btn = createCustomButton(p); + } + else + { + btn = LLUICtrlFactory::create(p); + } } else { @@ -980,7 +1081,14 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) p.follows.flags = p.follows.flags() | FOLLOWS_BOTTOM; } -++ btn = LLUICtrlFactory::create(p); + if(mCustomIconCtrlUsed) + { + btn = createCustomButton(p); + } + else + { + btn = LLUICtrlFactory::create(p); + } } } @@ -1043,6 +1151,19 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) updateMaxScrollPos(); } +LLButton* LLTabContainer::createCustomButton(const LLButton::Params& p) +{ + LLCustomButtonIconCtrl::Params custom_btn_params; + LLButton::Params* btn_params_p = dynamic_cast(&custom_btn_params); + + btn_params_p->overwriteFrom(p); + custom_btn_params.icon_ctrl_pad(mTabIconCtrlPad); + custom_btn_params.icon_ctrl_width(mTabIconCtrlWidth); + custom_btn_params.icon_ctrl_height(mTabIconCtrlHeight); + + return LLUICtrlFactory::create(custom_btn_params); +} + void LLTabContainer::addPlaceholder(LLPanel* child, const std::string& label) { addTabPanel(TabPanelParams().panel(child).label(label).is_placeholder(true)); @@ -1484,7 +1605,7 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const L if( tuple ) { tuple->mButton->setImageOverlay(image_name, LLFontGL::LEFT, color); - reshape_tuple(tuple); + reshapeTuple(tuple); } } @@ -1494,11 +1615,26 @@ void LLTabContainer::setTabImage(LLPanel* child, const LLUUID& image_id, const L if( tuple ) { tuple->mButton->setImageOverlay(image_id, LLFontGL::LEFT, color); - reshape_tuple(tuple); + reshapeTuple(tuple); + } +} + +void LLTabContainer::setTabImage(LLPanel* child, LLIconCtrl* icon) +{ + LLTabTuple* tuple = getTabByPanel(child); + LLCustomButtonIconCtrl* button; + + if(tuple) + { + button = dynamic_cast(tuple->mButton); + if(button) + { + button->setIcon(icon); + } } } -void LLTabContainer::reshape_tuple(LLTabTuple* tuple) +void LLTabContainer::reshapeTuple(LLTabTuple* tuple) { static LLUICachedControl tab_padding ("UITabPadding", 0); static LLUICachedControl image_left_padding ("UIButtonImageLeftPadding", 4); diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 2a55877d3c..278cf01375 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -36,6 +36,8 @@ #include "llpanel.h" #include "lltextbox.h" #include "llframetimer.h" +#include "lliconctrl.h" +#include "llbutton.h" class LLTabTuple; @@ -90,6 +92,21 @@ public: middle_tab, last_tab; + /** + * Use LLCustomButtonIconCtrl or LLButton in LLTabTuple + */ + Optional use_custom_icon_ctrl; + + /** + * Paddings for LLIconCtrl in case of LLCustomButtonIconCtrl usage(use_custom_icon_ctrl = true) + */ + Optional tab_icon_ctrl_pad; + /** + * LLIconCtrl size + */ + Optional tab_icon_ctrl_width, + tab_icon_ctrl_height; + Params(); }; @@ -173,6 +190,7 @@ public: void setTabPanelFlashing(LLPanel* child, BOOL state); void setTabImage(LLPanel* child, std::string img_name, const LLColor4& color = LLColor4::white); void setTabImage(LLPanel* child, const LLUUID& img_id, const LLColor4& color = LLColor4::white); + void setTabImage(LLPanel* child, LLIconCtrl* icon); void setTitle( const std::string& title ); const std::string getPanelTitle(S32 index); @@ -228,7 +246,8 @@ private: // updates tab button images given the tuple, tab position and the corresponding params void update_images(LLTabTuple* tuple, TabParams params, LLTabContainer::TabPosition pos); - void reshape_tuple(LLTabTuple* tuple); + void reshapeTuple(LLTabTuple* tuple); + LLButton* createCustomButton(const LLButton::Params& p); // Variables @@ -278,6 +297,11 @@ private: TabParams mFirstTabParams; TabParams mMiddleTabParams; TabParams mLastTabParams; + + bool mCustomIconCtrlUsed; + S32 mTabIconCtrlPad; + S32 mTabIconCtrlHeight; + S32 mTabIconCtrlWidth; }; #endif // LL_TABCONTAINER_H -- cgit v1.2.3 From 553cf40d136e70f4819cb2b72d0483287db81b17 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Fri, 5 Feb 2010 12:25:18 +0200 Subject: Updated low bug EXT-4951 - Redundant edit box context menu in list items in Panel Picks/Classifieds. Reverted changeset 8956:930bef051fee. Added new parameter to control context menu visibility. --HG-- branch : product-engine --- indra/llui/lltexteditor.cpp | 8 +++++--- indra/llui/lltexteditor.h | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 3fdb48b3ca..ac5a0376fc 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -242,7 +242,8 @@ LLTextEditor::Params::Params() handle_edit_keys_directly("handle_edit_keys_directly", false), show_line_numbers("show_line_numbers", false), default_color("default_color"), - commit_on_focus_lost("commit_on_focus_lost", false) + commit_on_focus_lost("commit_on_focus_lost", false), + show_context_menu("show_context_menu") {} LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) : @@ -258,7 +259,8 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) : mMouseDownX(0), mMouseDownY(0), mTabsToNextField(p.ignore_tab), - mContextMenu(NULL) + mContextMenu(NULL), + mShowContextMenu(p.show_context_menu) { mDefaultFont = p.font; @@ -720,7 +722,7 @@ BOOL LLTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) } if (!LLTextBase::handleRightMouseDown(x, y, mask)) { - if(getMouseOpaque()) + if(getChowContextMenu()) { showContextMenu(x, y); } diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index a136f9ccce..d96198d9ce 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -68,7 +68,8 @@ public: ignore_tab, handle_edit_keys_directly, show_line_numbers, - commit_on_focus_lost; + commit_on_focus_lost, + show_context_menu; //colors Optional default_color; @@ -200,6 +201,9 @@ public: const LLTextSegmentPtr getPreviousSegment() const; void getSelectedSegments(segment_vec_t& segments) const; + void setShowContextMenu(bool show) { mShowContextMenu = show; } + bool getChowContextMenu() const { return mShowContextMenu; } + protected: void showContextMenu(S32 x, S32 y); void drawPreeditMarker(); @@ -319,6 +323,7 @@ private: BOOL mTakesFocus; BOOL mAllowEmbeddedItems; + bool mShowContextMenu; LLUUID mSourceID; -- cgit v1.2.3 From b79b8f87a37888decd3f82e9e255cce641a3955f Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Fri, 5 Feb 2010 13:03:26 +0200 Subject: finished with EXT-2753 - Implement Avatar icons on IM multifloater tabs add floater flashing, fix group icon sizes, fix click,some code cleanup, ect. also I remove mIconCtrlWidth/Height since its kinda useless - mIconCtrlPad do the same thing... IconSize will be btn_height-2*mIconCtrlPad - simple and good enough. --HG-- branch : product-engine --- indra/llui/lltabcontainer.cpp | 65 ++++++++++++++++++------------------------- indra/llui/lltabcontainer.h | 8 ------ 2 files changed, 27 insertions(+), 46 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 52fc2adb25..d959d3099c 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -109,12 +109,8 @@ public: // LEFT, RIGHT, TOP, BOTTOM paddings of LLIconCtrl in this class has same value Optional icon_ctrl_pad; - Optional icon_ctrl_width, - icon_ctrl_height; Params(): - icon_ctrl_pad("icon_ctrl_pad", 0), - icon_ctrl_width("icon_ctrl_width", 16), - icon_ctrl_height("icon_ctrl_height", 16) + icon_ctrl_pad("icon_ctrl_pad", 1) {} }; @@ -123,9 +119,7 @@ protected: LLCustomButtonIconCtrl(const Params& p): LLButton(p), mIcon(NULL), - mIconCtrlPad(p.icon_ctrl_pad), - mIconCtrlWidht(p.icon_ctrl_width), - mIconCtrlHeight(p.icon_ctrl_height) + mIconCtrlPad(p.icon_ctrl_pad) {} public: @@ -134,19 +128,23 @@ public: { LLRect button_rect = getRect(); LLRect icon_rect = mIcon->getRect(); - S32 pad = mIconCtrlPad * 2; + + S32 icon_size = button_rect.getHeight() - 2*mIconCtrlPad; switch(mIconAlignment) { case LLFontGL::LEFT: - icon_rect.setLeftTopAndSize(button_rect.mLeft + mIconCtrlPad, button_rect.mTop - mIconCtrlPad, mIconCtrlWidht - pad, mIconCtrlHeight - pad); - setLeftHPad(mIconCtrlWidht + pad); + icon_rect.setLeftTopAndSize(button_rect.mLeft + mIconCtrlPad, button_rect.mTop - mIconCtrlPad, + icon_size, icon_size); + setLeftHPad(icon_size + mIconCtrlPad * 2); break; case LLFontGL::HCENTER: //*TODO implement for HCENTER icon alignment break; case LLFontGL::RIGHT: - //*TODO implement for RIGHT icon alignment + icon_rect.setLeftTopAndSize(button_rect.mRight - mIconCtrlPad - icon_size, button_rect.mTop - mIconCtrlPad, + icon_size, icon_size); + setRightHPad(icon_size + mIconCtrlPad * 2); break; default: break; @@ -176,8 +174,6 @@ private: LLIconCtrl* mIcon; LLFontGL::HAlign mIconAlignment; S32 mIconCtrlPad; - S32 mIconCtrlWidht; - S32 mIconCtrlHeight; }; //============================================================================ @@ -214,10 +210,7 @@ LLTabContainer::Params::Params() middle_tab("middle_tab"), last_tab("last_tab"), use_custom_icon_ctrl("use_custom_icon_ctrl", false), - tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0), - tab_icon_ctrl_width("tab_icon_ctrl_width"), - tab_icon_ctrl_height("tab_icon_ctrl_height") - + tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0) { name(std::string("tab_container")); mouse_opaque = false; @@ -254,9 +247,7 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) mMiddleTabParams(p.middle_tab), mLastTabParams(p.last_tab), mCustomIconCtrlUsed(p.use_custom_icon_ctrl), - mTabIconCtrlPad(p.tab_icon_ctrl_pad), - mTabIconCtrlWidth(p.tab_icon_ctrl_width), - mTabIconCtrlHeight(p.tab_icon_ctrl_height) + mTabIconCtrlPad(p.tab_icon_ctrl_pad) { static LLUICachedControl tabcntr_vert_tab_min_width ("UITabCntrVertTabMinWidth", 0); @@ -999,6 +990,11 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) LLTextBox* textbox = NULL; LLButton* btn = NULL; + LLCustomButtonIconCtrl::Params custom_btn_params; + { + custom_btn_params.icon_ctrl_pad(mTabIconCtrlPad); + } + LLButton::Params normal_btn_params; if (placeholder) { @@ -1018,7 +1014,9 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) { if (mIsVertical) { - LLButton::Params p; + LLButton::Params& p = (mCustomIconCtrlUsed)? + custom_btn_params:normal_btn_params; + p.name(std::string("vert tab button")); p.rect(btn_rect); p.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT); @@ -1036,9 +1034,12 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) { p.pad_left(indent); } + + if(mCustomIconCtrlUsed) { - btn = createCustomButton(p); + btn = LLUICtrlFactory::create(custom_btn_params); + } else { @@ -1047,7 +1048,8 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) } else { - LLButton::Params p; + LLButton::Params& p = (mCustomIconCtrlUsed)? + custom_btn_params:normal_btn_params; p.name(std::string(child->getName()) + " tab"); p.rect(btn_rect); p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child)); @@ -1083,7 +1085,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) if(mCustomIconCtrlUsed) { - btn = createCustomButton(p); + btn = LLUICtrlFactory::create(custom_btn_params); } else { @@ -1151,19 +1153,6 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) updateMaxScrollPos(); } -LLButton* LLTabContainer::createCustomButton(const LLButton::Params& p) -{ - LLCustomButtonIconCtrl::Params custom_btn_params; - LLButton::Params* btn_params_p = dynamic_cast(&custom_btn_params); - - btn_params_p->overwriteFrom(p); - custom_btn_params.icon_ctrl_pad(mTabIconCtrlPad); - custom_btn_params.icon_ctrl_width(mTabIconCtrlWidth); - custom_btn_params.icon_ctrl_height(mTabIconCtrlHeight); - - return LLUICtrlFactory::create(custom_btn_params); -} - void LLTabContainer::addPlaceholder(LLPanel* child, const std::string& label) { addTabPanel(TabPanelParams().panel(child).label(label).is_placeholder(true)); diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 278cf01375..4b5d45fb73 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -101,11 +101,6 @@ public: * Paddings for LLIconCtrl in case of LLCustomButtonIconCtrl usage(use_custom_icon_ctrl = true) */ Optional tab_icon_ctrl_pad; - /** - * LLIconCtrl size - */ - Optional tab_icon_ctrl_width, - tab_icon_ctrl_height; Params(); }; @@ -247,7 +242,6 @@ private: // updates tab button images given the tuple, tab position and the corresponding params void update_images(LLTabTuple* tuple, TabParams params, LLTabContainer::TabPosition pos); void reshapeTuple(LLTabTuple* tuple); - LLButton* createCustomButton(const LLButton::Params& p); // Variables @@ -300,8 +294,6 @@ private: bool mCustomIconCtrlUsed; S32 mTabIconCtrlPad; - S32 mTabIconCtrlHeight; - S32 mTabIconCtrlWidth; }; #endif // LL_TABCONTAINER_H -- cgit v1.2.3 From cc0895b90039a6446f7c9a0ab71518d445175c0f Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Fri, 5 Feb 2010 13:20:12 +0200 Subject: a bit more on EXT-2753. --HG-- branch : product-engine --- indra/llui/lltabcontainer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index d959d3099c..19408989a5 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -139,7 +139,9 @@ public: setLeftHPad(icon_size + mIconCtrlPad * 2); break; case LLFontGL::HCENTER: - //*TODO implement for HCENTER icon alignment + icon_rect.setLeftTopAndSize(button_rect.mRight - (button_rect.getWidth() + mIconCtrlPad - icon_size)/2, button_rect.mTop - mIconCtrlPad, + icon_size, icon_size); + setRightHPad(icon_size + mIconCtrlPad * 2); break; case LLFontGL::RIGHT: icon_rect.setLeftTopAndSize(button_rect.mRight - mIconCtrlPad - icon_size, button_rect.mTop - mIconCtrlPad, -- cgit v1.2.3 From 782cb6ee87f1180101fbcb5b6403871dea345fd0 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Fri, 5 Feb 2010 17:09:22 +0200 Subject: Fixed normal bug EXT-4702 (Elements of type context_menu cannot have font set in XUI xml) --HG-- branch : product-engine --- indra/llui/llmenugl.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 7fa9a88059..d18abbfb2f 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3941,7 +3941,6 @@ BOOL LLContextMenu::appendContextSubMenu(LLContextMenu *menu) item = LLUICtrlFactory::create(p); LLMenuGL::sMenuContainer->addChild(item->getBranch()); - item->setFont( LLFontGL::getFontSansSerif() ); return append( item ); } -- cgit v1.2.3 From 77b5a39cc1daa79ceea599aea3f680127c9949b1 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Fri, 5 Feb 2010 17:34:50 +0200 Subject: Fixed normal bug EXT - 3232 (Make button image overlay placement adjustable via xml) --HG-- branch : product-engine --- indra/llui/llbutton.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 4944ed4fe7..14b77925f2 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -771,12 +771,7 @@ void LLButton::draw() center_x++; } - S32 text_width_delta = overlay_width + 1; - // if image paddings set, they should participate in scaling process - S32 image_size_delta = mImageOverlayTopPad + mImageOverlayBottomPad; - overlay_width = overlay_width - image_size_delta; - overlay_height = overlay_height - image_size_delta; - + center_y += (mImageOverlayBottomPad - mImageOverlayTopPad); // fade out overlay images on disabled buttons LLColor4 overlay_color = mImageOverlayColor.get(); if (!enabled) @@ -788,10 +783,9 @@ void LLButton::draw() switch(mImageOverlayAlignment) { case LLFontGL::LEFT: - text_left += overlay_width + mImageOverlayRightPad + 1; - text_width -= text_width_delta; + text_left += overlay_width + 1; mImageOverlay->draw( - mLeftHPad, + mImageOverlayLeftPad, center_y - (overlay_height / 2), overlay_width, overlay_height, @@ -806,10 +800,9 @@ void LLButton::draw() overlay_color); break; case LLFontGL::RIGHT: - text_right -= overlay_width + mImageOverlayLeftPad+ 1; - text_width -= text_width_delta; + text_right -= overlay_width + 1; mImageOverlay->draw( - getRect().getWidth() - mRightHPad - overlay_width, + getRect().getWidth() - mImageOverlayRightPad - overlay_width, center_y - (overlay_height / 2), overlay_width, overlay_height, -- cgit v1.2.3