Files
MuditaOS/module-gui/gui/widgets/BoxLayoutSizeStore.cpp
pholat 331f80f185 Gui resize requests hadnling (#489)
* EGD-3229 [gui] Added Lenght & Position typedef in Common.hpp
* EGD-3229 [gui] Item & Layout: General resize requests handling mechanism
2020-07-02 10:52:03 +02:00

27 lines
545 B
C++

#include "BoxLayoutSizeStore.hpp"
namespace gui
{
bool BoxLayoutSizeStore::store(Item *it, Size size)
{
if (it == nullptr) {
return false;
}
grants[it] = size;
return true;
}
Size BoxLayoutSizeStore::get(Item *it)
{
Size size = {0, 0};
if (it == nullptr) {
return size;
}
auto found = grants.find(it);
if (found != std::end(grants)) {
return found->second;
}
return {0, 0};
}
} // namespace gui