p.setMessage(message);
p.setTitle(" Malware detected");
- p.setHeader(" Malware which is harm your phone is<br>"
+ p.setHeader(" Malware which is harm your phone is"
" detected.");
p.setBody(FORMAT(" - Risk : " << risk << " (" << d.malwareName << ")"));
- p.setFooter(" If you really want to process anyway,<br>"
+ p.setFooter(" If you really want to process anyway,"
" tap ignore.");
p.setText(p.m_buttons[0], "OK");
p.setMessage(message);
p.setTitle(" Malware detected");
- p.setHeader(" Malware which is harm your phone is<br>"
+ p.setHeader(" Malware which is harm your phone is"
" detected.");
p.setBody(FORMAT(
" - File name : " << fileName << "<br>" <<
" - Path : " << extraPath << "<br>" <<
" - Risk : " << risk << " (" << d.malwareName << ")"));
p.setFooter(
- " Tap Delete to delete infected files and<br>"
- " protect your phone. If you really want to<br>"
+ " Tap Delete to delete infected files and"
+ " protect your phone. If you really want to"
" process anyway, tap Ignore.");
p.setText(p.m_buttons[0], "OK");
p.setMessage(message);
p.setTitle(" Malware detected");
- p.setHeader(" Malware which is harm your phone<br>"
+ p.setHeader(" Malware which is harm your phone"
" is detected.");
p.setBody(FORMAT(
" App name : " << info.getLabel() << "<br>" <<
" Risk : " << risk << " (" << d.malwareName << ")"));
p.setIcon(info.getIconPath());
p.setFooter(
- " Tap Uninstall to uninstall infected<br>"
- " application and protect your phone. If<br>"
- " you really want to process anyway, tap<br>"
+ " Tap Uninstall to uninstall infected"
+ " application and protect your phone. If"
+ " you really want to process anyway, tap"
" Ignore.");
p.setText(p.m_buttons[0], "OK");
p.setMessage(message);
p.setTitle(" Malware detected");
- p.setHeader(" Malware which is harm your phone is<br>"
+ p.setHeader(" Malware which is harm your phone is"
" detected.");
p.setBody(FORMAT(" - Risk : " << "High" << " (" << d.malwareName << ")"));
- p.setFooter(" Processing is prohibited to protect<br>"
+ p.setFooter(" Processing is prohibited to protect"
" your phone.");
p.setText(p.m_buttons[0], "OK");
p.setMessage(message);
p.setTitle(" Malware detected");
- p.setHeader(" Malware which is harm your phone is<br>"
+ p.setHeader(" Malware which is harm your phone is"
" detected.");
p.setBody(FORMAT(
" - File name : " << fileName << "<br>" <<
" - Path : " << extraPath << "<br>" <<
" - Risk : " << "High" << " (" << d.malwareName << ")"));
p.setFooter(
- " Tap Delete to delete infected files and<br>"
+ " Tap Delete to delete infected files and"
" protect your phone.");
p.setText(p.m_buttons[0], "OK");
p.setMessage(message);
p.setTitle(" Malware detected");
- p.setHeader(" Malware which is harm your phone is<br>"
+ p.setHeader(" Malware which is harm your phone is"
" detected.");
p.setIcon(info.getIconPath());
p.setBody(FORMAT(
" Version : " << info.getVersion() << "<br>" <<
" Risk : " << "High" << " (" << d.malwareName << ")"));
p.setFooter(
- " Tap Uninstall to uninstall infected<br>"
+ " Tap Uninstall to uninstall infected"
" application and protect your phone.");
p.setText(p.m_buttons[0], "OK");
" - URL : " << item.url << "<br>" <<
" - Risk : " << risk));
p.setFooter(
- " Accessing to this URL is prohibited to<br>"
+ " Accessing to this URL is prohibited to"
" protect your phone.");
p.setText(p.m_buttons[0], "OK");
" - URL : " << item.url << "<br>" <<
" - Risk : " << "High"));
p.setFooter(
- " If you really want to process anyway,<br>"
+ " If you really want to process anyway,"
" tap View");
p.setText(p.m_buttons[0], "OK");
elm_win_indicator_opacity_set(m_win, ELM_WIN_INDICATOR_TRANSLUCENT);
elm_win_borderless_set(m_win, EINA_TRUE);
elm_win_alpha_set(m_win, EINA_TRUE);
+ elm_win_screen_size_get(m_win, NULL, NULL, &m_winW, &m_winH);
+ evas_object_size_hint_max_set(m_win, m_winW, m_winH);
+ evas_object_size_hint_min_set(m_win, m_winW, m_winH / 4);
// Set popup properties.
m_popup = elm_popup_add(m_win);
- elm_popup_align_set(m_popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
- evas_object_size_hint_weight_set(m_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ setDefaultProperties(m_popup);
// Wrap objects with box.
m_box = elm_box_add(m_popup);
- evas_object_size_hint_weight_set(m_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(m_header, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_box_padding_set(m_box, 10, 10);
+ setDefaultProperties(m_box);
+ elm_box_padding_set(m_box, 0, 20);
evas_object_show(m_box);
m_header = elm_label_add(m_box);
- evas_object_size_hint_weight_set(m_header, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(m_header, EVAS_HINT_FILL, 0);
+ setDefaultProperties(m_header);
elm_box_pack_end(m_box, m_header);
evas_object_show(m_header);
// Subbox is for icon.
m_subBox = elm_box_add(m_box);
- evas_object_size_hint_weight_set(m_subBox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(m_subBox, 0, 0);
+ setDefaultProperties(m_subBox);
elm_box_horizontal_set(m_subBox, EINA_TRUE);
-
+ elm_box_padding_set(m_subBox, 20, 0);
// If icon is not set, it doesn't appear.
m_icon = elm_icon_add(m_subBox);
elm_image_resizable_set(m_icon, EINA_FALSE, EINA_FALSE);
evas_object_show(m_icon);
m_body = elm_label_add(m_subBox);
- evas_object_size_hint_weight_set(m_body, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(m_body, EVAS_HINT_FILL, 0);
+ setDefaultProperties(m_body);
elm_box_pack_end(m_subBox, m_body);
evas_object_show(m_body);
// This label is for linking to webview.
m_hypertext = elm_label_add(m_box);
- elm_object_text_set(m_hypertext, "<a href=><color=#0000FFFF>"
- " More information</color></a>");
- evas_object_size_hint_weight_set(m_hypertext, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(m_hypertext, 0, 0);
- evas_object_size_hint_min_set(m_hypertext, 400, 80);
+ setDefaultProperties(m_hypertext);
+ setText(m_hypertext, "<a href=><color=#0000FFFF>"
+ "More information</color></a>");
elm_box_pack_end(m_box, m_hypertext);
evas_object_show(m_hypertext);
m_footer = elm_label_add(m_box);
- evas_object_size_hint_weight_set(m_footer, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(m_footer, EVAS_HINT_FILL, 0);
+ setDefaultProperties(m_footer);
elm_box_pack_end(m_box, m_footer);
evas_object_show(m_footer);
void Popup::setHeader(const std::string &header) noexcept
{
- setText(m_header, "<wrap = word>" + header + "</wrap>");
+ setText(m_header, header);
}
void Popup::setBody(const std::string &body) noexcept
{
- setText(m_body, "<wrap = word>" + body + "</wrap>");
+ setText(m_body, body);
}
void Popup::setFooter(const std::string &footer) noexcept
{
- setText(m_footer, "<br>""<wrap = word>" + footer + "</wrap>");
+ setText(m_footer, footer);
}
void Popup::setMessage(const std::string &msg) noexcept
elm_object_part_text_set(m_popup, "title,text", title.c_str());
}
+void Popup::setDefaultProperties(Evas_Object *obj) noexcept
+{
+ // Set width as maximum, height as minimum.
+ evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, 0);
+ // Set width as fill parent, height as center.
+ evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, 0.5);
+}
+
void Popup::setText(Evas_Object *obj, const std::string &text) noexcept
{
+ // Eable text line-break automatically.
+ elm_label_line_wrap_set(obj, ELM_WRAP_WORD);
elm_object_text_set(obj, text.c_str());
}