Modernize LLIconCtrl

Adds min_height and min_width attributes
Adds mPriority for controlling priority with which to call LLUI::getUIImage*
Moves specialized setImage()s into setValue
Removes mImageName and mImageID, value is stored in base as LLSD now
This commit is contained in:
Inusaito Sayori
2013-12-01 15:58:24 -05:00
parent bbb55b0b4d
commit 9723a45e72
8 changed files with 72 additions and 75 deletions

View File

@@ -4275,7 +4275,7 @@ void LLModelPreview::updateStatusMessages()
std::string img = lod_status_image[upload_status[lod]];
LLIconCtrl* icon = mFMP->getChild<LLIconCtrl>(lod_icon_name[lod]);
icon->setVisible(true);
icon->setImage(img);
icon->setValue(img);
if (upload_status[lod] >= 2)
{
@@ -4286,7 +4286,7 @@ void LLModelPreview::updateStatusMessages()
{
mFMP->childSetText("lod_status_message_text", mFMP->getString(message));
icon = mFMP->getChild<LLIconCtrl>("lod_status_message_icon");
icon->setImage(img);
icon->setValue(img);
}
updateLodControls(lod);

View File

@@ -163,7 +163,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
{
icon = new LLIconCtrl(std::string("icon"),
LLRect(x, y, x+ICON_WIDTH, y-ICON_WIDTH),
group_insignia);
group_insignia.asString());
}
else
{

View File

@@ -293,7 +293,7 @@ void LLMediaRemoteCtrl::enableMediaButtons()
mMusicIcon->setColor(music_icon_color);
if(!media_icon_name.empty())
{
media_icon->setImage(media_icon_name);
media_icon->setValue(media_icon_name);
}
media_play_btn->setEnabled(play_media_enabled);

View File

@@ -310,7 +310,7 @@ void LLPanelGroupNotices::setItem(LLPointer<LLInventoryItem> inv_item)
inv_item->getFlags(),
item_is_multi );
mCreateInventoryIcon->setImage(icon_name);
mCreateInventoryIcon->setValue(icon_name);
mCreateInventoryIcon->setVisible(TRUE);
std::stringstream ss;
@@ -541,7 +541,7 @@ void LLPanelGroupNotices::showNotice(const std::string& subject,
std::string icon_name = LLInventoryIcon::getIconName(mInventoryOffer->mType,
LLInventoryType::IT_TEXTURE);
mViewInventoryIcon->setImage(icon_name);
mViewInventoryIcon->setValue(icon_name);
mViewInventoryIcon->setVisible(TRUE);
std::stringstream ss;

View File

@@ -94,10 +94,10 @@ void LLViewChildren::setBadge(const std::string& id, Badge badge, bool visible)
switch (badge)
{
default:
case BADGE_OK: child->setImage(std::string("badge_ok.j2c")); break;
case BADGE_NOTE: child->setImage(std::string("badge_note.j2c")); break;
case BADGE_WARN: child->setImage(std::string("badge_warn.j2c")); break;
case BADGE_ERROR: child->setImage(std::string("badge_error.j2c")); break;
case BADGE_OK: child->setValue(std::string("badge_ok.j2c")); break;
case BADGE_NOTE: child->setValue(std::string("badge_note.j2c")); break;
case BADGE_WARN: child->setValue(std::string("badge_warn.j2c")); break;
case BADGE_ERROR: child->setValue(std::string("badge_error.j2c")); break;
}
}
}

View File

@@ -154,7 +154,7 @@ void LLVoiceRemoteCtrl::draw()
LLIconCtrl* icon = mVoiceVolIcon;
if (icon)
{
icon->setImage(talk_blip_image);
icon->setValue(talk_blip_image);
}
LLFloater* voice_floater = LLFloaterChatterBox::getInstance()->getCurrentVoiceFloater();
@@ -185,7 +185,7 @@ void LLVoiceRemoteCtrl::draw()
LLIconCtrl* voice_channel_icon = findChild<LLIconCtrl>("voice_channel_icon");
if (voice_channel_icon && voice_floater)
{
voice_channel_icon->setImage(voice_floater->getString("voice_icon"));
voice_channel_icon->setValue(voice_floater->getString("voice_icon"));
}
if (voice_channel_bg)