RadioButton.cpp 887 B

1234567891011121314151617181920212223242526272829303132333435
  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 <LibGfx/Painter.h>
  9. #include <LibGfx/StylePainter.h>
  10. #include <LibWeb/DOM/Document.h>
  11. #include <LibWeb/HTML/BrowsingContext.h>
  12. #include <LibWeb/Layout/Label.h>
  13. #include <LibWeb/Layout/RadioButton.h>
  14. #include <LibWeb/Painting/RadioButtonPaintable.h>
  15. namespace Web::Layout {
  16. RadioButton::RadioButton(DOM::Document& document, HTML::HTMLInputElement& element, NonnullRefPtr<CSS::StyleProperties> style)
  17. : LabelableNode(document, element, move(style))
  18. {
  19. set_intrinsic_width(12);
  20. set_intrinsic_height(12);
  21. }
  22. RadioButton::~RadioButton()
  23. {
  24. }
  25. RefPtr<Painting::Paintable> RadioButton::create_paintable() const
  26. {
  27. return Painting::RadioButtonPaintable::create(*this);
  28. }
  29. }