StartupLogoDialog.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 "IEditor.h"
  11. #include <QDialog>
  12. #include <QPixmap>
  13. #include <QString>
  14. #endif
  15. namespace Ui
  16. {
  17. class StartupLogoDialog;
  18. }
  19. class CStartupLogoDialog
  20. : public QDialog
  21. , public IInitializeUIInfo
  22. {
  23. Q_OBJECT
  24. public:
  25. static constexpr int EnforcedWidth = 668;
  26. static constexpr int EnforcedHeight = 368;
  27. enum DialogType
  28. {
  29. Loading,
  30. About
  31. };
  32. CStartupLogoDialog(
  33. DialogType dialogType, QString versionText, QString richTextCopyrightNotice, QWidget* pParent = nullptr); // standard constructor
  34. ~CStartupLogoDialog();
  35. void SetInfoText(const char* text) override;
  36. // Static way to call SetInfoText on the single instance of CStartupLogoDialog
  37. static void SetText(const char* text);
  38. static CStartupLogoDialog* instance() { return s_pLogoWindow; }
  39. protected:
  40. virtual void focusOutEvent([[maybe_unused]] QFocusEvent* event) override;
  41. private:
  42. void SetInfo(const char* text);
  43. void paintEvent(QPaintEvent* event) override;
  44. static CStartupLogoDialog* s_pLogoWindow;
  45. QScopedPointer<Ui::StartupLogoDialog> m_ui;
  46. DialogType m_dialogType;
  47. QPixmap m_backgroundImage;
  48. };