aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatertools.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloatertools.cpp')
-rw-r--r--linden/indra/newview/llfloatertools.cpp93
1 files changed, 26 insertions, 67 deletions
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp
index 84a1edc..d2a8040 100644
--- a/linden/indra/newview/llfloatertools.cpp
+++ b/linden/indra/newview/llfloatertools.cpp
@@ -54,6 +54,7 @@
54#include "llpanelobject.h" 54#include "llpanelobject.h"
55#include "llpanelvolume.h" 55#include "llpanelvolume.h"
56#include "llpanelpermissions.h" 56#include "llpanelpermissions.h"
57#include "llresmgr.h"
57#include "llselectmgr.h" 58#include "llselectmgr.h"
58#include "llslider.h" 59#include "llslider.h"
59#include "llstatusbar.h" 60#include "llstatusbar.h"
@@ -321,7 +322,7 @@ BOOL LLFloaterTools::postBuild()
321 322
322 mSliderDozerSize = getChild<LLSlider>("slider brush size"); 323 mSliderDozerSize = getChild<LLSlider>("slider brush size");
323 childSetCommitCallback("slider brush size", commit_slider_dozer_size, (void*)0); 324 childSetCommitCallback("slider brush size", commit_slider_dozer_size, (void*)0);
324 childSetValue( "slider brush size", gSavedSettings.getS32("LandBrushSize")); 325 childSetValue( "slider brush size", gSavedSettings.getF32("LandBrushSize"));
325 326
326 327
327 mSliderDozerForce = getChild<LLSlider>("slider force"); 328 mSliderDozerForce = getChild<LLSlider>("slider force");
@@ -329,14 +330,10 @@ BOOL LLFloaterTools::postBuild()
329 // the setting stores the actual force multiplier, but the slider is logarithmic, so we convert here 330 // the setting stores the actual force multiplier, but the slider is logarithmic, so we convert here
330 childSetValue( "slider force", log10(gSavedSettings.getF32("LandBrushForce"))); 331 childSetValue( "slider force", log10(gSavedSettings.getF32("LandBrushForce")));
331 332
332 childSetAction("button more", click_show_more, this);
333 childSetAction("button less", click_show_more, this);
334 mTab = getChild<LLTabContainer>("Object Info Tabs"); 333 mTab = getChild<LLTabContainer>("Object Info Tabs");
335 if(mTab) 334 if(mTab)
336 { 335 {
337 mTab->setVisible( gSavedSettings.getBOOL("ToolboxShowMore") );
338 mTab->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); 336 mTab->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT);
339 mTab->setVisible( gSavedSettings.getBOOL("ToolboxShowMore") );
340 mTab->setBorderVisible(FALSE); 337 mTab->setBorderVisible(FALSE);
341 mTab->selectFirstTab(); 338 mTab->selectFirstTab();
342 } 339 }
@@ -436,19 +433,6 @@ LLFloaterTools::LLFloaterTools()
436 factory_map["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo 433 factory_map["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo
437 434
438 LLUICtrlFactory::getInstance()->buildFloater(this,"floater_tools.xml",&factory_map,FALSE); 435 LLUICtrlFactory::getInstance()->buildFloater(this,"floater_tools.xml",&factory_map,FALSE);
439
440 mLargeHeight = getRect().getHeight();
441 mSmallHeight = mLargeHeight;
442 if (mTab) mSmallHeight -= mTab->getRect().getHeight();
443
444 // force a toggle initially. seems to be needed to correctly initialize
445 // both "more" and "less" cases. it also seems to be important to begin
446 // with the user's preference first so that it's initial position will
447 // be correct (SL-51192) -MG
448 BOOL show_more = gSavedSettings.getBOOL("ToolboxShowMore"); // get user's preference
449 gSavedSettings.setBOOL("ToolboxShowMore", show_more); // sets up forced toggle below
450 showMore( !show_more ); // does the toggle
451 showMore( show_more ); // reset the real user's preference
452} 436}
453 437
454LLFloaterTools::~LLFloaterTools() 438LLFloaterTools::~LLFloaterTools()
@@ -492,6 +476,16 @@ void LLFloaterTools::refresh()
492 mTab->enableTabButton(idx_face, all_volume); 476 mTab->enableTabButton(idx_face, all_volume);
493 mTab->enableTabButton(idx_contents, all_volume); 477 mTab->enableTabButton(idx_contents, all_volume);
494 478
479 // Refresh object and prim count labels
480 LLLocale locale(LLLocale::USER_LOCALE);
481 std::string obj_count_string;
482 LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount());
483 childSetTextArg("obj_count", "[COUNT]", obj_count_string);
484 std::string prim_count_string;
485 LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount());
486 childSetTextArg("prim_count", "[COUNT]", prim_count_string);
487
488 // Refresh child tabs
495 mPanelPermissions->refresh(); 489 mPanelPermissions->refresh();
496 mPanelObject->refresh(); 490 mPanelObject->refresh();
497 mPanelVolume->refresh(); 491 mPanelVolume->refresh();
@@ -699,7 +693,8 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
699 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() && 693 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
700 !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment()) 694 !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment())
701 { 695 {
702 if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 696 if (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() > 0 &&
697 LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() !=
703 LLSelectMgr::getInstance()->getSelection()->getObjectCount()) 698 LLSelectMgr::getInstance()->getSelection()->getObjectCount())
704 { 699 {
705 can_unlink = true; 700 can_unlink = true;
@@ -799,8 +794,8 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
799 if (mSliderDozerSize) 794 if (mSliderDozerSize)
800 { 795 {
801 mSliderDozerSize ->setVisible( land_visible ); 796 mSliderDozerSize ->setVisible( land_visible );
802 childSetVisible("Brush:", land_visible); 797 childSetVisible("Bulldozer:", land_visible);
803 childSetVisible("Brush Size:", land_visible); 798 childSetVisible("Dozer Size:", land_visible);
804 } 799 }
805 if (mCheckShowOwners) 800 if (mCheckShowOwners)
806 { 801 {
@@ -812,13 +807,10 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
812 childSetVisible("Strength:", land_visible); 807 childSetVisible("Strength:", land_visible);
813 } 808 }
814 809
815 // 810 childSetVisible("obj_count", !land_visible);
816 // More panel visibility 811 childSetVisible("prim_count", !land_visible);
817 // 812 mTab->setVisible(!land_visible);
818 BOOL show_more = gSavedSettings.getBOOL("ToolboxShowMore"); 813 mPanelLandInfo->setVisible(land_visible);
819
820 mTab->setVisible(show_more && tool != LLToolBrushLand::getInstance() && tool != LLToolSelectLand::getInstance());
821 mPanelLandInfo->setVisible(show_more && (tool == LLToolBrushLand::getInstance() || tool == LLToolSelectLand::getInstance()));
822} 814}
823 815
824 816
@@ -873,46 +865,12 @@ void LLFloaterTools::onClose(bool app_quitting)
873 // gMenuBarView->arrange(); 865 // gMenuBarView->arrange();
874} 866}
875 867
876void LLFloaterTools::showMore(BOOL show_more)
877{
878 BOOL showing_more = gSavedSettings.getBOOL("ToolboxShowMore");
879 if (show_more == showing_more)
880 {
881 return;
882 }
883
884 gSavedSettings.setBOOL("ToolboxShowMore", show_more);
885
886 // Visibility updated next frame - JC
887 // mTab->setVisible(show_more);
888
889 if (show_more)
890 {
891 reshape( getRect().getWidth(), mLargeHeight, TRUE);
892 translate( 0, mSmallHeight - mLargeHeight );
893 }
894 else
895 {
896 reshape( getRect().getWidth(), mSmallHeight, TRUE);
897 translate( 0, mLargeHeight - mSmallHeight );
898 }
899 childSetVisible("button less", show_more);
900 childSetVisible("button more", !show_more);
901}
902
903void LLFloaterTools::showPanel(EInfoPanel panel) 868void LLFloaterTools::showPanel(EInfoPanel panel)
904{ 869{
905 llassert(panel >= 0 && panel < PANEL_COUNT); 870 llassert(panel >= 0 && panel < PANEL_COUNT);
906 mTab->selectTabByName(PANEL_NAMES[panel]); 871 mTab->selectTabByName(PANEL_NAMES[panel]);
907} 872}
908 873
909void click_show_more(void *userdata)
910{
911 LLFloaterTools *f = (LLFloaterTools *)userdata;
912 BOOL show_more = !gSavedSettings.getBOOL("ToolboxShowMore");
913 f->showMore( show_more );
914}
915
916void click_popup_info(void*) 874void click_popup_info(void*)
917{ 875{
918// gBuildView->setPropertiesPanelOpen(TRUE); 876// gBuildView->setPropertiesPanelOpen(TRUE);
@@ -997,8 +955,8 @@ void click_popup_dozer_mode(LLUICtrl *, void *user)
997 955
998void commit_slider_dozer_size(LLUICtrl *ctrl, void*) 956void commit_slider_dozer_size(LLUICtrl *ctrl, void*)
999{ 957{
1000 S32 size = (S32)ctrl->getValue().asInteger(); 958 F32 size = (F32)ctrl->getValue().asReal();
1001 gSavedSettings.setS32("LandBrushSize", size); 959 gSavedSettings.setF32("LandBrushSize", size);
1002} 960}
1003 961
1004void commit_slider_dozer_force(LLUICtrl *ctrl, void*) 962void commit_slider_dozer_force(LLUICtrl *ctrl, void*)
@@ -1086,15 +1044,15 @@ void LLFloaterTools::onFocusReceived()
1086 1044
1087void LLFloaterTools::updateTreeGrassCombo(bool visible) 1045void LLFloaterTools::updateTreeGrassCombo(bool visible)
1088{ 1046{
1047 LLTextBox* tree_grass_label = getChild<LLTextBox>("tree_grass_label");
1089 if (visible) 1048 if (visible)
1090 { 1049 {
1091 LLPCode pcode = LLToolPlacer::getObjectType(); 1050 LLPCode pcode = LLToolPlacer::getObjectType();
1092 std::map<std::string, S32>::iterator it, end; 1051 std::map<std::string, S32>::iterator it, end;
1093 std::string selected; 1052 std::string selected;
1094 LLTextBox* tree_grass_label = getChild<LLTextBox>("tree_grass_label");
1095 if (pcode == LLToolPlacerPanel::sTree) 1053 if (pcode == LLToolPlacerPanel::sTree)
1096 { 1054 {
1097 tree_grass_label->setVisible(true); 1055 tree_grass_label->setVisible(visible);
1098 LLButton* button = getChild<LLButton>("ToolTree"); 1056 LLButton* button = getChild<LLButton>("ToolTree");
1099 tree_grass_label->setText(button->getToolTip()); 1057 tree_grass_label->setText(button->getToolTip());
1100 1058
@@ -1104,7 +1062,7 @@ void LLFloaterTools::updateTreeGrassCombo(bool visible)
1104 } 1062 }
1105 else if (pcode == LLToolPlacerPanel::sGrass) 1063 else if (pcode == LLToolPlacerPanel::sGrass)
1106 { 1064 {
1107 tree_grass_label->setVisible(true); 1065 tree_grass_label->setVisible(visible);
1108 LLButton* button = getChild<LLButton>("ToolGrass"); 1066 LLButton* button = getChild<LLButton>("ToolGrass");
1109 tree_grass_label->setText(button->getToolTip()); 1067 tree_grass_label->setText(button->getToolTip());
1110 1068
@@ -1140,6 +1098,7 @@ void LLFloaterTools::updateTreeGrassCombo(bool visible)
1140 } 1098 }
1141 1099
1142 mComboTreesGrass->setVisible(visible); 1100 mComboTreesGrass->setVisible(visible);
1101 tree_grass_label->setVisible(visible);
1143} 1102}
1144 1103
1145// static 1104// static