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

@@ -49,33 +49,35 @@ class LLIconCtrl
: public LLUICtrl
{
public:
LLIconCtrl(const std::string& name, const LLRect &rect, const LLUUID &image_id);
LLIconCtrl(const std::string& name, const LLRect &rect, const std::string &image_name);
LLIconCtrl(const std::string& name, const LLRect &rect, const std::string &image_name, const S32& min_width = 0, const S32& min_height = 0);
virtual ~LLIconCtrl();
// llview overrides
virtual void draw();
void setImage(const std::string& image_name);
void setImage(const LLUUID& image_name);
const LLUUID &getImage() const { return mImageID; }
std::string getImageName() const { return mImageName; }
// Takes a UUID, wraps get/setImage
// lluictrl overrides
virtual void setValue(const LLSD& value );
virtual LLSD getValue() const;
/*virtual*/ void setAlpha(F32 alpha);
std::string getImageName() const;
void setColor(const LLColor4& color) { mColor = color; }
void setImage(LLPointer<LLUIImage> image) { mImagep = image; }
const LLPointer<LLUIImage> getImage() { return mImagep; }
virtual LLXMLNodePtr getXML(bool save_children = true) const;
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
protected:
S32 mPriority;
//the output size of the icon image if set.
S32 mMinWidth,
mMinHeight;
private:
LLColor4 mColor;
std::string mImageName;
LLUUID mImageID;
LLPointer<LLUIImage> mImagep;
};