1 #include "elementary_config.h"
2 #include <Elementary.h>
3 #ifndef ELM_LIB_QUICKLAUNCH
5 my_hover_bt(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
7 Evas_Object *hv = data;
13 _top_bt_clicked(void *data, Evas_Object *obj __UNUSED__,
14 void *event_info __UNUSED__)
16 Evas_Object *hv = (Evas_Object *)data;
17 elm_hover_dismiss(hv);
21 test_hover(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
23 Evas_Object *win, *bg, *bx, *bt, *hv, *ic;
26 win = elm_win_add(NULL, "hover", ELM_WIN_BASIC);
27 elm_win_title_set(win, "Hover");
28 elm_win_autodel_set(win, EINA_TRUE);
31 elm_win_resize_object_add(win, bg);
32 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
35 bx = elm_box_add(win);
36 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
37 elm_win_resize_object_add(win, bx);
40 hv = elm_hover_add(win);
42 bt = elm_button_add(win);
43 elm_object_text_set(bt, "Button");
44 evas_object_smart_callback_add(bt, "clicked", my_hover_bt, hv);
45 elm_box_pack_end(bx, bt);
47 elm_hover_parent_set(hv, win);
48 elm_hover_target_set(hv, bt);
50 bt = elm_button_add(win);
51 elm_object_text_set(bt, "Popup");
52 elm_object_part_content_set(hv, "middle", bt);
55 bx = elm_box_add(win);
57 ic = elm_icon_add(win);
58 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
59 elm_icon_file_set(ic, buf, NULL);
60 elm_icon_resizable_set(ic, 0, 0);
61 elm_box_pack_end(bx, ic);
64 bt = elm_button_add(win);
65 elm_object_text_set(bt, "Top 1");
66 evas_object_smart_callback_add(bt, "clicked", _top_bt_clicked, hv);
67 elm_box_pack_end(bx, bt);
69 bt = elm_button_add(win);
70 elm_object_text_set(bt, "Top 2");
71 elm_box_pack_end(bx, bt);
73 bt = elm_button_add(win);
74 elm_object_text_set(bt, "Top 3");
75 elm_box_pack_end(bx, bt);
79 elm_object_part_content_set(hv, "top", bx);
81 bt = elm_button_add(win);
82 elm_object_text_set(bt, "Bottom");
83 elm_object_part_content_set(hv, "bottom", bt);
86 bt = elm_button_add(win);
87 elm_object_text_set(bt, "Left");
88 elm_object_part_content_set(hv, "left", bt);
91 bt = elm_button_add(win);
92 elm_object_text_set(bt, "Right");
93 elm_object_part_content_set(hv, "right", bt);
96 evas_object_size_hint_min_set(bg, 160, 160);
97 evas_object_size_hint_max_set(bg, 640, 640);
98 evas_object_resize(win, 440, 440);
99 evas_object_show(win);
103 test_hover2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
105 Evas_Object *win, *bg, *bx, *bt, *hv, *ic;
108 win = elm_win_add(NULL, "hover2", ELM_WIN_BASIC);
109 elm_win_title_set(win, "Hover 2");
110 elm_win_autodel_set(win, EINA_TRUE);
112 bg = elm_bg_add(win);
113 elm_win_resize_object_add(win, bg);
114 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
115 evas_object_show(bg);
117 bx = elm_box_add(win);
118 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
119 elm_win_resize_object_add(win, bx);
120 evas_object_show(bx);
122 hv = elm_hover_add(win);
123 elm_object_style_set(hv, "popout");
125 bt = elm_button_add(win);
126 elm_object_text_set(bt, "Button");
127 evas_object_smart_callback_add(bt, "clicked", my_hover_bt, hv);
128 elm_box_pack_end(bx, bt);
129 evas_object_show(bt);
130 elm_hover_parent_set(hv, win);
131 elm_hover_target_set(hv, bt);
133 bt = elm_button_add(win);
134 elm_object_text_set(bt, "Popup");
135 elm_object_part_content_set(hv, "middle", bt);
136 evas_object_show(bt);
138 bx = elm_box_add(win);
140 ic = elm_icon_add(win);
141 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
142 elm_icon_file_set(ic, buf, NULL);
143 elm_icon_resizable_set(ic, 0, 0);
144 elm_box_pack_end(bx, ic);
145 evas_object_show(ic);
146 bt = elm_button_add(win);
147 elm_object_text_set(bt, "Top 1");
148 elm_box_pack_end(bx, bt);
149 evas_object_show(bt);
150 bt = elm_button_add(win);
151 elm_object_text_set(bt, "Top 2");
152 elm_box_pack_end(bx, bt);
153 evas_object_show(bt);
154 bt = elm_button_add(win);
155 elm_object_text_set(bt, "Top 3");
156 elm_box_pack_end(bx, bt);
157 evas_object_show(bt);
158 evas_object_show(bx);
159 elm_object_part_content_set(hv, "top", bx);
161 bt = elm_button_add(win);
162 elm_object_text_set(bt, "Bot");
163 elm_object_part_content_set(hv, "bottom", bt);
164 evas_object_show(bt);
166 bt = elm_button_add(win);
167 elm_object_text_set(bt, "Left");
168 elm_object_part_content_set(hv, "left", bt);
169 evas_object_show(bt);
171 bt = elm_button_add(win);
172 elm_object_text_set(bt, "Right");
173 elm_object_part_content_set(hv, "right", bt);
174 evas_object_show(bt);
176 evas_object_size_hint_min_set(bg, 160, 160);
177 evas_object_size_hint_max_set(bg, 640, 640);
178 evas_object_resize(win, 440, 440);
179 evas_object_show(win);