From 89b6e92b6cb60d326db0f3f129bf5227513d3b5c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 22 Sep 2011 11:17:42 -0700 Subject: removed unused toolbar files --- indra/newview/lltoolbar.cpp | 365 -------------------------------------------- indra/newview/lltoolbar.h | 82 ---------- 2 files changed, 447 deletions(-) delete mode 100644 indra/newview/lltoolbar.cpp delete mode 100644 indra/newview/lltoolbar.h (limited to 'indra') diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp deleted file mode 100644 index c4f599561d..0000000000 --- a/indra/newview/lltoolbar.cpp +++ /dev/null @@ -1,365 +0,0 @@ -/** - * @file lltoolbar.cpp - * @author James Cook, Richard Nelson - * @brief Large friendly buttons at bottom of screen. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "lltoolbar.h" - -#include "imageids.h" -#include "llfloaterreg.h" -#include "llfontgl.h" -#include "llflyoutbutton.h" -#include "llrect.h" -#include "llparcel.h" - -#include "llagent.h" -#include "llagentwearables.h" -#include "llbutton.h" -#include "llfocusmgr.h" -#include "llviewercontrol.h" -#include "llmenucommands.h" -#include "llimview.h" -#include "lluiconstants.h" -#include "llvoavatarself.h" -#include "lltooldraganddrop.h" -#include "llfloaterinventory.h" -#include "llfloaterchatterbox.h" -#include "llfloatersnapshot.h" -#include "llinventorypanel.h" -#include "lltoolmgr.h" -#include "llui.h" -#include "llviewermenu.h" -//#include "llfirstuse.h" -#include "llpanelblockedlist.h" -#include "llscrolllistctrl.h" -#include "llscrolllistitem.h" -#include "llscrolllistcell.h" -#include "llviewerparcelmgr.h" -#include "lluictrlfactory.h" -#include "llviewerwindow.h" -#include "lltoolgrab.h" -#include "llcombobox.h" -#include "lllayoutstack.h" - -#if LL_DARWIN - - #include "llresizehandle.h" - -#endif // LL_DARWIN - -// -// Globals -// - -LLToolBar *gToolBar = NULL; - -// -// Statics -// -F32 LLToolBar::sInventoryAutoOpenTime = 1.f; - -// -// Functions -// - -LLToolBar::LLToolBar() - : LLPanel(), - - mInventoryAutoOpen(FALSE), - mNumUnreadIMs(0) -#if LL_DARWIN - , mResizeHandle(NULL) -#endif // LL_DARWIN -{ - setIsChrome(TRUE); - setFocusRoot(TRUE); - - mCommitCallbackRegistrar.add("HandleCommunicate", &LLToolBar::onClickCommunicate); -} - - -BOOL LLToolBar::postBuild() -{ - for (child_list_const_iter_t child_iter = getChildList()->begin(); - child_iter != getChildList()->end(); ++child_iter) - { - LLView *view = *child_iter; - LLButton* buttonp = dynamic_cast(view); - if(buttonp) - { - buttonp->setSoundFlags(LLView::SILENT); - } - } - -#if LL_DARWIN - if(mResizeHandle == NULL) - { - LLRect rect(0, 0, RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT); - LLResizeHandle::Params p; - p.name(""); - p.rect(rect); - p.min_width(RESIZE_HANDLE_WIDTH); - p.min_height(RESIZE_HANDLE_HEIGHT); - p.enabled(false); - mResizeHandle = LLUICtrlFactory::create(p); - addChildInBack(mResizeHandle); - LLLayoutStack* toolbar_stack = getChild("toolbar_stack"); - toolbar_stack->reshape(toolbar_stack->getRect().getWidth() - RESIZE_HANDLE_WIDTH, toolbar_stack->getRect().getHeight()); - } -#endif // LL_DARWIN - - layoutButtons(); - - return TRUE; -} - -LLToolBar::~LLToolBar() -{ - // LLView destructor cleans up children -} - - -BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg) -{ - LLButton* inventory_btn = getChild("inventory_btn"); - if (!inventory_btn) return FALSE; - - LLRect button_screen_rect; - inventory_btn->localRectToScreen(inventory_btn->getRect(),&button_screen_rect); - - const LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); - if(active_panel) - { - mInventoryAutoOpen = FALSE; - } - else if (button_screen_rect.pointInRect(x, y)) - { - if (mInventoryAutoOpen) - { - if (!active_panel && - mInventoryAutoOpenTimer.getElapsedTimeF32() > sInventoryAutoOpenTime) - { - LLFloaterInventory::showAgentInventory(); - } - } - else - { - mInventoryAutoOpen = TRUE; - mInventoryAutoOpenTimer.reset(); - } - } - - return LLPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); -} - -// static -void LLToolBar::toggle(void*) -{ - BOOL show = gSavedSettings.getBOOL("ShowToolBar"); - gSavedSettings.setBOOL("ShowToolBar", !show); - gToolBar->setVisible(!show); -} - - -// static -BOOL LLToolBar::visible(void*) -{ - return gToolBar->getVisible(); -} - - -void LLToolBar::layoutButtons() -{ -#if LL_DARWIN - const S32 FUDGE_WIDTH_OF_SCREEN = 4; - S32 width = gViewerWindow->getWindowWidthScaled() + FUDGE_WIDTH_OF_SCREEN; - S32 pad = 2; - - // this function may be called before postBuild(), in which case mResizeHandle won't have been set up yet. - if(mResizeHandle != NULL) - { - // Only when running in windowed mode on the Mac, leave room for a resize widget on the right edge of the bar. - width -= RESIZE_HANDLE_WIDTH; - - LLRect r; - r.mLeft = width - pad; - r.mBottom = 0; - r.mRight = r.mLeft + RESIZE_HANDLE_WIDTH; - r.mTop = r.mBottom + RESIZE_HANDLE_HEIGHT; - mResizeHandle->setRect(r); - mResizeHandle->setVisible(TRUE); - } -#endif // LL_DARWIN -} - - -// virtual -void LLToolBar::reshape(S32 width, S32 height, BOOL called_from_parent) -{ - LLPanel::reshape(width, height, called_from_parent); - - layoutButtons(); -} - - -// Per-frame updates of visibility -void LLToolBar::refresh() -{ - BOOL show = gSavedSettings.getBOOL("ShowToolBar"); - BOOL mouselook = gAgent.cameraMouselook(); - setVisible(show && !mouselook); - - if (isInVisibleChain()) - { - updateCommunicateList(); - } -} - -void LLToolBar::updateCommunicateList() -{ - LLFlyoutButton* communicate_button = getChild("communicate_btn"); - LLSD selected = communicate_button->getValue(); - - communicate_button->removeall(); - - //LLFloater* frontmost_floater = LLFloaterChatterBox::getInstance()->getActiveFloater(); - LLScrollListItem* itemp = NULL; - - LLSD contact_sd; - contact_sd["value"] = "contacts"; - /*contact_sd["columns"][0]["value"] = LLFloaterMyFriends::getInstance()->getShortTitle(); - if (LLFloaterMyFriends::getInstance() == frontmost_floater) - { - contact_sd["columns"][0]["font"]["name"] = "SANSSERIF_SMALL"; - contact_sd["columns"][0]["font"]["style"] = "BOLD"; - // make sure current tab is selected in list - if (selected.isUndefined()) - { - selected = "contacts"; - } - }*/ - itemp = communicate_button->addElement(contact_sd, ADD_TOP); - - communicate_button->addSeparator(ADD_TOP); - communicate_button->add(getString("Redock Windows"), LLSD("redock"), ADD_TOP); - communicate_button->addSeparator(ADD_TOP); - communicate_button->add(getString("Blocked List"), LLSD("mute list"), ADD_TOP); - - std::set >::const_iterator floater_handle_it; - - /*if (gIMMgr->getIMFloaterHandles().size() > 0) - { - communicate_button->addSeparator(ADD_TOP); - } - - for(floater_handle_it = gIMMgr->getIMFloaterHandles().begin(); floater_handle_it != gIMMgr->getIMFloaterHandles().end(); ++floater_handle_it) - { - LLFloaterIMPanel* im_floaterp = (LLFloaterIMPanel*)floater_handle_it->get(); - if (im_floaterp) - { - std::string floater_title = im_floaterp->getNumUnreadMessages() > 0 ? "*" : ""; - floater_title.append(im_floaterp->getShortTitle()); - LLSD im_sd; - im_sd["value"] = im_floaterp->getSessionID(); - im_sd["columns"][0]["value"] = floater_title; - if (im_floaterp == frontmost_floater) - { - im_sd["columns"][0]["font"]["name"] = "SANSSERIF_SMALL"; - im_sd["columns"][0]["font"]["style"] = "BOLD"; - if (selected.isUndefined()) - { - selected = im_floaterp->getSessionID(); - } - } - itemp = communicate_button->addElement(im_sd, ADD_TOP); - } - }*/ - - communicate_button->setValue(selected); -} - - -// static -void LLToolBar::onClickCommunicate(LLUICtrl* ctrl, const LLSD& user_data) -{ - LLFlyoutButton* communicate_button = dynamic_cast(ctrl); - llassert_always(communicate_button); - - LLSD selected_option = communicate_button->getValue(); - - if (selected_option.asString() == "contacts") - { - LLFloaterReg::showInstance("contacts", "friends"); - } - else if (selected_option.asString() == "local chat") - { - LLFloaterReg::showInstance("communicate", "local"); - } - else if (selected_option.asString() == "redock") - { - /*LLFloaterChatterBox* chatterbox_instance = LLFloaterChatterBox::getInstance(); - if(chatterbox_instance) - { - chatterbox_instance->addFloater(LLFloaterMyFriends::getInstance(), FALSE); - - LLUUID session_to_show; - - std::set >::const_iterator floater_handle_it; - for(floater_handle_it = gIMMgr->getIMFloaterHandles().begin(); floater_handle_it != gIMMgr->getIMFloaterHandles().end(); ++floater_handle_it) - { - LLFloater* im_floaterp = floater_handle_it->get(); - if (im_floaterp) - { - if (im_floaterp->isFrontmost()) - { - session_to_show = ((LLFloaterIMPanel*)im_floaterp)->getSessionID(); - } - chatterbox_instance->addFloater(im_floaterp, FALSE); - } - } - LLFloaterReg::showInstance("communicate", session_to_show); - }*/ - } - else if (selected_option.asString() == "mute list") - { - LLPanelBlockedList::showPanelAndSelect(LLUUID::null); - } - else if (selected_option.isUndefined()) // user just clicked the communicate button, treat as toggle - { - /*LLFloaterReg::toggleInstance("communicate");*/ - } - else // otherwise selection_option is undifined or a specific IM session id - { - /*LLFloaterReg::showInstance("communicate", selected_option);*/ - } -} - - diff --git a/indra/newview/lltoolbar.h b/indra/newview/lltoolbar.h deleted file mode 100644 index 217b3c0ac8..0000000000 --- a/indra/newview/lltoolbar.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @file lltoolbar.h - * @brief Large friendly buttons at bottom of screen. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLTOOLBAR_H -#define LL_LLTOOLBAR_H - -#include "llpanel.h" - -#include "llframetimer.h" - -class LLResizeHandle; - -class LLToolBar -: public LLPanel -{ -public: - LLToolBar(); - ~LLToolBar(); - - /*virtual*/ BOOL postBuild(); - - /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg); - - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - - static void toggle(void*); - static BOOL visible(void*); - - // Move buttons to appropriate locations based on rect. - void layoutButtons(); - - // Per-frame refresh call - void refresh(); - - // callbacks - static void onClickCommunicate(LLUICtrl*, const LLSD&); - - static F32 sInventoryAutoOpenTime; - -private: - void updateCommunicateList(); - - -private: - BOOL mInventoryAutoOpen; - LLFrameTimer mInventoryAutoOpenTimer; - S32 mNumUnreadIMs; -#if LL_DARWIN - LLResizeHandle *mResizeHandle; -#endif // LL_DARWIN -}; - -extern LLToolBar *gToolBar; - -#endif -- cgit v1.2.3 From 00f66ccf409b0f7fb974f23cd157cdd0b8a6ab96 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 22 Sep 2011 15:08:59 -0700 Subject: EXP-1239 WIP make toolbars wrap when there is not enough room added more toolbars to floater_test_toolbar.xml removed layout stack and got basic wrapping working reviewed by Leslie --- indra/llui/lltoolbar.cpp | 196 +++++++++++---------- indra/llui/lltoolbar.h | 13 +- indra/newview/lldndbutton.cpp | 9 +- indra/newview/lldndbutton.h | 5 +- .../skins/default/xui/en/floater_test_toolbar.xml | 47 ++++- 5 files changed, 150 insertions(+), 120 deletions(-) (limited to 'indra') diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 1e8be93f17..f623d99dc7 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -57,8 +57,8 @@ LLToolBar::Params::Params() button_icon("button_icon"), button_icon_and_text("button_icon_and_text"), wrap("wrap", true), - min_width("min_width", 0), - max_width("max_width", S32_MAX), + min_button_width("min_button_width", 0), + max_button_width("max_button_width", S32_MAX), background_image("background_image") {} @@ -70,8 +70,8 @@ LLToolBar::LLToolBar(const Params& p) mNeedsLayout(false), mCenterPanel(NULL), mCenteringStack(NULL), - mMinWidth(p.min_width), - mMaxWidth(p.max_width), + mMinButtonWidth(p.min_button_width), + mMaxButtonWidth(p.max_button_width), mBackgroundImage(p.background_image) { } @@ -108,120 +108,148 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p) mCenteringStack->addChild(LLUICtrlFactory::create(border_panel_p)); - addRow(); - BOOST_FOREACH (LLToolBarButton::Params button_p, p.buttons) { + // buttons always follow left and top, for all orientations + button_p.follows.flags = FOLLOWS_LEFT|FOLLOWS_TOP; + button_p.fillFrom((mButtonType == BTNTYPE_ICONS_ONLY) + ? p.button_icon // icon only + : p.button_icon_and_text); // icon + text + LLRect button_rect(button_p.rect); { // remove any offset from button if (orientation == LLLayoutStack::HORIZONTAL) { - button_rect.setOriginAndSize(0, 0, mMinWidth, getRect().getHeight()); + button_rect.setOriginAndSize(0, 0, mMinButtonWidth, button_rect.getHeight()); } else // VERTICAL { - button_rect.setOriginAndSize(0, 0, mMinWidth, button_rect.getHeight()); + button_rect.setOriginAndSize(0, 0, mMinButtonWidth, button_rect.getHeight()); } } - button_p.fillFrom((mButtonType == BTNTYPE_ICONS_ONLY) - ? p.button_icon // icon only - : p.button_icon_and_text); // icon + text + // use our calculated rect + button_p.rect = button_rect; + LLToolBarButton* buttonp = LLUICtrlFactory::create(button_p); + + mButtons.push_back(buttonp); + mCenterPanel->addChild(buttonp); - mButtons.push_back(LLUICtrlFactory::create(button_p)); mNeedsLayout = true; } - - updateLayout(); } -void LLToolBar::addButton(LLToolBarButton* buttonp) +void LLToolBar::updateLayoutAsNeeded() { - LLLayoutPanel::Params panel_p; - panel_p.name = buttonp->getName() + "_panel"; - panel_p.user_resize = false; - panel_p.auto_resize= false; - panel_p.fit_content = true; + if (!mNeedsLayout) return; - LLLayoutPanel* panel = LLUICtrlFactory::create(panel_p); - - panel->addChild(buttonp); - mStacks.back()->addChild(panel); -} + LLLayoutStack::ELayoutOrientation orientation = getOrientation(mSideType); -void LLToolBar::updateLayout() -{ - mCenteringStack->updateLayout(); + // our terminology for orientation-agnostic layout is that + // length refers to a distance in the direction we stack the buttons + // and girth refers to a distance in the direction buttons wrap + S32 total_length = 0; + S32 max_length = (orientation == LLLayoutStack::HORIZONTAL) + ? getRect().getWidth() + : getRect().getHeight(); + S32 max_row_girth = 0; + S32 cur_start = 0; + S32 cur_row = 0; - if (!mNeedsLayout) return; - mNeedsLayout = false; + LLRect panel_rect = mCenterPanel->getLocalRect(); - { // clean up existing rows - BOOST_FOREACH(LLToolBarButton* button, mButtons) - { - if (button->getParent()) + std::vector buttons_in_row; + + BOOST_FOREACH(LLToolBarButton* button, mButtons) + { + S32 button_clamped_width = llclamp(button->getRect().getWidth(), mMinButtonWidth, mMaxButtonWidth); + S32 button_length = (orientation == LLLayoutStack::HORIZONTAL) + ? button_clamped_width + : button->getRect().getHeight(); + S32 button_girth = (orientation == LLLayoutStack::HORIZONTAL) + ? button->getRect().getHeight() + : button_clamped_width; + + // handle wrapping + if (total_length + button_length > max_length + && cur_start != 0) // not first button in row + { // go ahead and wrap + if (orientation == LLLayoutStack::VERTICAL) + { + // row girth is clamped to allowable button widths + max_row_girth = llclamp(max_row_girth, mMinButtonWidth, mMaxButtonWidth); + } + // make buttons in current row all same girth + BOOST_FOREACH(LLToolBarButton* button, buttons_in_row) { - button->getParent()->removeChild(button); + if (orientation == LLLayoutStack::HORIZONTAL) + { + button->reshape(llclamp(button->getRect().getWidth(), mMinButtonWidth, mMaxButtonWidth), max_row_girth); + } + else // VERTICAL + { + button->reshape(max_row_girth, button->getRect().getHeight()); + } } - } + buttons_in_row.clear(); - BOOST_FOREACH(LLLayoutStack* stack, mStacks) - { - delete stack; + total_length = 0; + cur_start = 0; + cur_row += max_row_girth; + max_row_girth = 0; } - mStacks.clear(); - } - // start with one row of buttons - addRow(); - - S32 total_width = 0, total_height = 0; - S32 max_total_width = 0, max_total_height = 0; - S32 max_width = getRect().getWidth(), max_height = getRect().getHeight(); - BOOST_FOREACH(LLToolBarButton* button, mButtons) - { - S32 button_width = button->getRect().getWidth(); - S32 button_height = button->getRect().getHeight(); - if (getOrientation(mSideType) == LLLayoutStack::HORIZONTAL - && total_width + button_height > getRect().getWidth()) + LLRect button_rect; + if (orientation == LLLayoutStack::HORIZONTAL) + { + button_rect.setLeftTopAndSize(cur_start, panel_rect.mTop - cur_row, button_clamped_width, button->getRect().getHeight()); + } + else // VERTICAL { - addRow(); - total_width = 0; + button_rect.setLeftTopAndSize(cur_row, panel_rect.mTop - cur_start, button_clamped_width, button->getRect().getHeight()); } - addButton(button); - - total_width += button_width; - total_height += button_height; - max_total_width = llmax(max_total_width, total_width); - max_total_height = llmax(max_total_height, total_height); - max_width = llmax(button->getRect().getWidth(), max_width); - max_height = llmax(button->getRect().getHeight(), max_height); + button->setShape(button_rect); + + buttons_in_row.push_back(button); + + total_length += button_length; + cur_start = total_length; + max_row_girth = llmax(button_girth, max_row_girth); } - if (getOrientation(mSideType) == LLLayoutStack::HORIZONTAL) + // final resizing in "girth" direction + S32 total_girth = cur_row + max_row_girth; // increment by size of final row + + // grow and optionally shift toolbar to accomodate buttons + if (orientation == LLLayoutStack::HORIZONTAL) { - BOOST_FOREACH(LLLayoutStack* stack, mStacks) - { - stack->reshape(max_total_width, stack->getParent()->getRect().getHeight()); - stack->updateLayout(); + if (mSideType == SIDE_TOP) + { // shift down to maintain top edge + translate(0, getRect().getHeight() - total_girth); } + + reshape(getRect().getWidth(), total_girth); } - else + else // VERTICAL { - BOOST_FOREACH(LLLayoutStack* stack, mStacks) - { - stack->reshape(stack->getParent()->getRect().getWidth(), max_total_height); - stack->updateLayout(); + if (mSideType == SIDE_RIGHT) + { // shift left to maintain right edge + translate(getRect().getWidth() - total_girth, 0); } - - reshape(max_total_width, getRect().getHeight()); + reshape(total_girth, getRect().getHeight()); } + + // recenter toolbar buttons + mCenteringStack->updateLayout(); + + // don't clear flag until after we've resized ourselves, to avoid laying out every frame + mNeedsLayout = false; } void LLToolBar::draw() { - updateLayout(); + updateLayoutAsNeeded(); { // draw background LLRect bg_rect; @@ -231,22 +259,6 @@ void LLToolBar::draw() LLUICtrl::draw(); } -void LLToolBar::addRow() -{ - LLLayoutStack::ELayoutOrientation orientation = getOrientation(mSideType); - - LLLayoutStack::Params stack_p; - stack_p.rect = getLocalRect(); - stack_p.name = llformat("button_stack_%d", mStacks.size()); - stack_p.orientation = orientation; - stack_p.follows.flags = (orientation == LLLayoutStack::HORIZONTAL) - ? (FOLLOWS_TOP|FOLLOWS_BOTTOM) // horizontal - : (FOLLOWS_LEFT|FOLLOWS_RIGHT); // vertical - - mStacks.push_back(LLUICtrlFactory::create(stack_p)); - mCenterPanel->addChild(mStacks.back()); -} - void LLToolBar::reshape(S32 width, S32 height, BOOL called_from_parent) { LLUICtrl::reshape(width, height, called_from_parent); diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 3a593e42d9..31729e32b4 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -93,8 +93,8 @@ public: button_icon_and_text; Optional wrap; - Optional min_width, - max_width; + Optional min_button_width, + max_button_width; // get rid of this Multiple buttons; @@ -112,11 +112,9 @@ protected: LLToolBar(const Params&); void initFromParams(const Params&); - void addButton(LLToolBarButton* buttonp); - void updateLayout(); private: - void addRow(); + void updateLayoutAsNeeded(); std::list mButtons; LLToolBarEnums::ButtonType mButtonType; @@ -125,11 +123,10 @@ private: LLLayoutPanel* mCenterPanel; LLToolBarEnums::SideType mSideType; - std::vector mStacks; bool mWrap; bool mNeedsLayout; - S32 mMinWidth, - mMaxWidth; + S32 mMinButtonWidth, + mMaxButtonWidth; LLUIImagePtr mBackgroundImage; }; diff --git a/indra/newview/lldndbutton.cpp b/indra/newview/lldndbutton.cpp index 8a38c8a643..7c9dda6b1d 100644 --- a/indra/newview/lldndbutton.cpp +++ b/indra/newview/lldndbutton.cpp @@ -31,16 +31,9 @@ static LLDefaultChildRegistry::Register r("dnd_button"); -LLDragAndDropButton::Params::Params() -{ - -} - LLDragAndDropButton::LLDragAndDropButton(const Params& params) : LLButton(params) -{ - -} +{} BOOL LLDragAndDropButton::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg) { diff --git a/indra/newview/lldndbutton.h b/indra/newview/lldndbutton.h index 0642cbb7b9..53ea2f5ea7 100644 --- a/indra/newview/lldndbutton.h +++ b/indra/newview/lldndbutton.h @@ -43,10 +43,7 @@ class LLDragAndDropButton : public LLButton { public: - struct Params : public LLInitParam::Block - { - Params(); - }; + struct Params : public LLInitParam::Block {}; LLDragAndDropButton(const Params& params); diff --git a/indra/newview/skins/default/xui/en/floater_test_toolbar.xml b/indra/newview/skins/default/xui/en/floater_test_toolbar.xml index 138322eca7..85f0f104fc 100644 --- a/indra/newview/skins/default/xui/en/floater_test_toolbar.xml +++ b/indra/newview/skins/default/xui/en/floater_test_toolbar.xml @@ -7,33 +7,64 @@ name="floater_test_toolbar" translate="false" width="500"> -