- pdp->win = elm_win_add(nullptr, "tpkp popup", ELM_WIN_NOTIFICATION);
-
- elm_win_autodel_set(pdp->win, EINA_TRUE);
- elm_win_indicator_opacity_set(pdp->win, ELM_WIN_INDICATOR_TRANSLUCENT);
- elm_win_alpha_set(pdp->win, true);
- evas_object_show(pdp->win);
-
- pdp->popup = elm_popup_add(pdp->win);
- evas_object_show(pdp->popup);
-
- pdp->box = elm_box_add(pdp->popup);
- evas_object_size_hint_weight_set(pdp->box, EVAS_HINT_EXPAND, 0);
- evas_object_size_hint_align_set(pdp->box, EVAS_HINT_FILL, 0.0);
- evas_object_show(pdp->box);
-
- pdp->title = elm_label_add(pdp->popup);
- elm_object_style_set(pdp->title, "elm.text.title");
- elm_object_text_set(pdp->title, dgettext(PROJECT_NAME, "SID_TITLE_PUBLIC_KEY_MISMATCHED"));
- evas_object_show(pdp->title);
- elm_box_pack_end(pdp->box, pdp->title);
-
- pdp->content = elm_label_add(pdp->popup);
- elm_object_style_set(pdp->content, "elm.swallow.content");
- elm_label_line_wrap_set(pdp->content, ELM_WRAP_MIXED);
- char *contentFormat = dgettext(PROJECT_NAME, "SID_CONTENT_PUBLIC_KEY_MISMATCHED");
- char *content = nullptr;
- if (asprintf(&content, contentFormat, pdp->hostname.c_str()) == -1) {
- SLOGE("Failed to alloc memory for popup text. Just go for it.");
- elm_object_text_set(pdp->content, contentFormat);
- } else {
- elm_object_text_set(pdp->content, content);
- free(content);
- }
-
- evas_object_size_hint_weight_set(pdp->content, EVAS_HINT_EXPAND, 0.0);
- evas_object_size_hint_align_set(pdp->content, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(pdp->content);
- elm_box_pack_end(pdp->box, pdp->content);
-
- elm_object_part_content_set(pdp->popup, "default", pdp->box);
-
- pdp->buttonAllow = elm_button_add(pdp->popup);
- elm_object_style_set(pdp->buttonAllow, "elm.swallow.content.button1");
- elm_object_text_set(pdp->buttonAllow, dgettext(PROJECT_NAME, "SID_BTN_ALLOW"));
- elm_object_part_content_set(pdp->popup, "button1", pdp->buttonAllow);
- evas_object_smart_callback_add(pdp->buttonAllow, "clicked", answerAllowCb, pdp);
- evas_object_show(pdp->buttonAllow);
-
- pdp->buttonDeny = elm_button_add(pdp->popup);
- elm_object_style_set(pdp->buttonDeny, "elm.swallow.content.button2");
- elm_object_text_set(pdp->buttonDeny, dgettext(PROJECT_NAME, "SID_BTN_DENY"));
- elm_object_part_content_set(pdp->popup, "button2 ", pdp->buttonDeny);
- evas_object_smart_callback_add(pdp->buttonDeny, "clicked", answerDenyCb, pdp);
- evas_object_show(pdp->buttonDeny);
+ /* create win */
+ Evas_Object *win = elm_win_add(nullptr, "tpkp popup", ELM_WIN_NOTIFICATION);
+ elm_win_autodel_set(win, EINA_TRUE);
+ elm_win_indicator_opacity_set(win, ELM_WIN_INDICATOR_TRANSLUCENT);
+ elm_win_borderless_set(win, EINA_TRUE);
+ elm_win_alpha_set(win, EINA_TRUE);
+ evas_object_show(win);
+
+ /* create popup */
+ auto contentString = getPopupContentString(pdp);
+ Evas_Object *popup = elm_popup_add(win);
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_text_set(popup, contentString.get());
+ elm_object_part_text_set(popup, "title,text", dgettext(PROJECT_NAME, "SID_TITLE_PUBLIC_KEY_MISMATCHED"));
+ evas_object_show(popup);
+
+ /* create allow button */
+ Evas_Object *buttonAllow = elm_button_add(popup);
+ elm_object_style_set(buttonAllow, "bottom");
+ elm_object_text_set(buttonAllow, dgettext(PROJECT_NAME, "SID_BTN_ALLOW"));
+ elm_object_part_content_set(popup, "button1", buttonAllow);
+ evas_object_smart_callback_add(buttonAllow, "clicked", answerAllowCb, pdp);
+ evas_object_show(buttonAllow);
+
+ /* create deny button */
+ Evas_Object *buttonDeny = elm_button_add(popup);
+ elm_object_style_set(buttonDeny, "bottom");
+ elm_object_text_set(buttonDeny, dgettext(PROJECT_NAME, "SID_BTN_DENY"));
+ elm_object_part_content_set(popup, "button2", buttonDeny);
+ evas_object_smart_callback_add(buttonDeny, "clicked", answerDenyCb, pdp);
+ evas_object_show(buttonDeny);