Files
MuditaOS/module-apps/application-messages/widgets/SMSTemplateItem.cpp
Alek Rudnik 16eaab6b50 Egd 3169 sms templates (#336)
* [EGD-3169] added sms templates model and item
fixed common class name convention

* [EGD-3169] added templates window
Passing template to new sms window is already working

* [EGD-3169] PR fixes from DB PR

* [EGD-3169] add universal callback for templates items

* [EGD-3169] requesting templates from more 2 windows

* [EGD-3169] missign change - display template in threads window

* [EGD-3169] minor fixes

* [EGD-3169] minimal clean up

* [EGD-3169] fixed some layout constatnt

* [EGD-3169] rem minor comments and logs

* [EGD-3089] rem redundant vector include

* [EGD-3169] PR fixes

* [EGD-3169] fixes afeter rebase

* [EGD-3169] workaround for list view issue - added 2 dump entries

* [EGD-3169] PR fixes

* [EGD-3169] style fixes

* [EGD-3169] fix for 0x0D char on enter in text widget

* [EGD-3169] PR fixes

* [EGD-3169] compilation issue
2020-04-30 13:48:23 +02:00

41 lines
1.0 KiB
C++

#include "SMSTemplateItem.hpp"
#include <time/time_conversion.hpp>
#include <Style.hpp>
namespace gui
{
namespace smsTemplItemStyle
{
constexpr uint32_t w = 440;
constexpr uint32_t h = style::window::label::big_h;
} // namespace smsTemplItemStyle
SMSTemplateItem::SMSTemplateItem()
{
minWidth = smsTemplItemStyle::w;
minHeight = smsTemplItemStyle::h;
maxWidth = smsTemplItemStyle::w;
maxHeight = smsTemplItemStyle::h;
text = new gui::Label(this, 0, 0, 0, 0);
style::window::decorateOption(text);
text->setEllipsis(gui::Ellipsis::Right);
}
bool SMSTemplateItem::onDimensionChanged(const BoundingBox &oldDim, const BoundingBox &newDim)
{
text->setPosition(0, 0);
text->setSize(smsTemplItemStyle::w, newDim.h);
return true;
}
void SMSTemplateItem::setTemplate(std::shared_ptr<SMSTemplateRecord> templ)
{
this->templ = templ;
text->setText(templ->text);
}
} /* namespace gui */