2
0

UIButton.h 878 B

1234567891011121314151617181920212223242526272829303132333435
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #pragma once
  4. #include <UI/UITextButton.h>
  5. #include <UI/UITexturedQuad.h>
  6. /// Button with a background image and text on it
  7. class UIButton : public UITextButton
  8. {
  9. public:
  10. JPH_DECLARE_RTTI_VIRTUAL(UIButton)
  11. /// Cloning / copying
  12. virtual void CopyTo(UIElement *ioElement) const override;
  13. /// Draw element
  14. virtual void Draw() const override;
  15. /// Set quad
  16. void SetButtonQuad(const UITexturedQuad &inQuad);
  17. private:
  18. UITexturedQuad mUpQuad;
  19. Color mUpColor { Color(220, 220, 220) };
  20. UITexturedQuad mDownQuad;
  21. Color mDownColor { Color::sGrey };
  22. UITexturedQuad mHighlightQuad;
  23. Color mHighlightColor { Color::sWhite };
  24. UITexturedQuad mSelectedQuad;
  25. Color mSelectedColor { Color::sWhite };
  26. UITexturedQuad mDisabledQuad;
  27. Color mDisabledColor { Color::sGrey };
  28. };