mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
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:
parent
3e46874858
commit
09980af4ea
Notes:
sideshowbarker
2024-07-16 20:08:14 +09:00
Author: https://github.com/awesomekling
Commit: 09980af4ea
Pull-request: https://github.com/SerenityOS/serenity/pull/24526
21 changed files with 86 additions and 67 deletions
|
@ -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())) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue