AlignToolbarSection.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include "ViewportAlign.h"
  10. ////////////////////////////////////////////////////////////////////////////////////////////////////
  11. //! AlignToolbarSection is a part of the ModeToolbar that only shows up when in move mode.
  12. //! It has buttons that, when clicked, perform different align operations.
  13. class AlignToolbarSection
  14. {
  15. public: //methods
  16. explicit AlignToolbarSection();
  17. //! Used to grey out the buttons when the selection is not valid for align operations
  18. void SetIsEnabled(bool enabled);
  19. //! Used to hide the section when not in the correct mode
  20. void SetIsVisible(bool visible);
  21. //! Adds the buttons, called by the parent toolbar to add them in the right place as toolbar is built
  22. void AddButtons(QToolBar* parent);
  23. private: // methods
  24. void AddButton(QToolBar* parent, ViewportAlign::AlignType alignType, const QString& iconName, const QString& toolTip);
  25. private: // data
  26. QAction* m_separator = nullptr;
  27. AZStd::vector<QAction*> m_buttons;
  28. };