RadioButton.cpp 772 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
  3. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #include <LibGUI/Event.h>
  8. #include <LibWeb/DOM/Document.h>
  9. #include <LibWeb/Painting/RadioButtonPaintable.h>
  10. namespace Web::Layout {
  11. RadioButton::RadioButton(DOM::Document& document, HTML::HTMLInputElement& element, NonnullRefPtr<CSS::StyleProperties> style)
  12. : FormAssociatedLabelableNode(document, element, move(style))
  13. {
  14. set_intrinsic_width(12);
  15. set_intrinsic_height(12);
  16. set_intrinsic_aspect_ratio(1);
  17. }
  18. RadioButton::~RadioButton() = default;
  19. JS::GCPtr<Painting::Paintable> RadioButton::create_paintable() const
  20. {
  21. return Painting::RadioButtonPaintable::create(*this);
  22. }
  23. }