diff options
author | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-03-01 15:37:19 +0200 |
---|---|---|
committer | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-03-01 15:37:19 +0200 |
commit | 3556fd6bfa66ed483ad0de20fa1b38a9b562c4f1 (patch) | |
tree | 1bdd84fc45cdc55311b1847f083a87793a50d6f0 | |
parent | 5351688b9d102576513bac45b427d5228764eb0b (diff) |
Fixed major bug (EXT-5671) Resizing viewer 2 redraws maturity icon in location bar when it shouldn't.
--HG--
branch : product-engine
-rw-r--r-- | indra/newview/lllocationinputctrl.cpp | 59 | ||||
-rw-r--r-- | indra/newview/lllocationinputctrl.h | 1 |
2 files changed, 33 insertions, 27 deletions
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 0ea4b1f6da..4100e2fc61 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -577,7 +577,7 @@ void LLLocationInputCtrl::reshape(S32 width, S32 height, BOOL called_from_parent if (isHumanReadableLocationVisible) { - positionMaturityIcon(); + refreshMaturityIcon(); } } @@ -737,32 +737,7 @@ void LLLocationInputCtrl::refreshLocation() setText(location_name); isHumanReadableLocationVisible = true; - // Updating maturity rating icon. - LLViewerRegion* region = gAgent.getRegion(); - if (!region) - return; - - U8 sim_access = region->getSimAccess(); - switch(sim_access) - { - case SIM_ACCESS_PG: - mMaturityIcon->setValue(mIconMaturityGeneral->getName()); - mMaturityIcon->setVisible(TRUE); - break; - - case SIM_ACCESS_ADULT: - mMaturityIcon->setValue(mIconMaturityAdult->getName()); - mMaturityIcon->setVisible(TRUE); - break; - - default: - mMaturityIcon->setVisible(FALSE); - } - - if (mMaturityIcon->getVisible()) - { - positionMaturityIcon(); - } + refreshMaturityIcon(); } // returns new right edge @@ -878,6 +853,36 @@ void LLLocationInputCtrl::refreshHealth() } } +void LLLocationInputCtrl::refreshMaturityIcon() +{ + // Updating maturity rating icon. + LLViewerRegion* region = gAgent.getRegion(); + if (!region) + return; + + U8 sim_access = region->getSimAccess(); + switch(sim_access) + { + case SIM_ACCESS_PG: + mMaturityIcon->setValue(mIconMaturityGeneral->getName()); + mMaturityIcon->setVisible(TRUE); + break; + + case SIM_ACCESS_ADULT: + mMaturityIcon->setValue(mIconMaturityAdult->getName()); + mMaturityIcon->setVisible(TRUE); + break; + + default: + mMaturityIcon->setVisible(FALSE); + } + + if (mMaturityIcon->getVisible()) + { + positionMaturityIcon(); + } +} + void LLLocationInputCtrl::positionMaturityIcon() { const LLFontGL* font = mTextEntry->getFont(); diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index dac6be2a24..f790140f07 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -136,6 +136,7 @@ private: void refreshParcelIcons(); // Refresh the value in the health percentage text field void refreshHealth(); + void refreshMaturityIcon(); void positionMaturityIcon(); void rebuildLocationHistory(const std::string& filter = LLStringUtil::null); |