#include "FUi_ResourceManager.h"
#include "FUi_ControlImplManager.h"
#include "FUi_LayoutImpl.h"
+#include "FUi_Math.h"
#include "FUiCtrl_FrameImpl.h"
#include "FUiCtrl_PopupImpl.h"
#include "FUiCtrl_Popup.h"
, _centerAlign(false)
, __init(false)
, __callBoundsChange(false)
+ , __prevPos(0.0f, 0.0f)
{
//empty statement
}
return GetCore().OnChangeLayout(orientation);
}
+result
+_PopupImpl::OnBoundsChanging(const FloatRectangle& bounds)
+{
+ __prevPos = GetBoundsF().GetTopLeft();
+
+ return _ControlImpl::OnBoundsChanging(bounds);
+}
+
void
_PopupImpl::OnBoundsChanged(void)
{
FloatRectangle rect = GetBoundsF();
if (__init)
{
- if (_centerAlign)
+ if ((_centerAlign || (_FloatCompare(__prevPos.x, rect.x) && _FloatCompare(__prevPos.y, rect.y))) && __callBoundsChange == false)
{
rect = GetCenterAlignedRect(GetSizeF().width, GetSizeF().height);
- _centerAlign = false;
}
else
{
rect = GetCenterAlignedRect(rect.width, rect.height);
}
+ _centerAlign = true;
result r = SetBounds(rect, true);
if (IsFailed(r))
}
_ControlImpl::OnBoundsChanged();
+
+ _centerAlign = false;
}
Tizen::Graphics::FloatRectangle GetCenterAlignedRect(float width, float height) const;
virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation);
+ virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds);
virtual void OnBoundsChanged(void);
public:
private:
bool __init;
bool __callBoundsChange;
+ Tizen::Graphics::FloatPoint __prevPos;
}; // _PopupImpl