mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00

Input events have nothing to do with layout, so let's not send them to layout nodes. The job of Paintable starts to become clear. It represents a paintable item that can be rendered into the viewport, which means it can also be targeted by the mouse cursor.
27 lines
734 B
C++
27 lines
734 B
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Layout/LabelableNode.h>
|
|
#include <LibWeb/Painting/Paintable.h>
|
|
|
|
namespace Web::Painting {
|
|
|
|
class LabelablePaintable : public PaintableBox {
|
|
public:
|
|
Layout::LabelableNode const& layout_box() const;
|
|
Layout::LabelableNode& layout_box();
|
|
|
|
virtual void handle_associated_label_mousedown(Badge<Layout::Label>) { }
|
|
virtual void handle_associated_label_mouseup(Badge<Layout::Label>) { }
|
|
virtual void handle_associated_label_mousemove(Badge<Layout::Label>, [[maybe_unused]] bool is_inside_node_or_label) { }
|
|
|
|
protected:
|
|
LabelablePaintable(Layout::LabelableNode const&);
|
|
};
|
|
|
|
}
|