LibWeb: Add Web::UIEvents::MouseButton enum, drop dependency on LibGUI

This was the only thing LibWeb needed from LibGUI, and we can just
duplicate the enum in LibWeb and get rid of a bogus dependency.
This commit is contained in:
Andreas Kling 2024-06-02 19:00:42 +02:00
commit 09980af4ea
Notes: sideshowbarker 2024-07-16 20:08:14 +09:00
21 changed files with 86 additions and 67 deletions

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibGUI/Event.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Element.h>
#include <LibWeb/Layout/Label.h>
@ -12,6 +11,7 @@
#include <LibWeb/Layout/TextNode.h>
#include <LibWeb/Layout/Viewport.h>
#include <LibWeb/Painting/LabelablePaintable.h>
#include <LibWeb/UIEvents/MouseButton.h>
namespace Web::Layout {
@ -26,7 +26,7 @@ Label::~Label() = default;
void Label::handle_mousedown_on_label(Badge<Painting::TextPaintable>, CSSPixelPoint, unsigned button)
{
if (button != GUI::MouseButton::Primary)
if (button != UIEvents::MouseButton::Primary)
return;
if (auto control = dom_node().control(); control && is<Painting::LabelablePaintable>(control->paintable())) {
@ -39,7 +39,7 @@ void Label::handle_mousedown_on_label(Badge<Painting::TextPaintable>, CSSPixelPo
void Label::handle_mouseup_on_label(Badge<Painting::TextPaintable>, CSSPixelPoint position, unsigned button)
{
if (!m_tracking_mouse || button != GUI::MouseButton::Primary)
if (!m_tracking_mouse || button != UIEvents::MouseButton::Primary)
return;
if (auto control = dom_node().control(); control && is<Painting::LabelablePaintable>(control->paintable())) {