summaryrefslogtreecommitdiff
path: root/indra/newview/llgroupiconctrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llgroupiconctrl.cpp')
-rw-r--r--[-rwxr-xr-x]indra/newview/llgroupiconctrl.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/indra/newview/llgroupiconctrl.cpp b/indra/newview/llgroupiconctrl.cpp
index 6abf9ea637..271dd44c1f 100755..100644
--- a/indra/newview/llgroupiconctrl.cpp
+++ b/indra/newview/llgroupiconctrl.cpp
@@ -37,7 +37,10 @@ LLGroupIconCtrl::Params::Params()
: group_id("group_id"),
draw_tooltip("draw_tooltip", true),
default_icon_name("default_icon_name")
-{}
+{
+ changeDefault(min_width, 32);
+ changeDefault(min_height, 32);
+}
LLGroupIconCtrl::LLGroupIconCtrl(const LLGroupIconCtrl::Params& p)
@@ -48,6 +51,12 @@ LLGroupIconCtrl::LLGroupIconCtrl(const LLGroupIconCtrl::Params& p)
{
mPriority = LLViewerFetchedTexture::BOOST_ICON;
+ // don't request larger image then necessary to save gl memory,
+ // but ensure that quality is sufficient
+ LLRect rect = p.rect;
+ mMaxHeight = llmax((S32)p.min_height, rect.getHeight());
+ mMaxWidth = llmax((S32)p.min_width, rect.getWidth());
+
if (p.group_id.isProvided())
{
LLSD value(p.group_id);
@@ -55,7 +64,8 @@ LLGroupIconCtrl::LLGroupIconCtrl(const LLGroupIconCtrl::Params& p)
}
else
{
- LLIconCtrl::setValue(mDefaultIconName);
+ //TODO: Consider implementing dedicated setDefault() function instead of passing priority for local file
+ LLIconCtrl::setValue(mDefaultIconName, LLViewerFetchedTexture::BOOST_UI);
}
}
@@ -64,6 +74,11 @@ LLGroupIconCtrl::~LLGroupIconCtrl()
LLGroupMgr::getInstance()->removeObserver(this);
}
+void LLGroupIconCtrl::setIconId(const LLSD& value)
+{
+ LLIconCtrl::setValue(value);
+}
+
void LLGroupIconCtrl::setValue(const LLSD& value)
{
if (value.isUUID())
@@ -82,7 +97,7 @@ void LLGroupIconCtrl::setValue(const LLSD& value)
// Check if cache already contains image_id for that group
if (!updateFromCache())
{
- LLIconCtrl::setValue(mDefaultIconName);
+ LLIconCtrl::setValue(mDefaultIconName, LLViewerFetchedTexture::BOOST_UI);
gm->addObserver(this);
gm->sendGroupPropertiesRequest(mGroupId);
}
@@ -113,7 +128,7 @@ bool LLGroupIconCtrl::updateFromCache()
}
else
{
- LLIconCtrl::setValue(mDefaultIconName);
+ LLIconCtrl::setValue(mDefaultIconName, LLViewerFetchedTexture::BOOST_UI);
}
if (mDrawTooltip && !group_data->mName.empty())