5#include "fifechan/widgets/modalbackdrop.hpp"
8#include "fifechan/graphics.hpp"
9#include "fifechan/widgets/menubar.hpp"
10#include "fifechan/widgets/menuitem.hpp"
11#include "fifechan/widgets/menupopup.hpp"
22 ModalBackdrop::~ModalBackdrop() =
default;
35 int const x =
event.getX();
36 int const y =
event.getY();
38 bool clickHitsMenuBar =
false;
40 if (topContainer !=
nullptr) {
43 if (child ==
nullptr || child ==
this) {
49 if (x >= cx && x < cx + child->
getWidth() && y >= cy && y < cy + child->
getHeight()) {
50 if (
dynamic_cast<MenuBar*
>(child) !=
nullptr ||
dynamic_cast<MenuItem*
>(child) !=
nullptr) {
51 clickHitsMenuBar =
true;
60 if (clickHitsMenuBar) {
66 if (mOwner !=
nullptr) {
Widget * getChild(unsigned int index) const
Gets child by index.
virtual void setOpaque(bool opaque)
Sets the container to be opaque or not.
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
void mousePressed(MouseEvent &event) override
Called when a mouse button has been pressed down on the widget area.
ModalBackdrop(MenuPopup *owner)
Constructor.
void mouseExited(MouseEvent &event) override
Called when the mouse has exited the widget area.
void mouseEntered(MouseEvent &event) override
Called when the mouse has entered into the widget area.
void draw(Graphics *graphics) override
Draws the widget.
void mouseReleased(MouseEvent &event) override
Called when a mouse button has been released on the widget area.
Represents a mouse event.
Used replacement tokens by configure_file():