diff --git a/uppsrc/CtrlLib/LabelBase.cpp b/uppsrc/CtrlLib/LabelBase.cpp index 2f563c287..bfe46eeb8 100644 --- a/uppsrc/CtrlLib/LabelBase.cpp +++ b/uppsrc/CtrlLib/LabelBase.cpp @@ -120,7 +120,7 @@ DrawLabel::DrawLabel() lspc = rspc = 0; limg_never_hide = false; rimg_never_hide = false; - ink = Null; + ink = disabledink = Null; align = valign = ALIGN_CENTER; accesskey = 0; accesspos = -1; @@ -209,7 +209,7 @@ Size DrawLabel::Paint(Draw& w, const Rect& r, bool visibleaccesskey) const else if(valign == ALIGN_CENTER) p.y = (r.bottom + r.top - txtsz.cy) / 2; - Color color = ink; + Color color = disabled && !IsNull(disabledink) ? disabledink : ink; if(IsNull(color)) color = disabled ? SColorDisabled : SColorLabel; ///////// int ix; @@ -293,9 +293,10 @@ LabelBase& LabelBase::SetFont(Font font) { return *this; } -LabelBase& LabelBase::SetInk(Color ink) { - if(lbl.ink != ink) { +LabelBase& LabelBase::SetInk(Color ink, Color disabledink) { + if(lbl.ink != ink || lbl.disabledink != disabledink) { lbl.ink = ink; + lbl.disabledink = disabledink; LabelUpdate(); } return *this; diff --git a/uppsrc/CtrlLib/LabelBase.h b/uppsrc/CtrlLib/LabelBase.h index fb68998b6..300c951b6 100644 --- a/uppsrc/CtrlLib/LabelBase.h +++ b/uppsrc/CtrlLib/LabelBase.h @@ -40,7 +40,7 @@ struct DrawLabel { int lspc; String text; Font font; - Color ink; + Color ink, disabledink; Image rimg; Color rcolor; int rspc; @@ -71,7 +71,8 @@ public: LabelBase& SetPaintRect(const PaintRect& pr); LabelBase& SetText(const char *text); LabelBase& SetFont(Font font); - LabelBase& SetInk(Color color); + LabelBase& SetInk(Color color, Color disabledink); + LabelBase& SetInk(Color color) { return SetInk(color, color); } LabelBase& SetRightImage(const Image& bmp2, int spc = 0, bool never_hide = false); LabelBase& SetAlign(int align); LabelBase& SetVAlign(int align); diff --git a/uppsrc/CtrlLib/Static.cpp b/uppsrc/CtrlLib/Static.cpp index ee63b6842..dc3154b82 100644 --- a/uppsrc/CtrlLib/Static.cpp +++ b/uppsrc/CtrlLib/Static.cpp @@ -80,11 +80,12 @@ Label::Label() { Label::~Label() {} CH_COLOR(LabelBoxTextColor, LtBlue()); +CH_COLOR(LabelBoxDisabledTextColor, SColorDisabled()); CH_COLOR(LabelBoxColor, SColorShadow()); LabelBox::LabelBox() { - SetInk(LabelBoxTextColor); + LabelBase::SetInk(LabelBoxTextColor, LabelBoxDisabledTextColor); SetVAlign(ALIGN_TOP); }