| 435 | } |
| 436 | |
| 437 | ColorHSLA CMenus::DoButton_ColorPicker(const CUIRect *pRect, unsigned int *pHslaColor, bool Alpha) |
| 438 | { |
| 439 | ColorHSLA HslaColor = ColorHSLA(*pHslaColor, Alpha); |
| 440 | |
| 441 | ColorRGBA Outline = ColorRGBA(1.0f, 1.0f, 1.0f, 0.25f); |
| 442 | Outline.a *= Ui()->ButtonColorMul(pHslaColor); |
| 443 | |
| 444 | CUIRect Rect; |
| 445 | pRect->Margin(3.0f, &Rect); |
| 446 | |
| 447 | pRect->Draw(Outline, IGraphics::CORNER_ALL, 4.0f); |
| 448 | Rect.Draw(color_cast<ColorRGBA>(HslaColor), IGraphics::CORNER_ALL, 4.0f); |
| 449 | |
| 450 | if(Ui()->DoButtonLogic(pHslaColor, 0, pRect, BUTTONFLAG_LEFT)) |
| 451 | { |
| 452 | m_ColorPickerPopupContext.m_pHslaColor = pHslaColor; |
| 453 | m_ColorPickerPopupContext.m_HslaColor = HslaColor; |
| 454 | m_ColorPickerPopupContext.m_HsvaColor = color_cast<ColorHSVA>(HslaColor); |
| 455 | m_ColorPickerPopupContext.m_RgbaColor = color_cast<ColorRGBA>(m_ColorPickerPopupContext.m_HsvaColor); |
| 456 | m_ColorPickerPopupContext.m_Alpha = Alpha; |
| 457 | Ui()->ShowPopupColorPicker(Ui()->MouseX(), Ui()->MouseY(), &m_ColorPickerPopupContext); |
| 458 | } |
| 459 | else if(Ui()->IsPopupOpen(&m_ColorPickerPopupContext) && m_ColorPickerPopupContext.m_pHslaColor == pHslaColor) |
| 460 | { |
| 461 | HslaColor = color_cast<ColorHSLA>(m_ColorPickerPopupContext.m_HsvaColor); |
| 462 | } |
| 463 | |
| 464 | return HslaColor; |
| 465 | } |
| 466 | |
| 467 | int CMenus::DoButton_CheckBoxAutoVMarginAndSet(const void *pId, const char *pText, int *pValue, CUIRect *pRect, float VMargin) |
| 468 | { |
nothing calls this directly
no test coverage detected