RadioButton.h 864 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. * Copyright (c) 2022, the SerenityOS developers.
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <LibGUI/AbstractButton.h>
  9. namespace GUI {
  10. class RadioButton : public AbstractButton {
  11. C_OBJECT(RadioButton);
  12. public:
  13. virtual ~RadioButton() override = default;
  14. virtual void click(unsigned modifiers = 0) override;
  15. virtual Optional<UISize> calculated_min_size() const override;
  16. protected:
  17. explicit RadioButton(DeprecatedString text);
  18. explicit RadioButton(String text = {});
  19. virtual void paint_event(PaintEvent&) override;
  20. private:
  21. // These don't make sense for a radio button, so hide them.
  22. using AbstractButton::auto_repeat_interval;
  23. using AbstractButton::set_auto_repeat_interval;
  24. static Gfx::IntSize circle_size();
  25. };
  26. }