void LLPanelTopInfoBar::setParcelInfoText(const std::string& new_text) { LLRect old_rect = getRect(); const LLFontGL* font = mParcelInfoText->getDefaultFont(); S32 new_text_width = font->getWidth(new_text); mParcelInfoText->setText(new_text); //MK if (gRRenabled && gAgent.mRRInterface.mContainsShowloc) { std::string dummy_text = "(Hidden)"; mParcelInfoText->setText(dummy_text); } //mk LLRect rect = mParcelInfoText->getRect(); rect.setOriginAndSize(rect.mLeft, rect.mBottom, new_text_width, rect.getHeight()); mParcelInfoText->reshape(rect.getWidth(), rect.getHeight(), TRUE); mParcelInfoText->setRect(rect); layoutParcelIcons(); if (old_rect != getRect()) { mResizeSignal(); } }
void LLPanelTopInfoBar::layoutParcelIcons() { LLRect old_rect = getRect(); // TODO: remove hard-coded values and read them as xml parameters static const int FIRST_ICON_HPAD = 32; static const int LAST_ICON_HPAD = 11; S32 left = mParcelInfoText->getRect().mRight + FIRST_ICON_HPAD; left = layoutWidget(mDamageText, left); for (int i = ICON_COUNT - 1; i >= 0; --i) { left = layoutWidget(mParcelIcon[i], left); } LLRect rect = getRect(); rect.set(rect.mLeft, rect.mTop, left + LAST_ICON_HPAD, rect.mBottom); setRect(rect); if (old_rect != getRect()) { mResizeSignal(); } }
void LLPanelTopInfoBar::setParcelInfoText(const std::string& new_text) { LLRect old_rect = getRect(); const LLFontGL* font = mParcelInfoText->getDefaultFont(); S32 new_text_width = font->getWidth(new_text); mParcelInfoText->setText(new_text); LLRect rect = mParcelInfoText->getRect(); rect.setOriginAndSize(rect.mLeft, rect.mBottom, new_text_width, rect.getHeight()); mParcelInfoText->reshape(rect.getWidth(), rect.getHeight(), TRUE); mParcelInfoText->setRect(rect); layoutParcelIcons(); if (old_rect != getRect()) { mResizeSignal(); } }