From 6a49f2947f05963c577a1644c16a8affc779da63 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 28 Sep 2011 16:25:32 -0700 Subject: EXP-1234 WIP experimental drag and drop --- indra/llui/lltoolbar.cpp | 93 ++++++++++++++++++++++++++++++-------------- indra/llui/lltoolbar.h | 16 +++++++- indra/llui/lltoolbarview.cpp | 41 ++++++++++++++++++- indra/llui/lltoolbarview.h | 9 ++++- indra/llui/llview.h | 14 +++++++ 5 files changed, 140 insertions(+), 33 deletions(-) diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index c5219b11e8..fe989cee22 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -33,6 +33,7 @@ #include "llcommandmanager.h" #include "llmenugl.h" #include "lltrans.h" +#include "lltoolbarview.h" // uncomment this and remove the one in llui.cpp when there is an external reference to this translation unit // thanks, MSVC! @@ -201,35 +202,27 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p) bool LLToolBar::addCommand(const LLCommandId& commandId) { LLCommand * command = LLCommandManager::instance().getCommand(commandId); + if (!command) return false; - bool add_command = (command != NULL); - - if (add_command) - { - mButtonCommands.push_back(commandId); - createButton(commandId); - } + mButtonCommands.push_back(commandId); + LLToolBarButton* button = createButton(commandId); + mButtons.push_back(button); + mButtonPanel->addChild(button); + mButtonMap.insert(std::make_pair(commandId, button)); + mNeedsLayout = true; - return add_command; + return true; } bool LLToolBar::hasCommand(const LLCommandId& commandId) const { - bool has_command = false; - if (commandId != LLCommandId::null) { - BOOST_FOREACH(LLCommandId cmd, mButtonCommands) - { - if (cmd == commandId) - { - has_command = true; - break; - } - } + command_id_map::const_iterator it = mButtonMap.find(commandId); + return (it != mButtonMap.end()); } - return has_command; + return false; } bool LLToolBar::enableCommand(const LLCommandId& commandId, bool enabled) @@ -238,11 +231,10 @@ bool LLToolBar::enableCommand(const LLCommandId& commandId, bool enabled) if (commandId != LLCommandId::null) { - command_button = mButtonPanel->findChild(commandId.name()); - - if (command_button) + command_id_map::iterator it = mButtonMap.find(commandId); + if (it != mButtonMap.end()) { - command_button->setEnabled(enabled); + it->second->setEnabled(enabled); } } @@ -498,15 +490,19 @@ void LLToolBar::createButtons() BOOST_FOREACH(LLCommandId& command_id, mButtonCommands) { - createButton(command_id); + LLToolBarButton* button = createButton(command_id); + mButtons.push_back(button); + mButtonPanel->addChild(button); + mButtonMap.insert(std::make_pair(command_id, button)); } + mNeedsLayout = true; } -void LLToolBar::createButton(const LLCommandId& id) +LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) { LLCommand* commandp = LLCommandManager::instance().getCommand(id); - if (!commandp) return; + if (!commandp) return NULL; LLToolBarButton::Params button_p; button_p.label = LLTrans::getString(commandp->labelRef()); @@ -515,8 +511,47 @@ void LLToolBar::createButton(const LLCommandId& id) button_p.overwriteFrom(mButtonParams[mButtonType]); LLToolBarButton* button = LLUICtrlFactory::create(button_p); - mButtons.push_back(button); - mButtonPanel->addChild(button); + button->setCommandId(id); + return button; +} - mNeedsLayout = true; +// +// LLToolBarButton +// + +LLToolBarButton::LLToolBarButton(const Params& p) +: LLButton(p), + mMouseDownX(0), + mMouseDownY(0), + mId("") +{} + + +BOOL LLToolBarButton::handleMouseDown(S32 x, S32 y, MASK mask) +{ + mMouseDownX = x; + mMouseDownY = y; + return LLButton::handleMouseDown(x, y, mask); +} + +BOOL LLToolBarButton::handleHover(S32 x, S32 y, MASK mask) +{ + if (hasMouseCapture()) + { + S32 dist_squared = (x - mMouseDownX) * (x - mMouseDownX) + (y - mMouseDownY) * (y - mMouseDownY); + S32 threshold = LLUI::sSettingGroups["config"]->getS32("DragAndDropDistanceThreshold"); + S32 threshold_squared = threshold * threshold; + if (dist_squared > threshold_squared) + { + // start drag and drop + LLToolBarView* view = getParentByType(); + LLToolBar* bar = getParentByType(); + if (view) + { + view->startDrag(bar->createButton(mId)); + setVisible(FALSE); + } + } + } + return LLButton::handleHover(x, y, mask); } diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 8e484c7e13..77bac87dbc 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -42,7 +42,15 @@ public: { }; - LLToolBarButton(const Params& p) : LLButton(p) {} + LLToolBarButton(const Params& p); + + BOOL handleMouseDown(S32 x, S32 y, MASK mask); + BOOL handleHover(S32 x, S32 y, MASK mask); + void setCommandId(const LLCommandId& id) { mId = id; } +private: + LLCommandId mId; + S32 mMouseDownX; + S32 mMouseDownY; }; @@ -125,6 +133,8 @@ public: bool enableCommand(const LLCommandId& commandId, bool enabled); command_id_list_t& getCommandsList() { return mButtonCommands; } + LLToolBarButton* createButton(const LLCommandId& id); + protected: friend class LLUICtrlFactory; LLToolBar(const Params&); @@ -136,7 +146,6 @@ private: void createContextMenu(); void updateLayoutAsNeeded(); void createButtons(); - void createButton(const LLCommandId& id); void resizeButtonsInRow(std::vector& buttons_in_row, S32 max_row_girth); BOOL isSettingChecked(const LLSD& userdata); void onSettingEnable(const LLSD& userdata); @@ -145,6 +154,9 @@ private: std::list mButtons; command_id_list_t mButtonCommands; + typedef std::map command_id_map; + command_id_map mButtonMap; + LLToolBarEnums::ButtonType mButtonType; LLLayoutStack* mCenteringStack; LLLayoutStack* mWrapStack; diff --git a/indra/llui/lltoolbarview.cpp b/indra/llui/lltoolbarview.cpp index b374a0bfc4..0c3a6bd0ac 100644 --- a/indra/llui/lltoolbarview.cpp +++ b/indra/llui/lltoolbarview.cpp @@ -55,7 +55,10 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p) : LLUICtrl(p), mToolbarLeft(NULL), mToolbarRight(NULL), - mToolbarBottom(NULL) + mToolbarBottom(NULL), + mDragButton(NULL), + mMouseX(0), + mMouseY(0) { } @@ -283,4 +286,40 @@ void LLToolBarView::draw() //gl_rect_2d(right_rect, back_color_vert, TRUE); LLUICtrl::draw(); + + if (mDragButton) + { + S32 cursor_x, cursor_y; + mDragButton->setOrigin(mMouseX - mDragButton->getRect().getWidth(), mMouseY - mDragButton->getRect().getHeight()); + drawChild(mDragButton); + } +} + +void LLToolBarView::startDrag(LLToolBarButton* button) +{ + mDragButton = button; + addChild(mDragButton); + gFocusMgr.setMouseCapture(this); +} + +BOOL LLToolBarView::handleHover(S32 x, S32 y, MASK mask) +{ + mMouseX = x; + mMouseY = y; + return LLUICtrl::handleHover(x, y, mask); +} + +BOOL LLToolBarView::handleMouseUp(S32 x, S32 y, MASK mask) +{ + if (hasMouseCapture()) + { + gFocusMgr.setMouseCapture(NULL); + } + return LLUICtrl::handleMouseUp(x, y, mask); +} + +void LLToolBarView::onMouseCaptureLost() +{ + delete mDragButton; + mDragButton = NULL; } diff --git a/indra/llui/lltoolbarview.h b/indra/llui/lltoolbarview.h index 646a1fd636..cbe3d6c083 100644 --- a/indra/llui/lltoolbarview.h +++ b/indra/llui/lltoolbarview.h @@ -65,7 +65,10 @@ public: virtual ~LLToolBarView(); virtual BOOL postBuild(); virtual void draw(); - + virtual BOOL handleHover(S32 x, S32 y, MASK mask); + virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + virtual void onMouseCaptureLost(); + void startDrag(LLToolBarButton*); // Toolbar view interface with the rest of the world bool hasCommand(const LLCommandId& commandId) const; @@ -85,6 +88,10 @@ private: LLToolBar* mToolbarLeft; LLToolBar* mToolbarRight; LLToolBar* mToolbarBottom; + bool mDragging; + LLToolBarButton* mDragButton; + S32 mMouseX; + S32 mMouseY; }; extern LLToolBarView* gToolBarView; diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 9039366e7e..f4e31b109a 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -465,6 +465,20 @@ public: return dynamic_cast(widgetp); } + template T* getParentByType() const + { + LLView* parent = getParent(); + while(parent) + { + if (dynamic_cast(parent)) + { + return static_cast(parent); + } + parent = parent->getParent(); + } + return NULL; + } + ////////////////////////////////////////////// // statics ////////////////////////////////////////////// -- cgit v1.2.3 From cdc80b1dd34ef533d7500bf1ab89abf3c5d81bb3 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 30 Sep 2011 15:25:02 -0700 Subject: EXP-1205 PROGRESS -- As a User, I want a toybox which will contain all buttons that I can d&d into the toolbars EXP-1268 FIX -- The "Restore Defaults" button should reset the left/right/bottom toolbars to their default states * LLToolBarView::loadDefaultToolbars now a static function * Toybox button callback hooked up to properly restore defaults Reviewed by Merov --- indra/llui/lltoolbarview.cpp | 15 ++++++++++++++- indra/llui/lltoolbarview.h | 3 ++- indra/newview/llfloatertoybox.cpp | 2 ++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/indra/llui/lltoolbarview.cpp b/indra/llui/lltoolbarview.cpp index 1c6cf3230b..12247519ad 100644 --- a/indra/llui/lltoolbarview.cpp +++ b/indra/llui/lltoolbarview.cpp @@ -114,7 +114,7 @@ bool LLToolBarView::addCommand(const LLCommandId& command, LLToolBar* toolbar) } bool LLToolBarView::loadToolbars(bool force_default) -{ +{ LLToolBarView::ToolbarSet toolbar_set; // Load the toolbars.xml file @@ -204,6 +204,19 @@ bool LLToolBarView::loadToolbars(bool force_default) return true; } +//static +bool LLToolBarView::loadDefaultToolbars() +{ + bool retval = false; + + if (gToolBarView) + { + retval = gToolBarView->loadToolbars(true); + } + + return retval; +} + void LLToolBarView::saveToolbars() const { // Build the parameter tree from the toolbar data diff --git a/indra/llui/lltoolbarview.h b/indra/llui/lltoolbarview.h index efe6920db8..95c09ece73 100644 --- a/indra/llui/lltoolbarview.h +++ b/indra/llui/lltoolbarview.h @@ -72,7 +72,8 @@ public: bool hasCommand(const LLCommandId& commandId) const; // Loads the toolbars from the existing user or default settings bool loadToolbars(bool force_default = false); // return false if load fails - bool loadDefaultToolbars() { return loadToolbars(true); } + + static bool loadDefaultToolbars(); protected: friend class LLUICtrlFactory; diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp index d7f114043d..7a6afb4e33 100644 --- a/indra/newview/llfloatertoybox.cpp +++ b/indra/newview/llfloatertoybox.cpp @@ -61,6 +61,8 @@ BOOL LLFloaterToybox::postBuild() center(); mBtnRestoreDefaults = getChild("btn_restore_defaults"); + mBtnRestoreDefaults->setCommitCallback(boost::bind(&LLToolBarView::loadDefaultToolbars)); + mToolBar = getChild("toybox_toolbar"); LLCommandManager& cmdMgr = LLCommandManager::instance(); -- cgit v1.2.3 From 462f6a00285a92701ecba7cf69d5236f337e0781 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 30 Sep 2011 15:25:41 -0700 Subject: * Updated howto and profile windows to point to different buttons. Web content is still problematic for FUI floaters. --- indra/newview/app_settings/commands.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 224c1b4b48..77bf7cace3 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -70,7 +70,7 @@ label_ref="Command_HowTo_Label" tooltip_ref="Command_HowTo_Tooltip" function="Floater.ToolbarToggle" - parameter="floater_help_browser" + parameter="help_browser" /> Date: Fri, 30 Sep 2011 15:26:48 -0700 Subject: Updated FUI floater toggle function to handle closing windows that are initialized with chrome. --- indra/llui/llfloaterreg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 8a0513f246..27e96856b3 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -483,7 +483,7 @@ void LLFloaterReg::toggleToolbarFloaterInstance(const LLSD& sdname) { showInstance(name, key, TRUE); } - else if (!instance->hasFocus()) + else if (!instance->hasFocus() && !instance->getIsChrome()) { instance->setFocus(TRUE); } -- cgit v1.2.3 From 09e179b2381a4db03309839babae664feb9b0886 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 30 Sep 2011 16:57:08 -0700 Subject: param block cleanup added Flag as value type moved Batch to BatchBlock renamed Choice to ChoiceBlock made merging of parameters for ValueParams consistent (fillFrom and overwriteFrom are inverses of each other now) made iteration over Multiple type params easier initial schema param blocks --- indra/llui/lllineeditor.h | 2 +- indra/llui/llloadingindicator.cpp | 7 +- indra/llui/llloadingindicator.h | 4 +- indra/llui/llnotifications.h | 4 +- indra/llui/llnotificationtemplate.h | 4 +- indra/llui/llnotificationvisibilityrule.h | 2 +- indra/llui/llscrolllistcolumn.h | 4 +- indra/llui/llsdparam.cpp | 6 +- indra/llui/llsdparam.h | 4 +- indra/llui/lltextbase.h | 2 +- indra/llui/lltoolbar.cpp | 6 +- indra/llui/lltoolbarview.h | 4 - indra/llui/llui.cpp | 4 +- indra/llui/llui.h | 2 +- indra/llui/lluicolortable.h | 2 +- indra/llui/lluictrl.h | 4 +- indra/llui/lluictrlfactory.h | 6 +- indra/llui/llview.h | 2 +- indra/llxuixml/llinitparam.cpp | 2 +- indra/llxuixml/llinitparam.h | 452 +++++++++------------ indra/llxuixml/llxuiparser.cpp | 140 ++++++- indra/llxuixml/llxuiparser.h | 6 +- indra/newview/llnamelistctrl.h | 2 +- .../skins/default/xui/en/panel_toolbar_view.xml | 3 - .../skins/default/xui/en/widgets/toolbar.xml | 1 + 25 files changed, 377 insertions(+), 298 deletions(-) diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 583bde360a..2518dbe3c7 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -60,7 +60,7 @@ public: typedef boost::function keystroke_callback_t; - struct MaxLength : public LLInitParam::Choice + struct MaxLength : public LLInitParam::ChoiceBlock { Alternative bytes, chars; diff --git a/indra/llui/llloadingindicator.cpp b/indra/llui/llloadingindicator.cpp index c4eec1835c..6ac38f5ad4 100644 --- a/indra/llui/llloadingindicator.cpp +++ b/indra/llui/llloadingindicator.cpp @@ -34,6 +34,7 @@ // Project includes #include "lluictrlfactory.h" #include "lluiimage.h" +#include "boost/foreach.hpp" // registered in llui.cpp to avoid being left out by MS linker //static LLDefaultChildRegistry::Register r("loading_indicator"); @@ -51,11 +52,9 @@ LLLoadingIndicator::LLLoadingIndicator(const Params& p) void LLLoadingIndicator::initFromParams(const Params& p) { - for (LLInitParam::ParamIterator::const_iterator it = p.images().image.begin(), end_it = p.images().image.end(); - it != end_it; - ++it) + BOOST_FOREACH(LLUIImage* image, p.images.image) { - mImages.push_back(it->getValue()); + mImages.push_back(image); } // Start timer for switching images. diff --git a/indra/llui/llloadingindicator.h b/indra/llui/llloadingindicator.h index 7c44478848..c1f979c111 100644 --- a/indra/llui/llloadingindicator.h +++ b/indra/llui/llloadingindicator.h @@ -51,7 +51,7 @@ class LLLoadingIndicator LOG_CLASS(LLLoadingIndicator); public: - struct Images : public LLInitParam::Block + struct Images : public LLInitParam::BatchBlock { Multiple image; @@ -63,7 +63,7 @@ public: struct Params : public LLInitParam::Block { Optional images_per_sec; - Batch images; + Optional images; Params() : images_per_sec("images_per_sec", 1.0f), diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 0c4d4fc897..462d69be2e 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -201,7 +201,7 @@ public: FormInput(); }; - struct FormElement : public LLInitParam::Choice + struct FormElement : public LLInitParam::ChoiceBlock { Alternative button; Alternative input; @@ -312,7 +312,7 @@ public: Optional context; Optional responder; - struct Functor : public LLInitParam::Choice + struct Functor : public LLInitParam::ChoiceBlock { Alternative name; Alternative function; diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h index ab777d37a5..fb50c9c123 100644 --- a/indra/llui/llnotificationtemplate.h +++ b/indra/llui/llnotificationtemplate.h @@ -91,7 +91,7 @@ struct LLNotificationTemplate // // as well as // ... - Flag dummy_val; + Optional dummy_val; public: Multiple contexts; @@ -147,7 +147,7 @@ struct LLNotificationTemplate {} }; - struct FormRef : public LLInitParam::Choice + struct FormRef : public LLInitParam::ChoiceBlock { Alternative form; Alternative form_template; diff --git a/indra/llui/llnotificationvisibilityrule.h b/indra/llui/llnotificationvisibilityrule.h index 78bdec2a8f..78788a275c 100644 --- a/indra/llui/llnotificationvisibilityrule.h +++ b/indra/llui/llnotificationvisibilityrule.h @@ -59,7 +59,7 @@ struct LLNotificationVisibilityRule {} }; - struct Rule : public LLInitParam::Choice + struct Rule : public LLInitParam::ChoiceBlock { Alternative show; Alternative hide; diff --git a/indra/llui/llscrolllistcolumn.h b/indra/llui/llscrolllistcolumn.h index 12baea8e0c..b4d4a6d05e 100644 --- a/indra/llui/llscrolllistcolumn.h +++ b/indra/llui/llscrolllistcolumn.h @@ -95,7 +95,7 @@ public: Optional sort_direction; Optional sort_ascending; - struct Width : public LLInitParam::Choice + struct Width : public LLInitParam::ChoiceBlock { Alternative dynamic_width; Alternative pixel_width; @@ -112,7 +112,7 @@ public: Optional width; // either an image or label is used in column header - struct Header : public LLInitParam::Choice
+ struct Header : public LLInitParam::ChoiceBlock
{ Alternative label; Alternative image; diff --git a/indra/llui/llsdparam.cpp b/indra/llui/llsdparam.cpp index 04919e6991..4b69360e33 100644 --- a/indra/llui/llsdparam.cpp +++ b/indra/llui/llsdparam.cpp @@ -45,7 +45,7 @@ LLParamSDParser::LLParamSDParser() if (sReadFuncs.empty()) { - registerParserFuncs(readNoValue, &LLParamSDParser::writeNoValue); + registerParserFuncs(readFlag, &LLParamSDParser::writeFlag); registerParserFuncs(readS32, &LLParamSDParser::writeTypedValue); registerParserFuncs(readU32, &LLParamSDParser::writeU32Param); registerParserFuncs(readF32, &LLParamSDParser::writeTypedValue); @@ -72,7 +72,7 @@ bool LLParamSDParser::writeU32Param(LLParamSDParser::parser_t& parser, const voi return true; } -bool LLParamSDParser::writeNoValue(LLParamSDParser::parser_t& parser, const void* val_ptr, const parser_t::name_stack_t& name_stack) +bool LLParamSDParser::writeFlag(LLParamSDParser::parser_t& parser, const void* val_ptr, const parser_t::name_stack_t& name_stack) { LLParamSDParser& sdparser = static_cast(parser); if (!sdparser.mWriteRootSD) return false; @@ -226,7 +226,7 @@ LLSD* LLParamSDParser::getSDWriteNode(const parser_t::name_stack_t& name_stack) return sd_to_write; } -bool LLParamSDParser::readNoValue(Parser& parser, void* val_ptr) +bool LLParamSDParser::readFlag(Parser& parser, void* val_ptr) { LLParamSDParser& self = static_cast(parser); return self.mCurReadSD == &NO_VALUE_MARKER; diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h index f776c781b3..a371c28f68 100644 --- a/indra/llui/llsdparam.h +++ b/indra/llui/llsdparam.h @@ -63,9 +63,9 @@ private: LLSD* getSDWriteNode(const parser_t::name_stack_t& name_stack); static bool writeU32Param(Parser& parser, const void* value_ptr, const parser_t::name_stack_t& name_stack); - static bool writeNoValue(Parser& parser, const void* value_ptr, const parser_t::name_stack_t& name_stack); + static bool writeFlag(Parser& parser, const void* value_ptr, const parser_t::name_stack_t& name_stack); - static bool readNoValue(Parser& parser, void* val_ptr); + static bool readFlag(Parser& parser, void* val_ptr); static bool readS32(Parser& parser, void* val_ptr); static bool readU32(Parser& parser, void* val_ptr); static bool readF32(Parser& parser, void* val_ptr); diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 7d545a1ba6..384d9116fc 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -237,7 +237,7 @@ public: friend class LLNormalTextSegment; friend class LLUICtrlFactory; - struct LineSpacingParams : public LLInitParam::Choice + struct LineSpacingParams : public LLInitParam::ChoiceBlock { Alternative multiple; Alternative pixels; diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index caad896a06..d940bed905 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -185,7 +185,7 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p) LLPanel::Params button_panel_p(p.button_panel); button_panel_p.rect = center_panel->getLocalRect(); - button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT; + button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT; mButtonPanel = LLUICtrlFactory::create(button_panel_p); center_panel->addChild(mButtonPanel); @@ -558,8 +558,8 @@ BOOL LLToolBarButton::handleHover(S32 x, S32 y, MASK mask) LLToolBar* bar = getParentByType(); if (view) { - view->startDrag(bar->createButton(mId)); - setVisible(FALSE); + //view->startDrag(bar->createButton(mId)); + //setVisible(FALSE); } } } diff --git a/indra/llui/lltoolbarview.h b/indra/llui/lltoolbarview.h index ea3422f04e..dd2bbf0e49 100644 --- a/indra/llui/lltoolbarview.h +++ b/indra/llui/lltoolbarview.h @@ -65,10 +65,6 @@ public: virtual ~LLToolBarView(); virtual BOOL postBuild(); virtual void draw(); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual void onMouseCaptureLost(); - void startDrag(LLToolBarButton*); // Toolbar view interface with the rest of the world // Checks if the commandId is being used somewhere in one of the toolbars bool hasCommand(const LLCommandId& commandId) const; diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 4f129ccfba..76a12e649b 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -2107,7 +2107,7 @@ namespace LLInitParam void ParamValue >::updateValueFromBlock() { - if (control.isProvided()) + if (control.isProvided() && !control().empty()) { updateValue(LLUIColorTable::instance().getColor(control)); } @@ -2264,9 +2264,11 @@ namespace LLInitParam // in this case, that is left+width and bottom+height LLRect& value = getValue(); + right.set(value.mRight, false); left.set(value.mLeft, make_block_authoritative); width.set(value.getWidth(), make_block_authoritative); + top.set(value.mTop, false); bottom.set(value.mBottom, make_block_authoritative); height.set(value.getHeight(), make_block_authoritative); } diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 7801a01ace..3afb7c65a9 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -365,7 +365,7 @@ template LLRegisterWith LLInitClass::sRegister( template LLRegisterWith LLDestroyClass::sRegister(&T::destroyClass); // useful parameter blocks -struct TimeIntervalParam : public LLInitParam::Choice +struct TimeIntervalParam : public LLInitParam::ChoiceBlock { Alternative seconds; Alternative frames; diff --git a/indra/llui/lluicolortable.h b/indra/llui/lluicolortable.h index 76518789ec..6a7a681d57 100644 --- a/indra/llui/lluicolortable.h +++ b/indra/llui/lluicolortable.h @@ -44,7 +44,7 @@ LOG_CLASS(LLUIColorTable); typedef std::map string_color_map_t; public: - struct ColorParams : LLInitParam::Choice + struct ColorParams : LLInitParam::ChoiceBlock { Alternative value; Alternative reference; diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index fc56e5fc35..a8a4e3191d 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -76,14 +76,14 @@ public: Optional function; }; - struct EnableControls : public LLInitParam::Choice + struct EnableControls : public LLInitParam::ChoiceBlock { Alternative enabled; Alternative disabled; EnableControls(); }; - struct ControlVisibility : public LLInitParam::Choice + struct ControlVisibility : public LLInitParam::ChoiceBlock { Alternative visible; Alternative invisible; diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 71c38237c1..d612ad5005 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -125,12 +125,12 @@ private: // base case for recursion, there are NO base classes of LLInitParam::BaseBlock template - class ParamDefaults : public LLSingleton > + class ParamDefaults : public LLSingleton > { public: - const LLInitParam::BaseBlockWithFlags& get() { return mBaseBlock; } + const LLInitParam::BaseBlock& get() { return mBaseBlock; } private: - LLInitParam::BaseBlockWithFlags mBaseBlock; + LLInitParam::BaseBlock mBaseBlock; }; public: diff --git a/indra/llui/llview.h b/indra/llui/llview.h index f4e31b109a..a1c46f3bf3 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -98,7 +98,7 @@ private: class LLView : public LLMouseHandler, public LLMortician, public LLFocusableElement { public: - struct Follows : public LLInitParam::Choice + struct Follows : public LLInitParam::ChoiceBlock { Alternative string; Alternative flags; diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp index c024fd405e..99016205c8 100644 --- a/indra/llxuixml/llinitparam.cpp +++ b/indra/llxuixml/llinitparam.cpp @@ -365,7 +365,7 @@ namespace LLInitParam // verify by calling readValue with NoParamValue type, an inherently unparseable type if (!names_left) { - NoParamValue no_value; + Flag no_value; return p.readValue(no_value); } diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 69dcd474f7..9a6ded47ff 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -38,6 +38,9 @@ namespace LLInitParam { + // used to indicate no matching value to a given name when parsing + struct Flag{}; + template const T& defaultValue() { static T value; return value; } template ::value > @@ -65,6 +68,12 @@ namespace LLInitParam static bool equals(const LLSD &a, const LLSD &b) { return false; } }; + template<> + struct ParamCompare + { + static bool equals(const Flag& a, const Flag& b) { return false; } + }; + // helper functions and classes typedef ptrdiff_t param_handle_t; @@ -275,9 +284,6 @@ namespace LLInitParam static S32 sNextParseGeneration; }; - // used to indicate no matching value to a given name when parsing - struct NoParamValue{}; - class BaseBlock; class Param @@ -385,36 +391,36 @@ namespace LLInitParam // "Multiple" constraint types, put here in root class to avoid ambiguity during use struct AnyAmount { - static U32 minCount() { return 0; } - static U32 maxCount() { return U32_MAX; } + enum { minCount = 0 }; + enum { maxCount = U32_MAX }; }; template struct AtLeast { - static U32 minCount() { return MIN_AMOUNT; } - static U32 maxCount() { return U32_MAX; } + enum { minCount = MIN_AMOUNT }; + enum { maxCount = U32_MAX }; }; template struct AtMost { - static U32 minCount() { return 0; } - static U32 maxCount() { return MAX_AMOUNT; } + enum { minCount = 0 }; + enum { maxCount = MAX_AMOUNT }; }; template struct Between { - static U32 minCount() { return MIN_AMOUNT; } - static U32 maxCount() { return MAX_AMOUNT; } + enum { minCount = MIN_AMOUNT }; + enum { maxCount = MAX_AMOUNT }; }; template struct Exactly { - static U32 minCount() { return EXACT_COUNT; } - static U32 maxCount() { return EXACT_COUNT; } + enum { minCount = EXACT_COUNT }; + enum { maxCount = EXACT_COUNT }; }; // this typedef identifies derived classes as being blocks @@ -477,9 +483,9 @@ namespace LLInitParam void init(BlockDescriptor& descriptor, BlockDescriptor& base_descriptor, size_t block_size); - bool mergeBlockParam(bool param_provided, BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) + bool mergeBlockParam(bool source_provided, bool dst_provided, BlockDescriptor& block_data, const BaseBlock& source, bool overwrite) { - return mergeBlock(block_data, other, overwrite); + return mergeBlock(block_data, source, overwrite); } // take all provided params from other and apply to self bool mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite); @@ -497,92 +503,6 @@ namespace LLInitParam const std::string& getParamName(const BlockDescriptor& block_data, const Param* paramp) const; }; - class BaseBlockWithFlags : public BaseBlock - { - public: - class FlagBase : public Param - { - public: - typedef FlagBase self_t; - - FlagBase(const char* name, BaseBlock* enclosing_block) : Param(enclosing_block) - { - if (LL_UNLIKELY(enclosing_block->mostDerivedBlockDescriptor().mInitializationState == BlockDescriptor::INITIALIZING)) - { - ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor( - enclosing_block->getHandleFromParam(this), - &mergeWith, - &deserializeParam, - &serializeParam, - NULL, - &inspectParam, - 0, 1)); - BaseBlock::addParam(enclosing_block->mostDerivedBlockDescriptor(), param_descriptor, name); - } - } - - bool isProvided() const { return anyProvided(); } - - private: - static bool mergeWith(Param& dst, const Param& src, bool overwrite) - { - const self_t& src_typed_param = static_cast(src); - self_t& dst_typed_param = static_cast(dst); - - if (src_typed_param.isProvided() - && (overwrite || !dst_typed_param.isProvided())) - { - dst.setProvided(true); - return true; - } - return false; - } - - static bool deserializeParam(Param& param, Parser& parser, const Parser::name_stack_range_t& name_stack, S32 generation) - { - self_t& typed_param = static_cast(param); - - // no further names in stack, parse value now - if (name_stack.first == name_stack.second) - { - typed_param.setProvided(true); - typed_param.enclosingBlock().paramChanged(param, true); - return true; - } - - return false; - } - - static void serializeParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, const Param* diff_param) - { - const self_t& typed_param = static_cast(param); - const self_t* typed_diff_param = static_cast(diff_param); - - if (!typed_param.isProvided()) return; - - if (!name_stack.empty()) - { - name_stack.back().second = parser.newParseGeneration(); - } - - // then try to serialize value directly - if (!typed_diff_param || !typed_diff_param->isProvided()) - { - if (!parser.writeValue(NoParamValue(), name_stack)) - { - return; - } - } - } - - static void inspectParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, S32 min_count, S32 max_count) - { - // tell parser about our actual type - parser.inspectValue(name_stack, min_count, max_count, NULL); - } - }; - }; - // these templates allow us to distinguish between template parameters // that derive from BaseBlock and those that don't template @@ -604,7 +524,7 @@ namespace LLInitParam typedef const T& value_assignment_t; ParamValue(): mValue() {} - ParamValue(const T& other) : mValue(other) {} + ParamValue(value_assignment_t other) : mValue(other) {} void setValue(value_assignment_t val) { @@ -621,6 +541,17 @@ namespace LLInitParam return mValue; } + operator value_assignment_t() const + { + return mValue; + } + + value_assignment_t operator()() const + { + return mValue; + } + + private: T mValue; }; @@ -644,7 +575,7 @@ namespace LLInitParam mValidated(false) {} - ParamValue(const T& other) + ParamValue(value_assignment_t other) : T(other), mKeyVersion(0), mValidatedVersion(-1), @@ -666,6 +597,16 @@ namespace LLInitParam { return *this; } + + operator value_assignment_t() const + { + return *this; + } + + value_assignment_t operator()() const + { + return *this; + } }; template > @@ -801,11 +742,6 @@ namespace LLInitParam Param::enclosingBlock().paramChanged(*this, flag_as_provided); } - // implicit conversion - operator value_assignment_t() const { return param_value_t::getValue(); } - // explicit conversion - value_assignment_t operator()() const { return param_value_t::getValue(); } - protected: static bool mergeWith(Param& dst, const Param& src, bool overwrite) @@ -958,11 +894,6 @@ namespace LLInitParam } } - // implicit conversion - operator value_assignment_t() const { return param_value_t::getValue(); } - // explicit conversion - value_assignment_t operator()() const { return param_value_t::getValue(); } - protected: static bool mergeWith(Param& dst, const Param& src, bool overwrite) @@ -972,8 +903,7 @@ namespace LLInitParam if (src_typed_param.anyProvided()) { - bool param_provided = src_typed_param.isProvided() && (overwrite || !dst_typed_param.isProvided()); - if (dst_typed_param.mergeBlockParam(param_provided, param_value_t::selfBlockDescriptor(), src_typed_param, overwrite)) + if (dst_typed_param.mergeBlockParam(src_typed_param.isProvided(), dst_typed_param.isProvided(), param_value_t::selfBlockDescriptor(), src_typed_param, overwrite)) { dst_typed_param.clearValueName(); dst_typed_param.setProvided(true); @@ -992,8 +922,8 @@ namespace LLInitParam { public: typedef TypedParam self_t; - typedef ParamValue param_value_t; - typedef typename std::vector container_t; + typedef ParamValue param_value_t; + typedef typename std::vector container_t; typedef const container_t& value_assignment_t; typedef VALUE_TYPE value_t; @@ -1118,6 +1048,8 @@ namespace LLInitParam // implicit conversion operator value_assignment_t() const { return mValues; } + // explicit conversion + value_assignment_t operator()() const { return mValues; } typedef typename container_t::iterator iterator; typedef typename container_t::const_iterator const_iterator; @@ -1169,7 +1101,7 @@ namespace LLInitParam public: typedef TypedParam self_t; typedef ParamValue param_value_t; - typedef typename std::vector container_t; + typedef typename std::vector container_t; typedef const container_t& value_assignment_t; typedef VALUE_TYPE value_t; typedef NAME_VALUE_LOOKUP name_value_lookup_t; @@ -1308,6 +1240,8 @@ namespace LLInitParam // implicit conversion operator value_assignment_t() const { return mValues; } + // explicit conversion + value_assignment_t operator()() const { return mValues; } typedef typename container_t::iterator iterator; typedef typename container_t::const_iterator const_iterator; @@ -1363,10 +1297,10 @@ namespace LLInitParam }; template - class Choice : public BaseBlock + class ChoiceBlock : public BaseBlock { - typedef Choice self_t; - typedef Choice enclosing_block_t; + typedef ChoiceBlock self_t; + typedef ChoiceBlock enclosing_block_t; LOG_CLASS(self_t); public: @@ -1382,11 +1316,13 @@ namespace LLInitParam return mergeBlock(selfBlockDescriptor(), other, false); } - bool mergeBlockParam(bool param_provided, BlockDescriptor& block_data, const self_t& other, bool overwrite) + bool mergeBlockParam(bool source_provided, bool dest_provided, BlockDescriptor& block_data, const self_t& source, bool overwrite) { - if (param_provided) + bool source_override = source_provided && (overwrite || !dest_provided); + + if (source_override || source.mCurChoice == mCurChoice) { - return mergeBlock(block_data, other, overwrite); + return mergeBlock(block_data, source, overwrite); } return false; } @@ -1420,7 +1356,7 @@ namespace LLInitParam virtual BlockDescriptor& mostDerivedBlockDescriptor() { return selfBlockDescriptor(); } protected: - Choice() + ChoiceBlock() : mCurChoice(0) { BaseBlock::init(selfBlockDescriptor(), BaseBlock::selfBlockDescriptor(), sizeof(DERIVED_BLOCK)); @@ -1433,13 +1369,13 @@ namespace LLInitParam class Alternative : public TypedParam { public: - friend class Choice; + friend class ChoiceBlock; typedef Alternative self_t; typedef TypedParam >::value> super_t; typedef typename super_t::value_assignment_t value_assignment_t; - explicit Alternative(const char* name, value_assignment_t val = defaultValue()) + explicit Alternative(const char* name = "", value_assignment_t val = defaultValue()) : super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, NULL, 0, 1), mOriginalValue(val) { @@ -1454,10 +1390,19 @@ namespace LLInitParam } } - Alternative& operator=(value_assignment_t val) + void choose() + { + static_cast(Param::enclosingBlock()).paramChanged(*this, true); + } + + void chooseAs(value_assignment_t val) + { + super_t::set(val); + } + + void operator=(value_assignment_t val) { super_t::set(val); - return *this; } void operator()(typename super_t::value_assignment_t val) @@ -1466,12 +1411,8 @@ namespace LLInitParam } operator value_assignment_t() const - { - if (static_cast(Param::enclosingBlock()).getCurrentChoice() == this) - { - return super_t::getValue(); - } - return mOriginalValue; + { + return (*this)(); } value_assignment_t operator()() const @@ -1508,7 +1449,7 @@ namespace LLInitParam } }; - template + template class Block : public BASE_BLOCK { @@ -1604,13 +1545,6 @@ namespace LLInitParam }; - class Flag : public BaseBlockWithFlags::FlagBase - { - public: - Flag(const char* name) : FlagBase(name, DERIVED_BLOCK::selfBlockDescriptor().mCurrentBlockPtr) - {} - }; - template > class Multiple : public TypedParam { @@ -1623,7 +1557,7 @@ namespace LLInitParam typedef typename super_t::const_iterator const_iterator; explicit Multiple(const char* name = "") - : super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, container_t(), &validate, RANGE::minCount(), RANGE::maxCount()) + : super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, container_t(), &validate, RANGE::minCount, RANGE::maxCount) {} Multiple& operator=(value_assignment_t val) @@ -1641,100 +1575,10 @@ namespace LLInitParam static bool validate(const Param* paramp) { U32 num_valid = ((super_t*)paramp)->numValidElements(); - return RANGE::minCount() <= num_valid && num_valid <= RANGE::maxCount(); + return RANGE::minCount <= num_valid && num_valid <= RANGE::maxCount; } }; - template > - class Batch : private TypedParam - { - public: - typedef ParamValue param_value_t; - typedef TypedParam::value> super_t; - typedef Batch self_t; - typedef typename super_t::value_assignment_t value_assignment_t; - typedef typename super_t::value_t value_t; - - struct BatchDefaultValue : public ParamDescriptor::UserData - { - BatchDefaultValue(const T& value) - : mValue(value) - {} - - T mValue; - }; - - explicit Batch(const char* name, value_assignment_t val) - : super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, NULL, 0, 1), - mLastParseGeneration(-1) - { - BlockDescriptor& block_descriptor = DERIVED_BLOCK::selfBlockDescriptor(); - if (LL_UNLIKELY(block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING)) - { - ParamDescriptorPtr param_descriptorp = block_descriptor.mCurrentBlockPtr->findParamDescriptor(*this); - - if (param_descriptorp) - { - param_descriptorp->mDeserializeFunc = &deserializeParam; - param_descriptorp->mUserData = new BatchDefaultValue(new param_value_t(val)); - } - } - } - - explicit Batch(const char* name = "") - : super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, defaultValue(), NULL, 0, 1), - mLastParseGeneration(-1) - { - BlockDescriptor& block_descriptor = DERIVED_BLOCK::selfBlockDescriptor(); - if (LL_UNLIKELY(block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING)) - { - ParamDescriptorPtr param_descriptorp = block_descriptor.mCurrentBlockPtr->findParamDescriptor(*this); - - if (param_descriptorp) - { - param_descriptorp->mDeserializeFunc = &deserializeParam; - } - } - } - - Batch& operator=(value_assignment_t val) - { - set(val); - return *this; - } - - DERIVED_BLOCK& operator()(value_assignment_t val) - { - super_t::set(val); - return static_cast(Param::enclosingBlock()); - } - - using super_t::operator(); - - private: - static bool deserializeParam(Param& param, Parser& parser, const Parser::name_stack_range_t& name_stack, S32 generation) - { - self_t& typed_param = static_cast(param); - - if (generation != typed_param.mLastParseGeneration) - { - ParamDescriptorPtr descriptor = typed_param.enclosingBlock().findParamDescriptor(param); - if (descriptor && static_cast(descriptor->mUserData)) - { - static_cast(typed_param) = (static_cast(descriptor->mUserData))->mValue; - } - else - { - static_cast(typed_param) = param_value_t(value_t()); - } - typed_param.mLastParseGeneration = generation; - } - return super_t::deserializeParam(param, parser, name_stack, generation); - } - - S32 mLastParseGeneration; - }; - class Deprecated : public Param { public: @@ -1769,6 +1613,7 @@ namespace LLInitParam } }; + // different semantics for documentation purposes, but functionally identical typedef Deprecated Ignored; protected: @@ -1790,6 +1635,106 @@ namespace LLInitParam }; + template + class BatchBlock + : public Block + { + public: + typedef BatchBlock self_t; + typedef Block super_t; + + BatchBlock() + : mLastParseGeneration(-1) + {} + + bool deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack, S32 generation) + { + if (generation != mLastParseGeneration) + { + // reset block + *static_cast(this) = defaultBatchValue(); + mLastParseGeneration = generation; + } + return super_t::deserializeBlock(p, name_stack, generation); + } + + bool mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) + { + if (overwrite) + { + *static_cast(this) = defaultBatchValue(); + mLastParseGeneration = -1; + // merge individual parameters into destination + return super_t::mergeBlock(super_t::selfBlockDescriptor(), src_typed_param, overwrite); + } + return false; + } + protected: + static const DERIVED_BLOCK& defaultBatchValue() + { + static DERIVED_BLOCK default_value; + return default_value; + } + + S32 mLastParseGeneration; + }; + + + + template + class ParamValue , + NAME_VALUE_LOOKUP, + true> + : public Param, + protected BatchBlock + { + typedef const BatchBlock& value_assignment_t; + + ParamValue() + : T(), + mKeyVersion(0), + mValidatedVersion(-1), + mValidated(false) + {} + + ParamValue(value_assignment_t other) + : T(other), + mKeyVersion(0), + mValidatedVersion(-1), + mValidated(false) + { + } + + void setValue(value_assignment_t val) + { + *this = val; + mLastParseGeneration = -1; + } + + value_assignment_t getValue() const + { + return *this; + } + + BatchBlock& getValue() + { + return *this; + } + + operator value_assignment_t() const + { + return *this; + } + + value_assignment_t operator()() const + { + return *this; + } + + }; + template class CustomParamValue : public Block > >, @@ -1955,6 +1900,16 @@ namespace LLInitParam return mValue; } + operator value_assignment_t() const + { + return getValue(); + } + + value_assignment_t operator()() const + { + return getValue(); + } + S32 mKeyVersion; protected: @@ -1965,30 +1920,29 @@ namespace LLInitParam mValue = value; } - bool mergeBlockParam(bool param_provided, BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) + bool mergeBlockParam(bool source_provided, bool dst_provided, BlockDescriptor& block_data, const BaseBlock& source, bool overwrite) { - if (param_provided) - { - return mergeBlock(block_data, other, overwrite); - } - return false; - } + bool source_override = source_provided && (overwrite || !dst_provided); - bool mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) - { - const derived_t& src_typed_param = static_cast(other); + const derived_t& src_typed_param = static_cast(source); - if (src_typed_param.mValueAge == VALUE_AUTHORITATIVE) + if (source_override && src_typed_param.mValueAge == VALUE_AUTHORITATIVE) { // copy value over setValue(src_typed_param.getValue()); return true; } - else + // merge individual parameters into destination + if (mValueAge == VALUE_AUTHORITATIVE) { - // merge individual parameters into destination - return block_t::mergeBlock(block_t::selfBlockDescriptor(), src_typed_param, overwrite); + static_cast(this)->updateBlockFromValue(dst_provided); } + return mergeBlock(block_data, source, overwrite); + } + + bool mergeBlock(BlockDescriptor& block_data, const BaseBlock& source, bool overwrite) + { + return block_t::mergeBlock(block_data, source, overwrite); } mutable S32 mValidatedVersion; diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp index 4af077b22c..c60f656c2c 100644 --- a/indra/llxuixml/llxuiparser.cpp +++ b/indra/llxuixml/llxuiparser.cpp @@ -51,6 +51,136 @@ static LLInitParam::Parser::parser_read_func_map_t sXSDReadFuncs; static LLInitParam::Parser::parser_write_func_map_t sXSDWriteFuncs; static LLInitParam::Parser::parser_inspect_func_map_t sXSDInspectFuncs; +struct MaxOccur : public LLInitParam::ChoiceBlock +{ + Alternative count; + Alternative unbounded; + + MaxOccur() + : unbounded("", "unbounded") + {} +}; + +struct Occurs : public LLInitParam::Block +{ + Optional minOccurs; + Optional maxOccurs; + + Occurs() + : minOccurs("minOccurs"), + maxOccurs("maxOccurs") + { + minOccurs = 0; + maxOccurs.unbounded.choose(); + } +}; + + +typedef enum +{ + USE_REQUIRED, + USE_OPTIONAL +} EUse; + +namespace LLInitParam +{ + template<> + struct TypeValues : public TypeValuesHelper + { + static void declareValues() + { + declare("required", USE_REQUIRED); + declare("optional", USE_OPTIONAL); + } + }; +} + +struct Name : public LLInitParam::Block +{ + Mandatory name; + + Name() + : name("name") + {} +}; + +struct Attribute : public LLInitParam::Block +{ + Mandatory name; + Mandatory type; + Mandatory use; + + Attribute() + : name("name"), + type("type"), + use("use") + { + } +}; + +struct ComplexType : public LLInitParam::Block +{ + Multiple attribute; + //Multiple elements; + Optional mixed; + + ComplexType() + : attribute("xs:attribute"), + //elements("xs:element"), + mixed("mixed") + { + mixed = true; + } +}; + +struct Element : public LLInitParam::Block +{ + Mandatory complexType; + Mandatory name; + + Element() + : complexType("xs:complexType") + {} +}; + +struct Elements : public LLInitParam::Block +{ + Multiple elements; + + Elements() + : elements("xs:element") + {} +}; + +struct Schema : public LLInitParam::Block +{ +private: + Mandatory targetNamespace, + xmlns; + +public: + Optional attributeFormDefault, + elementFormDefault, + xs; + + Optional elements; + + void setNameSpace(const std::string& ns) {targetNamespace = ns; xmlns = ns;} + + Schema() + : attributeFormDefault("attributeFormDefault"), + elementFormDefault("elementFormDefault"), + xs("xmlns:xs"), + targetNamespace("targetNamespace"), + xmlns("xmlns"), + elements("xs:choice") + { + attributeFormDefault = "unqualified"; + elementFormDefault = "qualified"; + xs = "http://www.w3.org/2001/XMLSchema"; + } + +}; // // LLXSDWriter @@ -388,7 +518,7 @@ LLXUIParser::LLXUIParser() { if (sXUIReadFuncs.empty()) { - registerParserFuncs(readNoValue, writeNoValue); + registerParserFuncs(readFlag, writeFlag); registerParserFuncs(readBoolValue, writeBoolValue); registerParserFuncs(readStringValue, writeStringValue); registerParserFuncs(readU8Value, writeU8Value); @@ -645,13 +775,13 @@ LLXMLNodePtr LLXUIParser::getNode(const name_stack_t& stack) return (out_node == mWriteRootNode ? LLXMLNodePtr(NULL) : out_node); } -bool LLXUIParser::readNoValue(Parser& parser, void* val_ptr) +bool LLXUIParser::readFlag(Parser& parser, void* val_ptr) { LLXUIParser& self = static_cast(parser); return self.mCurReadNode == DUMMY_NODE; } -bool LLXUIParser::writeNoValue(Parser& parser, const void* val_ptr, const name_stack_t& stack) +bool LLXUIParser::writeFlag(Parser& parser, const void* val_ptr, const name_stack_t& stack) { // just create node LLXUIParser& self = static_cast(parser); @@ -1083,7 +1213,7 @@ LLSimpleXUIParser::LLSimpleXUIParser(LLSimpleXUIParser::element_start_callback_t { if (sSimpleXUIReadFuncs.empty()) { - registerParserFuncs(readNoValue); + registerParserFuncs(readFlag); registerParserFuncs(readBoolValue); registerParserFuncs(readStringValue); registerParserFuncs(readU8Value); @@ -1376,7 +1506,7 @@ void LLSimpleXUIParser::parserError(const std::string& message) #endif } -bool LLSimpleXUIParser::readNoValue(Parser& parser, void* val_ptr) +bool LLSimpleXUIParser::readFlag(Parser& parser, void* val_ptr) { LLSimpleXUIParser& self = static_cast(parser); return self.mCurAttributeValueBegin == NO_VALUE_MARKER; diff --git a/indra/llxuixml/llxuiparser.h b/indra/llxuixml/llxuiparser.h index 0c38c4da93..42a79b4100 100644 --- a/indra/llxuixml/llxuiparser.h +++ b/indra/llxuixml/llxuiparser.h @@ -116,7 +116,7 @@ private: bool readAttributes(LLXMLNodePtr nodep, LLInitParam::BaseBlock& block); //reader helper functions - static bool readNoValue(Parser& parser, void* val_ptr); + static bool readFlag(Parser& parser, void* val_ptr); static bool readBoolValue(Parser& parser, void* val_ptr); static bool readStringValue(Parser& parser, void* val_ptr); static bool readU8Value(Parser& parser, void* val_ptr); @@ -133,7 +133,7 @@ private: static bool readSDValue(Parser& parser, void* val_ptr); //writer helper functions - static bool writeNoValue(Parser& parser, const void* val_ptr, const name_stack_t&); + static bool writeFlag(Parser& parser, const void* val_ptr, const name_stack_t&); static bool writeBoolValue(Parser& parser, const void* val_ptr, const name_stack_t&); static bool writeStringValue(Parser& parser, const void* val_ptr, const name_stack_t&); static bool writeU8Value(Parser& parser, const void* val_ptr, const name_stack_t&); @@ -197,7 +197,7 @@ public: private: //reader helper functions - static bool readNoValue(Parser&, void* val_ptr); + static bool readFlag(Parser&, void* val_ptr); static bool readBoolValue(Parser&, void* val_ptr); static bool readStringValue(Parser&, void* val_ptr); static bool readU8Value(Parser&, void* val_ptr); diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index d64fdbe6a5..ca9956dc53 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -61,7 +61,7 @@ public: {} }; - struct NameColumn : public LLInitParam::Choice + struct NameColumn : public LLInitParam::ChoiceBlock { Alternative column_index; Alternative column_name; diff --git a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml index fa7632920b..7bbacc0152 100644 --- a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml +++ b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml @@ -33,7 +33,6 @@ follows="all" mouse_opaque="false"> Date: Fri, 30 Sep 2011 17:09:16 -0700 Subject: fix for merge --- indra/llui/lltoolbarview.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/indra/llui/lltoolbarview.cpp b/indra/llui/lltoolbarview.cpp index 0996577114..12247519ad 100644 --- a/indra/llui/lltoolbarview.cpp +++ b/indra/llui/lltoolbarview.cpp @@ -114,7 +114,7 @@ bool LLToolBarView::addCommand(const LLCommandId& command, LLToolBar* toolbar) } bool LLToolBarView::loadToolbars(bool force_default) -{ +{ LLToolBarView::ToolbarSet toolbar_set; // Load the toolbars.xml file @@ -221,18 +221,19 @@ void LLToolBarView::saveToolbars() const { // Build the parameter tree from the toolbar data LLToolBarView::ToolbarSet toolbar_set; - - // *TODO : factorize that code a bit... if (mToolbarLeft) { + toolbar_set.left_toolbar.button_display_mode = (int)(mToolbarLeft->getButtonType()); addToToolset(mToolbarLeft->getCommandsList(),toolbar_set.left_toolbar); } if (mToolbarRight) { + toolbar_set.right_toolbar.button_display_mode = (int)(mToolbarRight->getButtonType()); addToToolset(mToolbarRight->getCommandsList(),toolbar_set.right_toolbar); } if (mToolbarBottom) { + toolbar_set.bottom_toolbar.button_display_mode = (int)(mToolbarBottom->getButtonType()); addToToolset(mToolbarBottom->getCommandsList(),toolbar_set.bottom_toolbar); } @@ -255,6 +256,19 @@ void LLToolBarView::saveToolbars() const } } +// Enumerate the commands in command_list and add them as Params to the toolbar +void LLToolBarView::addToToolset(command_id_list_t& command_list, Toolbar& toolbar) const +{ + for (command_id_list_t::const_iterator it = command_list.begin(); + it != command_list.end(); + ++it) + { + LLCommandId::Params command; + command.name = it->name(); + toolbar.commands.add(command); + } +} + void LLToolBarView::draw() { static bool debug_print = true; -- cgit v1.2.3 From 63a8fce12b1e1c0d40d97e2f029776fed6e300fb Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 30 Sep 2011 18:51:17 -0700 Subject: made toolbars conform to visual specs added ability to specify clip rects in textures.xml --- indra/llui/lltoolbar.cpp | 17 ++++----- indra/llui/lltoolbar.h | 23 +++++++---- indra/newview/llviewertexturelist.cpp | 44 +++++++++++++++------- indra/newview/llviewertexturelist.h | 7 +++- indra/newview/skins/default/textures/textures.xml | 6 ++- indra/newview/skins/default/xui/en/main_view.xml | 4 +- .../skins/default/xui/en/panel_toolbar_view.xml | 3 ++ .../skins/default/xui/en/widgets/toolbar.xml | 28 +++++++++----- 8 files changed, 87 insertions(+), 45 deletions(-) diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 2592fd1229..c62bbe4e71 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -82,9 +82,6 @@ LLToolBar::Params::Params() button_icon_and_text("button_icon_and_text"), read_only("read_only", false), wrap("wrap", true), - min_button_width("min_button_width", 0), - max_button_width("max_button_width", S32_MAX), - button_height("button_height"), pad_left("pad_left"), pad_top("pad_top"), pad_right("pad_right"), @@ -102,9 +99,6 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) mNeedsLayout(false), mButtonPanel(NULL), mCenteringStack(NULL), - mMinButtonWidth(llmin(p.min_button_width(), p.max_button_width())), - mMaxButtonWidth(llmax(p.max_button_width(), p.min_button_width())), - mButtonHeight(p.button_height), mPadLeft(p.pad_left), mPadRight(p.pad_right), mPadTop(p.pad_top), @@ -325,7 +319,7 @@ void LLToolBar::resizeButtonsInRow(std::vector& buttons_in_row { if (getOrientation(mSideType) == LLLayoutStack::HORIZONTAL) { - button->reshape(llclamp(button->getRect().getWidth(), mMinButtonWidth, mMaxButtonWidth), max_row_girth); + button->reshape(llclamp(button->getRect().getWidth(), button->mMinWidth, button->mMaxWidth), max_row_girth); } else // VERTICAL { @@ -384,10 +378,10 @@ void LLToolBar::updateLayoutAsNeeded() BOOST_FOREACH(LLToolBarButton* button, mButtons) { - button->reshape(mMinButtonWidth, mButtonHeight); + button->reshape(button->mMinWidth, button->mDesiredHeight); button->autoResize(); - S32 button_clamped_width = llclamp(button->getRect().getWidth(), mMinButtonWidth, mMaxButtonWidth); + S32 button_clamped_width = llclamp(button->getRect().getWidth(), button->mMinWidth, button->mMaxWidth); S32 button_length = (orientation == LLLayoutStack::HORIZONTAL) ? button_clamped_width : button->getRect().getHeight(); @@ -402,7 +396,7 @@ void LLToolBar::updateLayoutAsNeeded() { if (orientation == LLLayoutStack::VERTICAL) { // row girth (width in this case) is clamped to allowable button widths - max_row_girth = llclamp(max_row_girth, mMinButtonWidth, mMaxButtonWidth); + max_row_girth = llclamp(max_row_girth, button->mMinWidth, button->mMaxWidth); } // make buttons in current row all same girth @@ -546,6 +540,9 @@ LLToolBarButton::LLToolBarButton(const Params& p) : LLButton(p), mMouseDownX(0), mMouseDownY(0), + mMinWidth(p.min_button_width), + mMaxWidth(p.max_button_width), + mDesiredHeight(p.desired_height), mId("") {} diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 0bb95f4e9c..5d64630fa6 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -37,9 +37,20 @@ class LLToolBarButton : public LLButton { + friend class LLToolBar; public: struct Params : public LLInitParam::Block { + Optional min_button_width, + max_button_width, + desired_height; + + Params() + : min_button_width("min_button_width", 0), + max_button_width("max_button_width", S32_MAX), + desired_height("desired_height", 20) + {} + }; LLToolBarButton(const Params& p); @@ -51,6 +62,9 @@ private: LLCommandId mId; S32 mMouseDownX; S32 mMouseDownY; + S32 mMinWidth; + S32 mMaxWidth; + S32 mDesiredHeight; }; @@ -106,10 +120,6 @@ public: Optional read_only, wrap; - Optional min_button_width, - max_button_width, - button_height; - Optional pad_left, pad_top, pad_right, @@ -171,10 +181,7 @@ private: bool mWrap; bool mNeedsLayout; - S32 mMinButtonWidth, - mMaxButtonWidth, - mButtonHeight, - mPadLeft, + S32 mPadLeft, mPadRight, mPadTop, mPadBottom, diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 30ef8b8a29..c64488251a 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1342,7 +1342,8 @@ LLUIImagePtr LLUIImageList::getUIImageByID(const LLUUID& image_id, S32 priority) const BOOL use_mips = FALSE; const LLRect scale_rect = LLRect::null; - return loadUIImageByID(image_id, use_mips, scale_rect, (LLViewerTexture::EBoostLevel)priority); + const LLRect clip_rect = LLRect::null; + return loadUIImageByID(image_id, use_mips, scale_rect, clip_rect, (LLViewerTexture::EBoostLevel)priority); } LLUIImagePtr LLUIImageList::getUIImage(const std::string& image_name, S32 priority) @@ -1356,32 +1357,33 @@ LLUIImagePtr LLUIImageList::getUIImage(const std::string& image_name, S32 priori const BOOL use_mips = FALSE; const LLRect scale_rect = LLRect::null; - return loadUIImageByName(image_name, image_name, use_mips, scale_rect, (LLViewerTexture::EBoostLevel)priority); + const LLRect clip_rect = LLRect::null; + return loadUIImageByName(image_name, image_name, use_mips, scale_rect, clip_rect, (LLViewerTexture::EBoostLevel)priority); } LLUIImagePtr LLUIImageList::loadUIImageByName(const std::string& name, const std::string& filename, - BOOL use_mips, const LLRect& scale_rect, LLViewerTexture::EBoostLevel boost_priority ) + BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLViewerTexture::EBoostLevel boost_priority ) { if (boost_priority == LLViewerTexture::BOOST_NONE) { boost_priority = LLViewerTexture::BOOST_UI; } LLViewerFetchedTexture* imagep = LLViewerTextureManager::getFetchedTextureFromFile(filename, MIPMAP_NO, boost_priority); - return loadUIImage(imagep, name, use_mips, scale_rect); + return loadUIImage(imagep, name, use_mips, scale_rect, clip_rect); } LLUIImagePtr LLUIImageList::loadUIImageByID(const LLUUID& id, - BOOL use_mips, const LLRect& scale_rect, LLViewerTexture::EBoostLevel boost_priority) + BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLViewerTexture::EBoostLevel boost_priority) { if (boost_priority == LLViewerTexture::BOOST_NONE) { boost_priority = LLViewerTexture::BOOST_UI; } LLViewerFetchedTexture* imagep = LLViewerTextureManager::getFetchedTexture(id, MIPMAP_NO, boost_priority); - return loadUIImage(imagep, id.asString(), use_mips, scale_rect); + return loadUIImage(imagep, id.asString(), use_mips, scale_rect, clip_rect); } -LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const std::string& name, BOOL use_mips, const LLRect& scale_rect) +LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const std::string& name, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect) { if (!imagep) return NULL; @@ -1402,13 +1404,14 @@ LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const st LLUIImageLoadData* datap = new LLUIImageLoadData; datap->mImageName = name; datap->mImageScaleRegion = scale_rect; + datap->mImageClipRegion = clip_rect; imagep->setLoadedCallback(onUIImageLoaded, 0, FALSE, FALSE, datap, NULL); } return new_imagep; } -LLUIImagePtr LLUIImageList::preloadUIImage(const std::string& name, const std::string& filename, BOOL use_mips, const LLRect& scale_rect) +LLUIImagePtr LLUIImageList::preloadUIImage(const std::string& name, const std::string& filename, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect) { // look for existing image uuid_ui_image_map_t::iterator found_it = mUIImages.find(name); @@ -1418,7 +1421,7 @@ LLUIImagePtr LLUIImageList::preloadUIImage(const std::string& name, const std::s llerrs << "UI Image " << name << " already loaded." << llendl; } - return loadUIImageByName(name, filename, use_mips, scale_rect); + return loadUIImageByName(name, filename, use_mips, scale_rect, clip_rect); } //static @@ -1432,6 +1435,7 @@ void LLUIImageList::onUIImageLoaded( BOOL success, LLViewerFetchedTexture *src_v LLUIImageLoadData* image_datap = (LLUIImageLoadData*)user_data; std::string ui_image_name = image_datap->mImageName; LLRect scale_rect = image_datap->mImageScaleRegion; + LLRect clip_rect = image_datap->mImageClipRegion; if (final) { delete image_datap; @@ -1448,9 +1452,21 @@ void LLUIImageList::onUIImageLoaded( BOOL success, LLViewerFetchedTexture *src_v // from power-of-2 gl image if (success && imagep.notNull() && src_vi && (src_vi->getUrl().compare(0, 7, "file://")==0)) { - F32 clip_x = (F32)src_vi->getOriginalWidth() / (F32)src_vi->getFullWidth(); - F32 clip_y = (F32)src_vi->getOriginalHeight() / (F32)src_vi->getFullHeight(); - imagep->setClipRegion(LLRectf(0.f, clip_y, clip_x, 0.f)); + F32 full_width = (F32)src_vi->getFullWidth(); + F32 full_height = (F32)src_vi->getFullHeight(); + F32 clip_x = (F32)src_vi->getOriginalWidth() / full_width; + F32 clip_y = (F32)src_vi->getOriginalHeight() / full_height; + if (clip_rect != LLRect::null) + { + imagep->setClipRegion(LLRectf(llclamp((F32)clip_rect.mLeft / full_width, 0.f, 1.f), + llclamp((F32)clip_rect.mTop / full_height, 0.f, 1.f), + llclamp((F32)clip_rect.mRight / full_width, 0.f, 1.f), + llclamp((F32)clip_rect.mBottom / full_height, 0.f, 1.f))); + } + else + { + imagep->setClipRegion(LLRectf(0.f, clip_y, clip_x, 0.f)); + } if (scale_rect != LLRect::null) { imagep->setScaleRegion( @@ -1471,6 +1487,7 @@ struct UIImageDeclaration : public LLInitParam::Block Optional file_name; Optional preload; Optional scale; + Optional clip; Optional use_mips; UIImageDeclaration() @@ -1478,6 +1495,7 @@ struct UIImageDeclaration : public LLInitParam::Block file_name("file_name"), preload("preload", false), scale("scale"), + clip("clip"), use_mips("use_mips", false) {} }; @@ -1572,7 +1590,7 @@ bool LLUIImageList::initFromFile() { continue; } - preloadUIImage(image.name, file_name, image.use_mips, image.scale); + preloadUIImage(image.name, file_name, image.use_mips, image.scale, image.clip); } if (cur_pass == PASS_DECODE_NOW && !gSavedSettings.getBOOL("NoPreload")) diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 7f4dd0ae88..e0a362596d 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -220,24 +220,27 @@ public: bool initFromFile(); - LLPointer preloadUIImage(const std::string& name, const std::string& filename, BOOL use_mips, const LLRect& scale_rect); + LLPointer preloadUIImage(const std::string& name, const std::string& filename, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect); static void onUIImageLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); private: LLPointer loadUIImageByName(const std::string& name, const std::string& filename, BOOL use_mips = FALSE, const LLRect& scale_rect = LLRect::null, + const LLRect& clip_rect = LLRect::null, LLViewerTexture::EBoostLevel boost_priority = LLViewerTexture::BOOST_UI); LLPointer loadUIImageByID(const LLUUID& id, BOOL use_mips = FALSE, const LLRect& scale_rect = LLRect::null, + const LLRect& clip_rect = LLRect::null, LLViewerTexture::EBoostLevel boost_priority = LLViewerTexture::BOOST_UI); - LLPointer loadUIImage(LLViewerFetchedTexture* imagep, const std::string& name, BOOL use_mips = FALSE, const LLRect& scale_rect = LLRect::null); + LLPointer loadUIImage(LLViewerFetchedTexture* imagep, const std::string& name, BOOL use_mips = FALSE, const LLRect& scale_rect = LLRect::null, const LLRect& clip_rect = LLRect::null); struct LLUIImageLoadData { std::string mImageName; LLRect mImageScaleRegion; + LLRect mImageClipRegion; }; typedef std::map< std::string, LLPointer > uuid_ui_image_map_t; diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 4462fb792f..68773947ec 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -473,7 +473,11 @@ with the same filename but different name - + + + + + diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml index d8f593715f..cf566d7d23 100644 --- a/indra/newview/skins/default/xui/en/main_view.xml +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -100,12 +100,12 @@ visible="false" width="500"/> - + visible="false"/>--> diff --git a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml index 7bbacc0152..44da813f61 100644 --- a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml +++ b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml @@ -39,6 +39,7 @@ width="30" mouse_opaque="false"> - - - Date: Mon, 3 Oct 2011 11:28:22 -0700 Subject: updated xui for toybox to reflect changes to param blocks --- indra/newview/skins/default/xui/en/floater_toybox.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_toybox.xml b/indra/newview/skins/default/xui/en/floater_toybox.xml index feb19571b2..de39032cbf 100644 --- a/indra/newview/skins/default/xui/en/floater_toybox.xml +++ b/indra/newview/skins/default/xui/en/floater_toybox.xml @@ -48,8 +48,8 @@ button_display_mode="icons_with_text" follows="all" left="20" - max_button_width="140" - min_button_width="70" + button_icon_and_text.max_button_width="140" + button_icon_and_text.min_button_width="70" name="toybox_toolbar" pad_left="5" pad_right="5" -- cgit v1.2.3