2
0

UIHorizontalStack.h 987 B

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