popups: refactor popups.

Some of these looked pretty duff. Have tried to make them
more consistent and nicer.
This commit is contained in:
Al Poole 2017-09-11 18:54:02 +01:00
parent 86731ea849
commit 3b1e7d0288
4 changed files with 88 additions and 80 deletions

View File

@ -509,29 +509,29 @@ _edi_mainview_project_search_popup_key_up_cb(void *data EINA_UNUSED, Evas *e EIN
void
edi_mainview_project_search_popup_show(void)
{
Evas_Object *table, *popup, *box, *input, *button, *sep, *label, *icon;
Evas_Object *popup, *box, *input, *button, *sep, *label;
popup = elm_popup_add(_main_win);
_edi_mainview_search_project_popup = popup;
elm_object_part_text_set(popup, "title,text",
"Search for (whole project)");
table = elm_table_add(popup);
icon = elm_icon_add(table);
elm_icon_standard_set(icon, "system-search");
evas_object_size_hint_min_set(icon, 48 * elm_config_scale_get(), 48 * elm_config_scale_get());
evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(icon);
elm_table_pack(table, icon, 0, 0, 1, 1);
box = elm_box_add(popup);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
label = elm_label_add(popup);
elm_object_text_set(label, "Please enter a term to search for within<br> the whole project.");
evas_object_show(label);
elm_box_pack_end(box, label);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
input = elm_entry_add(box);
elm_entry_single_line_set(input, EINA_TRUE);
elm_entry_editable_set(input, EINA_TRUE);
@ -546,12 +546,9 @@ edi_mainview_project_search_popup_show(void)
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
elm_table_pack(table, box, 1, 0, 1, 1);
evas_object_show(table);
elm_object_content_set(popup, table);
elm_object_content_set(popup, box);
button = elm_button_add(popup);
elm_object_text_set(button, "Cancel");

View File

@ -424,20 +424,24 @@ _edi_mainview_panel_mime_content_safe_popup(void)
elm_table_pack(table, icon, 0, 0, 1, 1);
box = elm_box_add(popup);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
label = elm_label_add(popup);
elm_object_text_set(label, "To force open, select this file in the file browser, <br>and use \"open as\" menu options.");
evas_object_show(label);
elm_box_pack_end(box, label);
elm_table_pack(table, label, 1, 0, 1, 1);
evas_object_show(table);
elm_box_pack_end(box, table);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
elm_table_pack(table, box, 1, 0, 1, 1);
evas_object_show(box);
elm_object_content_set(popup, table);
evas_object_show(table);
elm_object_content_set(popup, box);
button = elm_button_add(popup);
elm_object_text_set(button, "OK");
@ -662,7 +666,7 @@ _edi_mainview_panel_goto_popup_key_up_cb(void *data, Evas *e EINA_UNUSED,
void
edi_mainview_panel_goto_popup_show(Edi_Mainview_Panel *panel)
{
Evas_Object *popup, *box, *input, *button;
Evas_Object *popup, *box, *input, *sep, *button;
popup = elm_popup_add(_main_win);
_edi_mainview_goto_popup = popup;
@ -673,6 +677,11 @@ edi_mainview_panel_goto_popup_show(Edi_Mainview_Panel *panel)
elm_box_horizontal_set(box, EINA_FALSE);
elm_object_content_set(popup, box);
sep = elm_separator_add(popup);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
input = elm_entry_add(box);
elm_entry_single_line_set(input, EINA_TRUE);
elm_entry_scrollable_set(input, EINA_TRUE);
@ -682,6 +691,11 @@ edi_mainview_panel_goto_popup_show(Edi_Mainview_Panel *panel)
evas_object_show(input);
elm_box_pack_end(box, input);
sep = elm_separator_add(popup);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
button = elm_button_add(popup);
elm_object_text_set(button, "Cancel");
elm_object_part_content_set(popup, "button1", button);

View File

@ -165,7 +165,7 @@ _edi_file_screens_rename_cb(void *data,
void
edi_file_screens_rename(Evas_Object *parent, const char *path)
{
Evas_Object *table, *popup, *box, *input, *button, *sep, *label, *icon;
Evas_Object *popup, *box, *input, *button, *sep, *label;
const char *leaf;
_parent_obj = parent;
@ -180,17 +180,6 @@ edi_file_screens_rename(Evas_Object *parent, const char *path)
leaf = ecore_file_file_get(path);
_directory_path = eina_stringshare_add(ecore_file_dir_get(path));
table = elm_table_add(popup);
icon = elm_icon_add(table);
elm_icon_standard_set(icon, "dialog-information");
evas_object_size_hint_min_set(icon, 48 * elm_config_scale_get(), 48 * elm_config_scale_get());
evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(icon);
elm_table_pack(table, icon, 0, 0, 1, 1);
box = elm_box_add(popup);
label = elm_label_add(popup);
if (ecore_file_is_dir(path))
elm_object_text_set(label, "Please enter a new name for this directory.");
@ -198,8 +187,18 @@ edi_file_screens_rename(Evas_Object *parent, const char *path)
elm_object_text_set(label, "Please enter a new name for this file.");
evas_object_show(label);
box = elm_box_add(popup);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
elm_box_pack_end(box, label);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
input = elm_entry_add(box);
elm_entry_single_line_set(input, EINA_TRUE);
elm_entry_editable_set(input, EINA_TRUE);
@ -209,16 +208,14 @@ edi_file_screens_rename(Evas_Object *parent, const char *path)
evas_object_size_hint_align_set(input, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(input);
elm_box_pack_end(box, input);
evas_object_show(box);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
elm_table_pack(table, box, 1, 0, 1, 1);
evas_object_show(table);
elm_object_content_set(popup, table);
evas_object_show(box);
elm_object_content_set(popup, box);
button = elm_button_add(popup);
elm_object_text_set(button, "Cancel");
@ -240,7 +237,7 @@ edi_file_screens_rename(Evas_Object *parent, const char *path)
void
edi_file_screens_create_file(Evas_Object *parent, const char *directory)
{
Evas_Object *table, *popup, *box, *input, *button, *sep, *label, *icon;
Evas_Object *popup, *box, *input, *button, *sep, *label;
_parent_obj = parent;
_popup = popup = elm_popup_add(parent);
@ -248,22 +245,22 @@ edi_file_screens_create_file(Evas_Object *parent, const char *directory)
"Enter new file name");
_directory_path = eina_stringshare_add(directory);
table = elm_table_add(popup);
icon = elm_icon_add(table);
elm_icon_standard_set(icon, "document-new");
evas_object_size_hint_min_set(icon, 48 * elm_config_scale_get(), 48 * elm_config_scale_get());
evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(icon);
elm_table_pack(table, icon, 0, 0, 1, 1);
box = elm_box_add(popup);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
label = elm_label_add(popup);
elm_object_text_set(label, "Please enter a name for this new file.");
evas_object_show(label);
elm_box_pack_end(box, label);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
input = elm_entry_add(box);
elm_entry_single_line_set(input, EINA_TRUE);
elm_entry_editable_set(input, EINA_TRUE);
@ -277,12 +274,9 @@ edi_file_screens_create_file(Evas_Object *parent, const char *directory)
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
elm_table_pack(table, box, 1, 0, 1, 1);
evas_object_show(table);
elm_object_content_set(popup, table);
elm_object_content_set(popup, box);
button = elm_button_add(popup);
elm_object_text_set(button, "Cancel");
@ -303,7 +297,7 @@ edi_file_screens_create_file(Evas_Object *parent, const char *directory)
void
edi_file_screens_create_dir(Evas_Object *parent, const char *directory)
{
Evas_Object *table, *popup, *box, *input, *button, *sep, *label, *icon;
Evas_Object *popup, *box, *input, *button, *sep, *label;
_parent_obj = parent;
_directory_path = eina_stringshare_add(directory);
@ -312,22 +306,22 @@ edi_file_screens_create_dir(Evas_Object *parent, const char *directory)
elm_object_part_text_set(popup, "title,text",
"Enter new directory name");
table = elm_table_add(popup);
icon = elm_icon_add(table);
elm_icon_standard_set(icon, "folder-new");
evas_object_size_hint_min_set(icon, 48 * elm_config_scale_get(), 48 * elm_config_scale_get());
evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(icon);
elm_table_pack(table, icon, 0, 0, 1, 1);
box = elm_box_add(popup);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
label = elm_label_add(popup);
elm_object_text_set(label, "Please enter a name for this new directory.");
evas_object_show(label);
elm_box_pack_end(box, label);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
input = elm_entry_add(box);
elm_entry_single_line_set(input, EINA_TRUE);
elm_entry_editable_set(input, EINA_TRUE);
@ -336,17 +330,14 @@ edi_file_screens_create_dir(Evas_Object *parent, const char *directory)
evas_object_size_hint_align_set(input, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(input);
elm_box_pack_end(box, input);
evas_object_show(box);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
elm_table_pack(table, box, 1, 0, 1, 1);
evas_object_show(table);
evas_object_show(box);
elm_object_content_set(popup, table);
elm_object_content_set(popup, box);
button = elm_button_add(popup);
elm_object_text_set(button, "Cancel");

View File

@ -49,22 +49,25 @@ void edi_screens_message_confirm(Evas_Object *parent, const char *message, void
evas_object_show(icon);
elm_table_pack(table, icon, 0, 0, 1, 1);
box = elm_box_add(popup);
label = elm_label_add(table);
elm_object_text_set(label, message);
evas_object_show(label);
elm_box_pack_end(box, label);
elm_table_pack(table, label, 1, 0, 1, 1);
evas_object_show(table);
box = elm_box_add(popup);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
elm_box_pack_end(box, table);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
evas_object_show(box);
elm_table_pack(table, box, 1, 0, 1, 1);
elm_object_content_set(popup, table);
evas_object_show(table);
elm_object_content_set(popup, box);
button = elm_button_add(popup);
elm_object_text_set(button, "Yes");
@ -96,21 +99,24 @@ void edi_screens_message(Evas_Object *parent, const char *title, const char *mes
evas_object_show(icon);
elm_table_pack(table, icon, 0, 0, 1, 1);
box = elm_box_add(popup);
label = elm_label_add(popup);
elm_object_text_set(label, message);
evas_object_show(label);
elm_box_pack_end(box, label);
elm_table_pack(table, label, 1, 0, 1, 1);
evas_object_show(table);
box = elm_box_add(popup);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
elm_box_pack_end(box, table);
sep = elm_separator_add(box);
elm_separator_horizontal_set(sep, EINA_TRUE);
evas_object_show(sep);
elm_box_pack_end(box, sep);
evas_object_show(box);
elm_table_pack(table, box, 1, 0, 1, 1);
evas_object_show(table);
elm_object_content_set(popup, table);
elm_object_content_set(popup, box);
button = elm_button_add(popup);
elm_object_text_set(button, "OK");