TemplateButtonWidget.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #if !defined(Q_MOC_RUN)
  10. #include <QPushButton>
  11. #endif
  12. QT_FORWARD_DECLARE_CLASS(QLabel)
  13. QT_FORWARD_DECLARE_CLASS(QProgressBar)
  14. namespace O3DE::ProjectManager
  15. {
  16. class TemplateButton
  17. : public QPushButton
  18. {
  19. Q_OBJECT
  20. public:
  21. explicit TemplateButton(const QString& imagePath, const QString& labelText, QWidget* parent = nullptr);
  22. ~TemplateButton() = default;
  23. void SetIsRemote(bool isRemote);
  24. void ShowDownloadProgress(bool showProgress);
  25. void SetProgressPercentage(float percent);
  26. protected slots:
  27. void onToggled();
  28. private:
  29. QLabel* m_cloudIcon = nullptr;
  30. QLabel* m_darkenOverlay = nullptr;
  31. QLabel* m_progressMessageLabel = nullptr;
  32. QProgressBar* m_progessBar = nullptr;
  33. };
  34. } // namespace O3DE::ProjectManager