From 8fb281289967c5332ed61ba262633730603b754b Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 2 Dec 2013 20:45:07 -0500 Subject: [PATCH] LLIconCtrl Params --- indra/llui/lliconctrl.cpp | 24 ++++++++++++++++++++++++ indra/llui/lliconctrl.h | 20 ++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp index e5b53ba38..fecdce432 100644 --- a/indra/llui/lliconctrl.cpp +++ b/indra/llui/lliconctrl.cpp @@ -44,6 +44,30 @@ static LLRegisterWidget r("icon"); +LLIconCtrl::Params::Params() +: image("image_name"), + color("color"), +// use_draw_context_alpha("use_draw_context_alpha", true), + scale_image("scale_image"), + min_width("min_width", 0), + min_height("min_height", 0) +{} + +LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p) +: LLUICtrl(p), + mColor(p.color()), + mImagep(p.image), +// mUseDrawContextAlpha(p.use_draw_context_alpha), + mPriority(0), + mMinWidth(p.min_width), + mMinHeight(p.min_height) +{ + if (mImagep.notNull()) + { + LLUICtrl::setValue(mImagep->getName()); + } + setTabStop(false); +} LLIconCtrl::LLIconCtrl(const std::string& name, const LLRect &rect, const std::string &image_name, const S32& min_width, const S32& min_height) : LLUICtrl(name, diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h index 79f08a795..16f4c4238 100644 --- a/indra/llui/lliconctrl.h +++ b/indra/llui/lliconctrl.h @@ -48,6 +48,22 @@ class LLUICtrlFactory; class LLIconCtrl : public LLUICtrl { +public: + struct Params : public LLInitParam::Block + { + Optional image; + Optional color; +// Optional use_draw_context_alpha; + Optional min_width, + min_height; + Ignored scale_image; + + Params(); + }; +protected: + LLIconCtrl(const Params&); + friend class LLUICtrlFactory; + public: 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(); @@ -76,6 +92,10 @@ protected: S32 mMinWidth, mMinHeight; + // If set to true (default), use the draw context transparency. + // If false, will use transparency returned by getCurrentTransparency(). See STORM-698. + //bool mUseDrawContextAlpha; + private: LLColor4 mColor; LLPointer mImagep;