From d44bedf92dfa65a04362dc06a022ab3e0aba6dd2 Mon Sep 17 00:00:00 2001 From: "William L. Thomson Jr" Date: Tue, 16 May 2017 19:23:52 -0400 Subject: [PATCH] Changed padding/icon size, adding missing replace all icon and tooltips --- src/bin/ui/search_dialog.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/bin/ui/search_dialog.c b/src/bin/ui/search_dialog.c index ea922a4..e7fdc15 100644 --- a/src/bin/ui/search_dialog.c +++ b/src/bin/ui/search_dialog.c @@ -6,10 +6,10 @@ #include "../ecrire.h" -const static int PADDING = 4; +const static int PADDING = 2; const static int BUTTON_HEIGHT = 29; const static int BUTTON_WIDTH = 70; -const static int BUTTON_ICON_SIZE = 14; +const static int BUTTON_ICON_SIZE = 12; static Evas_Object *find_entry, *replace_entry, *search_box; @@ -164,6 +164,7 @@ ui_find_dialog_open(Evas_Object *parent, Ecrire_Entry *ent) ELM_SCALE_SIZE(BUTTON_ICON_SIZE), ELM_SCALE_SIZE(BUTTON_ICON_SIZE)); elm_object_part_content_set(obj, "icon", icon); + elm_object_tooltip_text_set(obj, _("Find All")); evas_object_show (icon); } else @@ -184,6 +185,7 @@ ui_find_dialog_open(Evas_Object *parent, Ecrire_Entry *ent) ELM_SCALE_SIZE(BUTTON_ICON_SIZE), ELM_SCALE_SIZE(BUTTON_ICON_SIZE)); elm_object_part_content_set(obj, "icon", icon); + elm_object_tooltip_text_set(obj, _("Find Previous")); evas_object_show (icon); } else @@ -204,6 +206,7 @@ ui_find_dialog_open(Evas_Object *parent, Ecrire_Entry *ent) ELM_SCALE_SIZE(BUTTON_ICON_SIZE), ELM_SCALE_SIZE(BUTTON_ICON_SIZE)); elm_object_part_content_set(obj, "icon", icon); + elm_object_tooltip_text_set(obj, _("Find Next")); evas_object_show (icon); } else @@ -234,12 +237,13 @@ ui_find_dialog_open(Evas_Object *parent, Ecrire_Entry *ent) obj = elm_button_add(table); icon = elm_icon_add (table); evas_object_size_hint_aspect_set (icon, EVAS_ASPECT_CONTROL_BOTH, 1, 1); - if (elm_icon_standard_set (icon, "edit-find-replace")) + if (elm_icon_standard_set (icon, "document-edit")) { evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(BUTTON_ICON_SIZE), ELM_SCALE_SIZE(BUTTON_ICON_SIZE)); elm_object_part_content_set(obj, "icon", icon); + elm_object_tooltip_text_set(obj, _("Replace with")); evas_object_show (icon); } else @@ -252,10 +256,22 @@ ui_find_dialog_open(Evas_Object *parent, Ecrire_Entry *ent) evas_object_show(obj); obj = elm_button_add(table); - elm_object_text_set(obj, _("Replace All")); - evas_object_size_hint_min_set(obj, - ELM_SCALE_SIZE(BUTTON_WIDTH), - ELM_SCALE_SIZE(BUTTON_HEIGHT)); + icon = elm_icon_add (table); + evas_object_size_hint_aspect_set (icon, EVAS_ASPECT_CONTROL_BOTH, 1, 1); + if (elm_icon_standard_set (icon, "edit-find-replace")) + { + evas_object_size_hint_min_set(icon, + ELM_SCALE_SIZE(BUTTON_ICON_SIZE), + ELM_SCALE_SIZE(BUTTON_ICON_SIZE)); + elm_object_part_content_set(obj, "icon", icon); + elm_object_tooltip_text_set(obj, _("Replace All")); + evas_object_show (icon); + } + else + { + evas_object_del(icon); + elm_object_text_set(obj, _("Replace All")); + } elm_table_pack (table, obj, 3, row, 1, 1); evas_object_smart_callback_add(obj, "clicked", _replace_all_clicked, ent); evas_object_show(obj); @@ -271,6 +287,7 @@ ui_find_dialog_open(Evas_Object *parent, Ecrire_Entry *ent) evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, 0.5); elm_object_part_content_set(obj, "icon", icon); + elm_object_tooltip_text_set(obj, _("Close")); evas_object_show (icon); } else