summaryrefslogtreecommitdiff
path: root/src/examples/elementary/icon_cxx_example_01.cc
blob: 90271c18ef7d043a1228a75e8397305487cb8748 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <Efl_Ui.hh>

EAPI_MAIN int
elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);

   using efl::eo::instantiate;

   efl::ui::Win win(instantiate);
   //win.title_set("Icon");
   win.autohide_set(true);

   efl::ui::Image icon(instantiate, win);
   icon.icon_set("home");

   efl::eina::string_view path = icon.file_get();
   efl::eina::string_view group = icon.key_get();
   std::cout << "path = " << path << ", group = "<< group;

   std::cout << ", name = " << icon.icon_get() << std::endl;

   icon.scale_method_set(EFL_GFX_IMAGE_SCALE_METHOD_NONE);
   //icon.resizable_set(false, true);
   //icon.smooth_set(false);
   //icon.fill_outside_set(true);

   win.content_set(icon);
   win.size_set({320, 320});

   elm_run();
   return 0;
}
ELM_MAIN()