From ebb69c31882f96bf3afdc719a739c3dca695c352 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 18 Dec 2009 10:48:33 -0800 Subject: made adding sliders to a multislider possible from xui --- indra/llui/llmultislider.cpp | 48 ++++++++++++++++++++++++++++++++++++++-- indra/llui/llmultislider.h | 32 ++++++++++++++++++--------- indra/llui/llmultisliderctrl.cpp | 4 +++- indra/llui/llmultisliderctrl.h | 2 ++ 4 files changed, 72 insertions(+), 14 deletions(-) diff --git a/indra/llui/llmultislider.cpp b/indra/llui/llmultislider.cpp index 1891bca36c..aea7c5f87c 100644 --- a/indra/llui/llmultislider.cpp +++ b/indra/llui/llmultislider.cpp @@ -50,6 +50,12 @@ const F32 FLOAT_THRESHOLD = 0.00001f; S32 LLMultiSlider::mNameCounter = 0; +LLMultiSlider::SliderParams::SliderParams() +: name("name"), + value("value", 0.f) +{ +} + LLMultiSlider::Params::Params() : max_sliders("max_sliders", 1), allow_overlap("allow_overlap", false), @@ -63,7 +69,8 @@ LLMultiSlider::Params::Params() triangle_color("triangle_color"), mouse_down_callback("mouse_down_callback"), mouse_up_callback("mouse_up_callback"), - thumb_width("thumb_width") + thumb_width("thumb_width"), + sliders("slider") { name = "multi_slider_bar"; mouse_opaque(true); @@ -99,6 +106,20 @@ LLMultiSlider::LLMultiSlider(const LLMultiSlider::Params& p) { setMouseUpCallback(initCommitCallback(p.mouse_up_callback)); } + + for (LLInitParam::ParamIterator::const_iterator it = p.sliders().begin(); + it != p.sliders().end(); + ++it) + { + if (it->name.isProvided()) + { + addSlider(it->value, it->name); + } + else + { + addSlider(it->value); + } + } } LLMultiSlider::~LLMultiSlider() @@ -230,6 +251,30 @@ const std::string& LLMultiSlider::addSlider(F32 val) return mCurSlider; } +void LLMultiSlider::addSlider(F32 val, const std::string& name) +{ + F32 initVal = val; + + if(mValue.size() >= mMaxNumSliders) { + return; + } + + bool foundOne = findUnusedValue(initVal); + if(!foundOne) { + return; + } + + // add a new thumb rect + mThumbRects[name] = LLRect( 0, getRect().getHeight(), mThumbWidth, 0 ); + + // add the value and set the current slider to this one + mValue.insert(name, initVal); + mCurSlider = name; + + // move the slider + setSliderValue(mCurSlider, initVal, TRUE); +} + bool LLMultiSlider::findUnusedValue(F32& initVal) { bool firstTry = true; @@ -572,7 +617,6 @@ void LLMultiSlider::draw() LLF32UICtrl::draw(); } - boost::signals2::connection LLMultiSlider::setMouseDownCallback( const commit_signal_t::slot_type& cb ) { if (!mMouseDownSignal) mMouseDownSignal = new commit_signal_t(); diff --git a/indra/llui/llmultislider.h b/indra/llui/llmultislider.h index f8e43a0470..88576da85b 100644 --- a/indra/llui/llmultislider.h +++ b/indra/llui/llmultislider.h @@ -41,6 +41,13 @@ class LLUICtrlFactory; class LLMultiSlider : public LLF32UICtrl { public: + struct SliderParams : public LLInitParam::Block + { + Optional name; + Mandatory value; + SliderParams(); + }; + struct Params : public LLInitParam::Block { Optional max_sliders; @@ -60,6 +67,7 @@ public: mouse_up_callback; Optional thumb_width; + Multiple sliders; Params(); }; @@ -68,13 +76,13 @@ protected: friend class LLUICtrlFactory; public: virtual ~LLMultiSlider(); - void setSliderValue(const std::string& name, F32 value, BOOL from_event = FALSE); - F32 getSliderValue(const std::string& name) const; + void setSliderValue(const std::string& name, F32 value, BOOL from_event = FALSE); + F32 getSliderValue(const std::string& name) const; - const std::string& getCurSlider() const { return mCurSlider; } - F32 getCurSliderValue() const { return getSliderValue(mCurSlider); } - void setCurSlider(const std::string& name); - void setCurSliderValue(F32 val, BOOL from_event = false) { setSliderValue(mCurSlider, val, from_event); } + const std::string& getCurSlider() const { return mCurSlider; } + F32 getCurSliderValue() const { return getSliderValue(mCurSlider); } + void setCurSlider(const std::string& name); + void setCurSliderValue(F32 val, BOOL from_event = false) { setSliderValue(mCurSlider, val, from_event); } /*virtual*/ void setValue(const LLSD& value); /*virtual*/ LLSD getValue() const { return mValue; } @@ -82,12 +90,13 @@ public: boost::signals2::connection setMouseDownCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setMouseUpCallback( const commit_signal_t::slot_type& cb ); - bool findUnusedValue(F32& initVal); + bool findUnusedValue(F32& initVal); const std::string& addSlider(); const std::string& addSlider(F32 val); - void deleteSlider(const std::string& name); - void deleteCurSlider() { deleteSlider(mCurSlider); } - void clear(); + void addSlider(F32 val, const std::string& name); + void deleteSlider(const std::string& name); + void deleteCurSlider() { deleteSlider(mCurSlider); } + void clear(); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); @@ -109,7 +118,8 @@ protected: LLRect mDragStartThumbRect; S32 mThumbWidth; - std::map mThumbRects; + std::map + mThumbRects; LLUIColor mTrackColor; LLUIColor mThumbOutlineColor; LLUIColor mThumbCenterColor; diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp index 87938c19d4..2e7bf4b74d 100644 --- a/indra/llui/llmultisliderctrl.cpp +++ b/indra/llui/llmultisliderctrl.cpp @@ -65,7 +65,8 @@ LLMultiSliderCtrl::Params::Params() text_color("text_color"), text_disabled_color("text_disabled_color"), mouse_down_callback("mouse_down_callback"), - mouse_up_callback("mouse_up_callback") + mouse_up_callback("mouse_up_callback"), + sliders("slider") { mouse_opaque = true; } @@ -161,6 +162,7 @@ LLMultiSliderCtrl::LLMultiSliderCtrl(const LLMultiSliderCtrl::Params& p) S32 slider_left = label_width ? label_width + multi_sliderctrl_spacing : 0; LLRect slider_rect( slider_left, top, slider_right, bottom ); LLMultiSlider::Params params; + params.sliders = p.sliders; params.rect(slider_rect); params.commit_callback.function( LLMultiSliderCtrl::onSliderCommit ); params.mouse_down_callback( p.mouse_down_callback ); diff --git a/indra/llui/llmultisliderctrl.h b/indra/llui/llmultisliderctrl.h index 16d07541f2..e8366d09c2 100644 --- a/indra/llui/llmultisliderctrl.h +++ b/indra/llui/llmultisliderctrl.h @@ -69,6 +69,8 @@ public: Optional mouse_down_callback, mouse_up_callback; + Multiple sliders; + Params(); }; -- cgit v1.2.3 From fb862f18159d320572008b6a8da81ffd2f109e37 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 18 Dec 2009 11:05:44 -0800 Subject: Slight hack: if pixel area is 1024, force recalculation of it This is because I've observed that in heavy regions, media was not getting loaded because the queue items were stuck with the head item at interest = 1024. This is the "default" value, which means it probably wasn't calculated yet. This forces the calculation. Also cleaned up some logging in mediadataclient --- indra/newview/llmediadataclient.cpp | 16 ++++++++-------- indra/newview/llvovolume.cpp | 16 ++++++++++++++-- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 2bb2a3da6f..b8da368bd7 100755 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -164,7 +164,7 @@ void LLMediaDataClient::enqueue(const Request *request) // Sadly, we have to const-cast because items put into the queue are not const mSortedQueue.push_back(const_cast(request)); - LL_DEBUGS("LLMediaDataClient") << "SORTED queue:" << mSortedQueue << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << "SORTED queue:" << mSortedQueue << LL_ENDL; } else { if (mRoundRobinQueue.size() > mMaxRoundRobinQueueSize) @@ -187,7 +187,7 @@ void LLMediaDataClient::enqueue(const Request *request) // Sadly, we have to const-cast because items put into the queue are not const mRoundRobinQueue.push_front(const_cast(request)); - LL_DEBUGS("LLMediaDataClient") << "RR queue:" << mRoundRobinQueue << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << "RR queue:" << mRoundRobinQueue << LL_ENDL; } else { @@ -226,16 +226,16 @@ bool LLMediaDataClient::processQueueTimer() { LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() started, SORTED queue size is: " << mSortedQueue.size() << ", RR queue size is: " << mRoundRobinQueue.size() << LL_ENDL; - LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() started, SORTED queue is: " << mSortedQueue << LL_ENDL; - LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() started, RR queue is: " << mRoundRobinQueue << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() started, SORTED queue is: " << mSortedQueue << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() started, RR queue is: " << mRoundRobinQueue << LL_ENDL; } serviceQueue(); LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() finished, SORTED queue size is: " << mSortedQueue.size() << ", RR queue size is: " << mRoundRobinQueue.size() << LL_ENDL; - LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() finished, SORTED queue is: " << mSortedQueue << LL_ENDL; - LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() finished, RR queue is: " << mRoundRobinQueue << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() finished, SORTED queue is: " << mSortedQueue << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() finished, RR queue is: " << mRoundRobinQueue << LL_ENDL; return isEmpty(); } @@ -649,7 +649,7 @@ void LLMediaDataClient::Responder::error(U32 status, const std::string& reason) /*virtual*/ void LLMediaDataClient::Responder::result(const LLSD& content) { - LL_DEBUGS("LLMediaDataClient") << *mRequest << " result : " << ll_print_sd(content) << LL_ENDL; + LL_DEBUGS("LLMediaDataClientResponse") << *mRequest << " result : " << ll_print_sd(content) << LL_ENDL; } ////////////////////////////////////////////////////////////////////////////////////// @@ -703,7 +703,7 @@ void LLObjectMediaDataClient::Responder::result(const LLSD& content) llassert(type == LLMediaDataClient::Request::GET || type == LLMediaDataClient::Request::UPDATE) if (type == LLMediaDataClient::Request::GET) { - LL_DEBUGS("LLMediaDataClient") << *(getRequest()) << " GET returned: " << ll_print_sd(content) << LL_ENDL; + LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " GET returned: " << ll_print_sd(content) << LL_ENDL; // Look for an error if (content.has("error")) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index f98aa361e0..70bfc67523 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -134,9 +134,21 @@ public: virtual F64 getMediaInterest() const { - F64 tmp = mObject->getTotalMediaInterest(); - return (tmp < 0.0) ? mObject->getPixelArea() : tmp; + F64 interest = mObject->getTotalMediaInterest(); + if (interest < (F64)0.0) + { + // media interest not valid yet, try pixel area + interest = mObject->getPixelArea(); + // HACK: force recalculation of pixel area if interest is the "magic default" of 1024. + if (interest == 1024.f) + { + const_cast(static_cast(mObject))->setPixelAreaAndAngle(gAgent); + interest = mObject->getPixelArea(); + } + } + return interest; } + virtual bool isInterestingEnough() const { return LLViewerMedia::isInterestingEnough(mObject, getMediaInterest()); -- cgit v1.2.3 From 69004fa27e9671554e432bbe4d777e3002aca457 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 18 Dec 2009 14:01:47 -0800 Subject: EXT-2854 Fix PG/Mature event labels on the world map --- indra/newview/skins/default/xui/en/floater_world_map.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml index e632b67d11..169a0ea676 100644 --- a/indra/newview/skins/default/xui/en/floater_world_map.xml +++ b/indra/newview/skins/default/xui/en/floater_world_map.xml @@ -296,7 +296,7 @@ layout="topleft" name="pg_label" width="60"> - PG + General - Mature + Moderate Adult -- cgit v1.2.3 From 298c829bb7d36e0acbc4844ee8b94e685c3d4c2b Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 18 Dec 2009 14:39:45 -0800 Subject: Fix 3D object tooltip backgrounds appearing gray Image "none" wasn't being properly converted to a NULL pointer, so was drawing the default gray image. Reviewed with Richard --- indra/llui/lluiimage.cpp | 1 + indra/newview/lltoolpie.cpp | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index 1dfc281d93..966d919dc7 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -168,6 +168,7 @@ namespace LLInitParam if (name() == "none") { mData.mValue = NULL; + return; } LLUIImage* imagep = LLUI::getUIImage(name()); diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 74fbce890d..b1d09eccba 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -731,14 +731,13 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, MASK mask) // *HACK: We may select this object, so pretend it was clicked mPick = mHoverPick; LLInspector::Params p; + p.fillFrom(LLUICtrlFactory::instance().getDefaultParams()); p.message(avatar_name); p.image(LLUI::getUIImage("Info")); p.click_callback(boost::bind(showAvatarInspector, hover_object->getID())); p.visible_time_near(6.f); p.visible_time_far(3.f); p.wrap(false); - - p.fillFrom(LLUICtrlFactory::instance().getDefaultParams()); LLToolTipMgr::instance().show(p); } @@ -822,6 +821,7 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, MASK mask) // We may select this object, so pretend it was clicked mPick = mHoverPick; LLInspector::Params p; + p.fillFrom(LLUICtrlFactory::instance().getDefaultParams()); p.message(tooltip_msg); p.image(LLUI::getUIImage("Info_Off")); p.click_callback(boost::bind(showObjectInspector, hover_object->getID(), mHoverPick.mObjectFace)); @@ -833,8 +833,6 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, MASK mask) p.visible_time_near(6.f); p.visible_time_far(3.f); p.wrap(false); - - p.fillFrom(LLUICtrlFactory::instance().getDefaultParams()); LLToolTipMgr::instance().show(p); } -- cgit v1.2.3 From 2da83c55ee30faa93a6503a5ceca126410a7f4cd Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 18 Dec 2009 14:39:54 -0800 Subject: Fix for color setup from Richard. --- indra/llui/llui.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 1ea6b66a93..728ed4e7aa 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1915,6 +1915,7 @@ namespace LLInitParam green = color.mV[VGREEN]; blue = color.mV[VBLUE]; alpha = color.mV[VALPHA]; + control.set("", false); } void TypeValues::declareValues() -- cgit v1.2.3 From 2644653045da19f98f1c04f7afe1412681cbbdd3 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 18 Dec 2009 14:40:14 -0800 Subject: Avoid warnings on startup due to colors marked as "Unused?" for later cleanup. --- indra/newview/skins/default/colors.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 88e77f11ee..706245a479 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -71,10 +71,14 @@ + + - - - + Date: Fri, 18 Dec 2009 14:40:44 -0800 Subject: EXT-3474 Task Inventory Panel XUI layout --- .../skins/default/xui/en/sidepanel_item_info.xml | 190 ++----- .../skins/default/xui/en/sidepanel_task_info.xml | 545 ++++++++++++--------- .../skins/default/xui/en/widgets/tab_container.xml | 8 +- 3 files changed, 344 insertions(+), 399 deletions(-) mode change 100644 => 100755 indra/newview/skins/default/xui/en/widgets/tab_container.xml diff --git a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml index 7b0b4b0bde..790f8afd3a 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml @@ -33,10 +33,10 @@ height="18" image_name="Lock" layout="topleft" - right="-50" + right="-15" mouse_opaque="true" name="IconLocked" - top="4" + top="8" width="18" />