2021-04-03 09:07:45 -04:00
|
|
|
/*
|
2022-01-31 13:07:22 -05:00
|
|
|
* Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
|
2022-03-10 14:02:25 +01:00
|
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
2021-04-03 09:07:45 -04:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-04-03 09:07:45 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibGUI/Event.h>
|
2021-04-03 20:33:10 -04:00
|
|
|
#include <LibWeb/DOM/Document.h>
|
2022-03-10 14:02:25 +01:00
|
|
|
#include <LibWeb/Painting/RadioButtonPaintable.h>
|
2021-04-03 09:07:45 -04:00
|
|
|
|
|
|
|
namespace Web::Layout {
|
|
|
|
|
|
|
|
RadioButton::RadioButton(DOM::Document& document, HTML::HTMLInputElement& element, NonnullRefPtr<CSS::StyleProperties> style)
|
2022-03-14 23:05:55 +00:00
|
|
|
: FormAssociatedLabelableNode(document, element, move(style))
|
2021-04-03 09:07:45 -04:00
|
|
|
{
|
2023-06-08 15:56:28 +01:00
|
|
|
set_natural_width(12);
|
|
|
|
set_natural_height(12);
|
|
|
|
set_natural_aspect_ratio(1);
|
2021-04-03 09:07:45 -04:00
|
|
|
}
|
|
|
|
|
2022-03-14 13:21:51 -06:00
|
|
|
RadioButton::~RadioButton() = default;
|
2021-04-03 09:07:45 -04:00
|
|
|
|
2023-01-11 12:51:49 +01:00
|
|
|
JS::GCPtr<Painting::Paintable> RadioButton::create_paintable() const
|
2022-03-10 14:02:25 +01:00
|
|
|
{
|
|
|
|
return Painting::RadioButtonPaintable::create(*this);
|
|
|
|
}
|
|
|
|
|
2021-04-03 09:07:45 -04:00
|
|
|
}
|