diff --git a/uppsrc/CtrlLib/ColorPopup.cpp b/uppsrc/CtrlLib/ColorPopup.cpp index 266ff11ae..f04f7bcca 100644 --- a/uppsrc/CtrlLib/ColorPopup.cpp +++ b/uppsrc/CtrlLib/ColorPopup.cpp @@ -25,6 +25,26 @@ s_colors[] = { { "Yellow", &Yellow }, { "WhiteGray", &WhiteGray }, { "White", &White }, + +//deprecated: (TODO) + { "SBlack", &Black }, + { "SRed", &Red }, + { "SGreen", &Green }, + { "SBrown", &Brown }, + { "SBlue", &Blue }, + { "SMagenta", &Magenta }, + { "SCyan", &Cyan }, + { "SGray", &Gray }, + { "SLtGray", &LtGray }, + { "SLtRed", &LtRed }, + { "SLtGreen", &LtGreen }, + { "SLtYellow", &LtYellow }, + { "SLtBlue", &LtBlue }, + { "SLtMagenta", &LtMagenta }, + { "SLtCyan", &LtCyan }, + { "SYellow", &Yellow }, + { "SWhiteGray", &WhiteGray }, + { "SWhite", &White }, }; Color ColorPopUp::hint[18]; @@ -82,14 +102,16 @@ ColorPopUp::~ColorPopUp() {} int ColorPopUp::GetColorCount() const { - return 18 + 2 * 18 + hints * 18 + 216; + return 18 + scolors * 18 + 2 * 18 + hints * 18 + 216; } Color ColorPopUp::GetColor(int i) const { - if(i < 18) + if(!scolors) + i += 18; + if(i < 36) return *s_colors[i].color; - i -= 18; + i -= 36; if(i < 18) return GrayColor(255 * (i + 1) / 20); if(hints) { @@ -185,6 +207,8 @@ void ColorPopUp::Paint(Draw& w) } DrawFilledFrame(w, x + DPI(1), y, DPI(14), DPI(14), SColorText, GetColor(i)); + if(i < 18 && scolors) + DrawFrame(w, x + DPI(2), y + DPI(1), DPI(12), DPI(12), Blend(SColorLight, SColorHighlight)); if(i == colori) { if(GetMouseLeft()) @@ -373,6 +397,7 @@ ColorPopUp::ColorPopUp() norampwheel = false; notnull = false; withvoid = false; + scolors = false; animating = false; hints = false; open = false; diff --git a/uppsrc/CtrlLib/DlgColor.h b/uppsrc/CtrlLib/DlgColor.h index 3f78923d3..204768716 100644 --- a/uppsrc/CtrlLib/DlgColor.h +++ b/uppsrc/CtrlLib/DlgColor.h @@ -165,6 +165,7 @@ private: int colori; bool notnull; + bool scolors; bool norampwheel; bool animating; bool hints; @@ -195,6 +196,7 @@ public: Color Get() const; ColorPopUp& NotNull(bool b = true) { notnull = b; return *this; } + ColorPopUp& SColors(bool b = true) { scolors = b; return *this; }//Deprecated, BUT NEEDED IN THEIDE ColorPopUp& NullText(const char *s) { nulltext = s; Refresh(); return *this; } ColorPopUp& WithVoid(bool b = true) { withvoid = b; Refresh(); return *this; } ColorPopUp& VoidText(const char *s) { voidtext = s; Refresh(); return *this; } @@ -237,6 +239,7 @@ public: ColorPusher& NotNull(bool b = true) { colors.NotNull(b); return *this; } ColorPusher& WithVoid(bool b = true) { colors.WithVoid(b); return *this; } ColorPusher& VoidText(const char *s) { voidtext = s; colors.VoidText(s); Refresh(); return *this; } + ColorPusher& SColors(bool b = true) { colors.SColors(b); return *this; } ColorPusher& WithText() { withtext = true; Refresh(); return *this; } ColorPusher& WithHex() { withhex = true; Refresh(); return *this; } ColorPusher& Track(bool b = true) { track = b; return *this; } diff --git a/uppsrc/ide/LayDes/property.cpp b/uppsrc/ide/LayDes/property.cpp index 2cc7c0618..a5321b80c 100644 --- a/uppsrc/ide/LayDes/property.cpp +++ b/uppsrc/ide/LayDes/property.cpp @@ -185,7 +185,7 @@ struct ColorProperty : public EditorProperty { ColorProperty() { Add(editor.HSizePosZ(100, 2).TopPos(2)); - editor.WithText().NullText("Null").Track(); + editor.WithText().SColors().NullText("Null").Track(); } static ItemProperty *Create() { return new ColorProperty; } diff --git a/uppsrc/ide/UppDlg.cpp b/uppsrc/ide/UppDlg.cpp index 8504bb550..a145bdb0e 100644 --- a/uppsrc/ide/UppDlg.cpp +++ b/uppsrc/ide/UppDlg.cpp @@ -29,7 +29,7 @@ struct OptionHeaderDisplay : Display { w.Clipoff(r.left + Zx(5), r.top, r.Width() - Zx(10), r.Height()); int tcy = GetTLTextHeight(txt, StdFont().Bold()); DrawTLText(w, 0, max((r.Height() - tcy) / 2, 0), r.Width(), txt, - StdFont().Bold(), SColorInfoText); + StdFont().Bold(), SColorText()); w.End(); } virtual Size GetStdSize(const Value& q) const