From e0450b604383f3a0276097496f1935e1b543ec5e Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Fri, 4 Sep 2009 18:53:30 -0700 Subject: Integrated 1.23's tool floater with link/unlink buttons --- linden/indra/newview/llfloatertelehub.cpp | 1 - linden/indra/newview/llfloatertools.cpp | 81 +++------- linden/indra/newview/llfloatertools.h | 4 - linden/indra/newview/llviewermenu.cpp | 1 - .../skins/default/xui/en-us/floater_tools.xml | 173 +++++++++++---------- 5 files changed, 107 insertions(+), 153 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/llfloatertelehub.cpp b/linden/indra/newview/llfloatertelehub.cpp index 943bc36..062306b 100644 --- a/linden/indra/newview/llfloatertelehub.cpp +++ b/linden/indra/newview/llfloatertelehub.cpp @@ -68,7 +68,6 @@ void LLFloaterTelehub::show() // Find tools floater, glue to bottom if (gFloaterTools) { - gFloaterTools->showMore(FALSE); LLRect tools_rect = gFloaterTools->getRect(); S32 our_width = sInstance->getRect().getWidth(); S32 our_height = sInstance->getRect().getHeight(); diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp index 84a1edc..a99227d 100644 --- a/linden/indra/newview/llfloatertools.cpp +++ b/linden/indra/newview/llfloatertools.cpp @@ -54,6 +54,7 @@ #include "llpanelobject.h" #include "llpanelvolume.h" #include "llpanelpermissions.h" +#include "llresmgr.h" #include "llselectmgr.h" #include "llslider.h" #include "llstatusbar.h" @@ -329,14 +330,10 @@ BOOL LLFloaterTools::postBuild() // the setting stores the actual force multiplier, but the slider is logarithmic, so we convert here childSetValue( "slider force", log10(gSavedSettings.getF32("LandBrushForce"))); - childSetAction("button more", click_show_more, this); - childSetAction("button less", click_show_more, this); mTab = getChild("Object Info Tabs"); if(mTab) { - mTab->setVisible( gSavedSettings.getBOOL("ToolboxShowMore") ); mTab->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); - mTab->setVisible( gSavedSettings.getBOOL("ToolboxShowMore") ); mTab->setBorderVisible(FALSE); mTab->selectFirstTab(); } @@ -436,19 +433,6 @@ LLFloaterTools::LLFloaterTools() factory_map["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo LLUICtrlFactory::getInstance()->buildFloater(this,"floater_tools.xml",&factory_map,FALSE); - - mLargeHeight = getRect().getHeight(); - mSmallHeight = mLargeHeight; - if (mTab) mSmallHeight -= mTab->getRect().getHeight(); - - // force a toggle initially. seems to be needed to correctly initialize - // both "more" and "less" cases. it also seems to be important to begin - // with the user's preference first so that it's initial position will - // be correct (SL-51192) -MG - BOOL show_more = gSavedSettings.getBOOL("ToolboxShowMore"); // get user's preference - gSavedSettings.setBOOL("ToolboxShowMore", show_more); // sets up forced toggle below - showMore( !show_more ); // does the toggle - showMore( show_more ); // reset the real user's preference } LLFloaterTools::~LLFloaterTools() @@ -492,6 +476,16 @@ void LLFloaterTools::refresh() mTab->enableTabButton(idx_face, all_volume); mTab->enableTabButton(idx_contents, all_volume); + // Refresh object and prim count labels + LLLocale locale(LLLocale::USER_LOCALE); + std::string obj_count_string; + LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()); + childSetTextArg("obj_count", "[COUNT]", obj_count_string); + std::string prim_count_string; + LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); + childSetTextArg("prim_count", "[COUNT]", prim_count_string); + + // Refresh child tabs mPanelPermissions->refresh(); mPanelObject->refresh(); mPanelVolume->refresh(); @@ -799,8 +793,8 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) if (mSliderDozerSize) { mSliderDozerSize ->setVisible( land_visible ); - childSetVisible("Brush:", land_visible); - childSetVisible("Brush Size:", land_visible); + childSetVisible("Bulldozer:", land_visible); + childSetVisible("Dozer Size:", land_visible); } if (mCheckShowOwners) { @@ -812,13 +806,10 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) childSetVisible("Strength:", land_visible); } - // - // More panel visibility - // - BOOL show_more = gSavedSettings.getBOOL("ToolboxShowMore"); - - mTab->setVisible(show_more && tool != LLToolBrushLand::getInstance() && tool != LLToolSelectLand::getInstance()); - mPanelLandInfo->setVisible(show_more && (tool == LLToolBrushLand::getInstance() || tool == LLToolSelectLand::getInstance())); + childSetVisible("obj_count", !land_visible); + childSetVisible("prim_count", !land_visible); + mTab->setVisible(!land_visible); + mPanelLandInfo->setVisible(land_visible); } @@ -873,46 +864,12 @@ void LLFloaterTools::onClose(bool app_quitting) // gMenuBarView->arrange(); } -void LLFloaterTools::showMore(BOOL show_more) -{ - BOOL showing_more = gSavedSettings.getBOOL("ToolboxShowMore"); - if (show_more == showing_more) - { - return; - } - - gSavedSettings.setBOOL("ToolboxShowMore", show_more); - - // Visibility updated next frame - JC - // mTab->setVisible(show_more); - - if (show_more) - { - reshape( getRect().getWidth(), mLargeHeight, TRUE); - translate( 0, mSmallHeight - mLargeHeight ); - } - else - { - reshape( getRect().getWidth(), mSmallHeight, TRUE); - translate( 0, mLargeHeight - mSmallHeight ); - } - childSetVisible("button less", show_more); - childSetVisible("button more", !show_more); -} - void LLFloaterTools::showPanel(EInfoPanel panel) { llassert(panel >= 0 && panel < PANEL_COUNT); mTab->selectTabByName(PANEL_NAMES[panel]); } -void click_show_more(void *userdata) -{ - LLFloaterTools *f = (LLFloaterTools *)userdata; - BOOL show_more = !gSavedSettings.getBOOL("ToolboxShowMore"); - f->showMore( show_more ); -} - void click_popup_info(void*) { // gBuildView->setPropertiesPanelOpen(TRUE); @@ -997,8 +954,8 @@ void click_popup_dozer_mode(LLUICtrl *, void *user) void commit_slider_dozer_size(LLUICtrl *ctrl, void*) { - S32 size = (S32)ctrl->getValue().asInteger(); - gSavedSettings.setS32("LandBrushSize", size); + F32 size = (F32)ctrl->getValue().asReal(); + gSavedSettings.setF32("LandBrushSize", size); } void commit_slider_dozer_force(LLUICtrl *ctrl, void*) diff --git a/linden/indra/newview/llfloatertools.h b/linden/indra/newview/llfloatertools.h index 8f88977..1b13b9f 100644 --- a/linden/indra/newview/llfloatertools.h +++ b/linden/indra/newview/llfloatertools.h @@ -95,14 +95,12 @@ public: /*virtual*/ void draw(); void dirty(); - void showMore(BOOL show_more); void showPanel(EInfoPanel panel); void setStatusText(const std::string& text); virtual void onFocusReceived(); static void setEditTool(void* data); void saveLastTool(); - private: static void setObjectType( void* data ); @@ -198,8 +196,6 @@ public: private: BOOL mDirty; - S32 mSmallHeight; - S32 mLargeHeight; std::map mStatusText; diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 51953b09..2e4f3f4 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -5410,7 +5410,6 @@ class LLLandEdit : public view_listener_t LLViewerParcelMgr::getInstance()->selectParcelAt( LLToolPie::getInstance()->getPick().mPosGlobal ); - gFloaterTools->showMore(TRUE); gFloaterView->bringToFront( gFloaterTools ); // Switch to land edit toolset diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml b/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml index 18d56b4..d9b51b1 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml @@ -1,6 +1,6 @@ - @@ -79,20 +79,24 @@ - -