mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
IconDes: Button to enter color as text
git-svn-id: svn://ultimatepp.org/upp/trunk@13444 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d451e400fd
commit
721327c4ff
3 changed files with 16 additions and 0 deletions
|
|
@ -63,6 +63,7 @@ private:
|
|||
ColorRampCtrl ramp;
|
||||
AlphaCtrl alpha;
|
||||
EditString text;
|
||||
FrameRight<Button> setcolor;
|
||||
Ptr<Ctrl> subctrl;
|
||||
|
||||
Color GetColor(int i) const;
|
||||
|
|
|
|||
|
|
@ -216,6 +216,21 @@ RGBACtrl::RGBACtrl()
|
|||
text.SetFont(CourierZ(11));
|
||||
text.NoWantFocus();
|
||||
text.SetReadOnly();
|
||||
text.SetFrame(BlackFrame());
|
||||
text.AddFrame(setcolor);
|
||||
setcolor.Width(CtrlImg::color_edit().GetSize().cx + DPI(8));
|
||||
setcolor.SetImage(CtrlImg::color_edit());
|
||||
setcolor << [=] {
|
||||
String text;
|
||||
if(!IsNull(color) && color != VoidColor())
|
||||
text = ColorToHtml(color);
|
||||
EditText(text, "Set Color", "Color value");
|
||||
Color c = ColorFromText(text);
|
||||
if(IsNull(c))
|
||||
return;
|
||||
Set(c);
|
||||
UpdateActionRefresh();
|
||||
};
|
||||
Add(text);
|
||||
SyncText();
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
Loading…
Add table
Add a link
Reference in a new issue