diff options
author | richard <none@none> | 2009-11-02 19:28:24 -0800 |
---|---|---|
committer | richard <none@none> | 2009-11-02 19:28:24 -0800 |
commit | 995c18b1c7eb8fd23c0a35d5f504c03b7f2b144f (patch) | |
tree | 7449d6d56f4911d1587249429c05edafd50dc8ce /indra/llui | |
parent | a6b6ca9a24cbc1bfe0b3e45602e1eda1e1e9c8f9 (diff) |
removed picture_style from LLButton::Params and allow empty labels
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llbutton.cpp | 32 | ||||
-rw-r--r-- | indra/llui/llbutton.h | 5 | ||||
-rw-r--r-- | indra/llui/llfloater.cpp | 1 | ||||
-rw-r--r-- | indra/llui/llflyoutbutton.cpp | 1 | ||||
-rw-r--r-- | indra/llui/llmenugl.cpp | 2 | ||||
-rw-r--r-- | indra/llui/llscrollbar.cpp | 2 | ||||
-rw-r--r-- | indra/llui/lltabcontainer.cpp | 4 |
7 files changed, 11 insertions, 36 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index a7946cacf5..8daceb9485 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -95,8 +95,7 @@ LLButton::Params::Params() is_toggle("is_toggle", false), scale_image("scale_image", true), hover_glow_amount("hover_glow_amount"), - commit_on_return("commit_on_return", true), - picture_style("picture_style", false) + commit_on_return("commit_on_return", true) { addSynonym(is_toggle, "toggle"); held_down_delay.seconds = 0.5f; @@ -153,17 +152,9 @@ LLButton::LLButton(const LLButton::Params& p) static LLUICachedControl<S32> llbutton_orig_h_pad ("UIButtonOrigHPad", 0); static Params default_params(LLUICtrlFactory::getDefaultParams<LLButton>()); - //if we aren't a picture_style button set label as name if not provided - if (!p.picture_style.isProvided() || !p.picture_style) + if (!p.label_selected.isProvided()) { - if (!p.label.isProvided()) - { - mUnselectedLabel = p.name(); - } - if (!p.label_selected.isProvided()) - { - mSelectedLabel = mUnselectedLabel.getString(); - } + mSelectedLabel = mUnselectedLabel; } // Hack to make sure there is space for at least one character @@ -1099,19 +1090,4 @@ void LLButton::resetMouseDownTimer() { mMouseDownTimer.stop(); mMouseDownTimer.reset(); -} - - -// *TODO: Remove this function after the initial XUI XML re-export pass. -// static -void LLButton::setupParamsForExport(Params& p, LLView* parent) -{ - std::string label = p.label; - if (label.empty()) - { - //if our label is empty this is a picture style button - p.picture_style = true; - } - - LLUICtrl::setupParamsForExport(p, parent); -} +}
\ No newline at end of file diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 85580a98bf..08f289092f 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -115,8 +115,7 @@ public: // misc Optional<bool> is_toggle, scale_image, - commit_on_return, - picture_style; //if true, don't display label + commit_on_return; Optional<F32> hover_glow_amount; Optional<TimeIntervalParam> held_down_delay; @@ -247,8 +246,6 @@ protected: LLFrameTimer mMouseDownTimer; - // If the label is empty, set the picture_style attribute - static void setupParamsForExport(Params& p, LLView* parent); private: void drawBorder(LLUIImage* imagep, const LLColor4& color, S32 size); void resetMouseDownTimer(); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 26a8b6c48f..90ba2dc41f 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1826,7 +1826,6 @@ void LLFloater::buildButtons() LLButton::Params p; p.name(sButtonNames[i]); p.rect(btn_rect); - p.label(""); p.image_unselected.name(sButtonActiveImageNames[i]); // Selected, no matter if hovered or not, is "pressed" p.image_selected.name(sButtonPressedImageNames[i]); diff --git a/indra/llui/llflyoutbutton.cpp b/indra/llui/llflyoutbutton.cpp index 3483bac782..abb0b869eb 100644 --- a/indra/llui/llflyoutbutton.cpp +++ b/indra/llui/llflyoutbutton.cpp @@ -48,6 +48,7 @@ LLFlyoutButton::LLFlyoutButton(const Params& p) // Text label button LLButton::Params bp(p.action_button); bp.name(p.label); + bp.label(p.label); bp.rect.left(0).bottom(0).width(getRect().getWidth() - FLYOUT_BUTTON_ARROW_WIDTH).height(getRect().getHeight()); bp.click_callback.function(boost::bind(&LLFlyoutButton::onActionButtonClick, this, _2)); bp.follows.flags(FOLLOWS_ALL); diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 91e7e46195..7847cc1790 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -1555,8 +1555,6 @@ LLMenuScrollItem::LLMenuScrollItem(const Params& p) } LLButton::Params bparams; - bparams.label(""); - bparams.label_selected(""); bparams.mouse_opaque(true); bparams.scale_image(false); bparams.click_callback(p.scroll_callback); diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index dfd315d451..b450ecbbf9 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -115,6 +115,7 @@ LLScrollbar::LLScrollbar(const Params & p) LLButton::Params up_btn(mOrientation == VERTICAL ? p.up_button : p.left_button); up_btn.name(std::string("Line Up")); + up_btn.label(std::string("Line Up")); up_btn.rect(line_up_rect); up_btn.click_callback.function(boost::bind(&LLScrollbar::onLineUpBtnPressed, this, _2)); up_btn.mouse_held_callback.function(boost::bind(&LLScrollbar::onLineUpBtnPressed, this, _2)); @@ -125,6 +126,7 @@ LLScrollbar::LLScrollbar(const Params & p) LLButton::Params down_btn(mOrientation == VERTICAL ? p.down_button : p.right_button); down_btn.name(std::string("Line Down")); + down_btn.label(std::string("Line Down")); down_btn.rect(line_down_rect); down_btn.follows.flags(FOLLOWS_RIGHT|FOLLOWS_BOTTOM); down_btn.click_callback.function(boost::bind(&LLScrollbar::onLineDownBtnPressed, this, _2)); diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index cde4c75518..6ca9c4ceda 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -927,7 +927,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) textbox = LLUICtrlFactory::create<LLTextBox> (params); LLButton::Params p; - p.name(""); + p.name("placeholder"); btn = LLUICtrlFactory::create<LLButton>(p); } else @@ -1645,6 +1645,7 @@ void LLTabContainer::initButtons() LLButton::Params prev_btn_params; prev_btn_params.name(std::string("Up Arrow")); + prev_btn_params.label(std::string("Up Arrow")); prev_btn_params.rect(up_arrow_btn_rect); prev_btn_params.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT); prev_btn_params.image_unselected.name("scrollbutton_up_out_blue.tga"); @@ -1654,6 +1655,7 @@ void LLTabContainer::initButtons() LLButton::Params next_btn_params; next_btn_params.name(std::string("Down Arrow")); + next_btn_params.label(std::string("Down Arrow")); next_btn_params.rect(down_arrow_btn_rect); next_btn_params.follows.flags(FOLLOWS_BOTTOM | FOLLOWS_LEFT); next_btn_params.image_unselected.name("scrollbutton_down_out_blue.tga"); |