mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-25 06:18:18 -05:00
* EGD-3229 [gui] Added Lenght & Position typedef in Common.hpp * EGD-3229 [gui] Item & Layout: General resize requests handling mechanism
27 lines
545 B
C++
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
|