2
0

UIHorizontalStack.h 908 B

1234567891011121314151617181920212223242526
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #pragma once
  4. #include <UI/UIElement.h>
  5. /// Layout class that will horizontally place elements next to eachother according to their widths
  6. class UIHorizontalStack : public UIElement
  7. {
  8. public:
  9. JPH_DECLARE_RTTI_VIRTUAL(UIHorizontalStack)
  10. /// Helper function to resize a list of child elements consisting of UIHorizontalStack's to make them the same width.
  11. /// Can be used to give them the appearance of a table.
  12. /// Find the width of all UIHorizontalStack child elements in inParent and use the maximum width for all of them
  13. /// Non UIHorizontalStack elements will be treated as a UIHorizontalStack with only 1 element inside
  14. static void sUniformChildWidth(UIElement *inParent);
  15. /// Calculate auto layout
  16. virtual void AutoLayout() override;
  17. private:
  18. int mDeltaX = 0;
  19. bool mPlaceInvisibleChildren = false;
  20. };