Serenity Operating System
at master 37 lines 852 B view raw
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 8#pragma once 9 10#include <LibGUI/AbstractButton.h> 11 12namespace GUI { 13 14class RadioButton : public AbstractButton { 15 C_OBJECT(RadioButton); 16 17public: 18 virtual ~RadioButton() override = default; 19 20 virtual void click(unsigned modifiers = 0) override; 21 22 virtual Optional<UISize> calculated_min_size() const override; 23 24protected: 25 explicit RadioButton(String text = {}); 26 virtual void paint_event(PaintEvent&) override; 27 28private: 29 // These don't make sense for a radio button, so hide them. 30 using AbstractButton::auto_repeat_interval; 31 using AbstractButton::set_auto_repeat_interval; 32 33 static int horizontal_padding(); 34 static Gfx::IntSize circle_size(); 35}; 36 37}