You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.7KB

  1. /* Copyright 2013-2019 Matt Tytel
  2. *
  3. * vital is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 3 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * vital is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with vital. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #pragma once
  17. #include "JuceHeader.h"
  18. #include "overlay.h"
  19. #include "open_gl_multi_quad.h"
  20. #include "open_gl_image_component.h"
  21. class AppLogo;
  22. class AboutSection : public Overlay {
  23. public:
  24. static constexpr int kInfoWidth = 430;
  25. static constexpr int kBasicInfoHeight = 250;
  26. static constexpr int kPaddingX = 25;
  27. static constexpr int kPaddingY = 15;
  28. static constexpr int kButtonHeight = 30;
  29. static constexpr int kLeftLogoBuffer = 95;
  30. static constexpr int kNameRightBuffer = 85;
  31. static constexpr int kLogoWidth = 96;
  32. static constexpr float kMultExtraSmall = 0.5f;
  33. static constexpr float kMultSmall = 0.7f;
  34. static constexpr float kMultLarge = 1.35f;
  35. static constexpr float kMultDouble = 2.0f;
  36. static constexpr float kMultTriple = 3.0f;
  37. static constexpr float kMultQuadruple = 4.0f;
  38. AboutSection(const String& name);
  39. virtual ~AboutSection();
  40. void setLogoBounds();
  41. void resized() override;
  42. void renderOpenGlComponents(OpenGlWrapper& open_gl, bool animate) override {
  43. SynthSection::renderOpenGlComponents(open_gl, animate);
  44. }
  45. Rectangle<int> getInfoRect();
  46. void mouseUp(const MouseEvent& e) override;
  47. void setVisible(bool should_be_visible) override;
  48. void buttonClicked(Button* clicked_button) override;
  49. private:
  50. void setGuiSize(float multiplier);
  51. void fullScreen();
  52. std::unique_ptr<OpenGlToggleButton> size_button_extra_small_;
  53. std::unique_ptr<OpenGlToggleButton> size_button_small_;
  54. std::unique_ptr<OpenGlToggleButton> size_button_normal_;
  55. std::unique_ptr<OpenGlToggleButton> size_button_large_;
  56. std::unique_ptr<OpenGlToggleButton> size_button_double_;
  57. std::unique_ptr<OpenGlToggleButton> size_button_triple_;
  58. std::unique_ptr<OpenGlToggleButton> size_button_quadruple_;
  59. OpenGlQuad body_;
  60. std::unique_ptr<AppLogo> logo_;
  61. std::unique_ptr<PlainTextComponent> name_text_;
  62. std::unique_ptr<PlainTextComponent> version_text_;
  63. std::unique_ptr<PlainTextComponent> fork_text_;
  64. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AboutSection)
  65. };