mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
35 lines
836 B
C++
35 lines
836 B
C++
#include "PLInvisibleWidget.h"
|
|
#include "PLTimeTaggedVOSEvent.h"
|
|
#include "PLWidgets.h"
|
|
|
|
namespace PortabilityLayer
|
|
{
|
|
InvisibleWidget::InvisibleWidget(const WidgetBasicState &state)
|
|
: WidgetSpec<InvisibleWidget>(state)
|
|
, m_clickable(state.m_enabled)
|
|
{
|
|
}
|
|
|
|
InvisibleWidget::~InvisibleWidget()
|
|
{
|
|
}
|
|
|
|
bool InvisibleWidget::Init(const WidgetBasicState &state, const void *additionalData)
|
|
{
|
|
(void)state;
|
|
|
|
return true;
|
|
}
|
|
|
|
WidgetHandleState_t InvisibleWidget::ProcessEvent(void *captureContext, const TimeTaggedVOSEvent &evt)
|
|
{
|
|
if (!m_visible || !m_enabled)
|
|
return WidgetHandleStates::kIgnored;
|
|
|
|
if (m_clickable && evt.IsLMouseDownEvent() && m_rect.Contains(m_window->MouseToLocal(evt.m_vosEvent.m_event.m_mouseInputEvent)))
|
|
return WidgetHandleStates::kActivated;
|
|
else
|
|
return WidgetHandleStates::kIgnored;
|
|
}
|
|
}
|