RadioButton.h 852 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(String text = {});
  18. virtual void paint_event(PaintEvent&) override;
  19. private:
  20. // These don't make sense for a radio button, so hide them.
  21. using AbstractButton::auto_repeat_interval;
  22. using AbstractButton::set_auto_repeat_interval;
  23. static int horizontal_padding();
  24. static Gfx::IntSize circle_size();
  25. };
  26. }