Refactor some dialog handling, enforce proper port disposal

This commit is contained in:
elasota
2020-01-01 20:49:18 -05:00
parent 5fe6218c28
commit 1c6ab800a7
25 changed files with 121 additions and 91 deletions

View File

@@ -2,6 +2,7 @@
#include "IconLoader.h"
#include "QDPixMap.h"
#include "PLTimeTaggedVOSEvent.h"
#include <assert.h>
@@ -46,4 +47,12 @@ namespace PortabilityLayer
CopyMask(*m_iconImage, *m_iconMask, *surface->m_port.GetPixMap(), &(*m_iconImage)->m_rect, &(*m_iconMask)->m_rect, &m_rect);
surface->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
}
WidgetHandleState_t IconWidget::ProcessEvent(const TimeTaggedVOSEvent &evt)
{
if (evt.IsLMouseDownEvent() && m_rect.Contains(m_window->MouseToLocal(evt.m_vosEvent.m_event.m_mouseInputEvent)))
return WidgetHandleStates::kActivated;
else
return WidgetHandleStates::kIgnored;
}
}