diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-11-17 10:37:33 +0100 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2020-02-03 17:19:29 +0100 |
commit | b345305ffae0e13f650912844ce222972af47a75 (patch) | |
tree | af76cc5a19316350018f6a143eb10becfc5c48a9 | |
parent | e3ff3453f311d512bf8754bf3ebbab9833d0eb89 (diff) | |
download | efl-b345305ffae0e13f650912844ce222972af47a75.tar.gz |
wip wip wip
-rw-r--r-- | src/examples/elementary/homescreen/button_theme.edc | 32 | ||||
-rw-r--r-- | src/examples/elementary/homescreen/homescreen.c | 32 |
2 files changed, 48 insertions, 16 deletions
diff --git a/src/examples/elementary/homescreen/button_theme.edc b/src/examples/elementary/homescreen/button_theme.edc index c2c3f76a7b..24b8d73319 100644 --- a/src/examples/elementary/homescreen/button_theme.edc +++ b/src/examples/elementary/homescreen/button_theme.edc @@ -1,4 +1,23 @@ #define FN_COL_DEFAULT 255 255 255 255; color3: 0 0 0 128 + +#define EFL_UI_CLICKABLE_PART_BIND(PART) \ +program { \ + signal: "mouse,down,1"; source: PART; \ + action: SIGNAL_EMIT "efl,action,press" "efl"; \ +} \ +program { \ + signal: "mouse,down,1,*"; source: PART; \ + action: SIGNAL_EMIT "efl,action,press" "efl"; \ +} \ +program { \ + signal: "mouse,up,1"; source: PART; \ + action: SIGNAL_EMIT "efl,action,unpress" "efl"; \ +} \ +program { \ + signal: "mouse,pressed,out"; source: PART; \ + action: SIGNAL_EMIT "efl,action,mouse_out" "efl"; \ +} + collections { color_classes { color_class { name: "button_text"; @@ -41,6 +60,8 @@ collections { desc { "default" rel1.relative: 0.0 1.0; rel2.relative: 1.0 1.0; + rel2.offset: 0 -2; + rel1.offset: 0 -2; align: 0.0 1.0; color3: 255 255 255 255; text { font: "sans"; size: 10;; @@ -52,11 +73,16 @@ collections { visible: 1; fixed: 0 0; } - desc { "visible"; - inherit: "default"; - + } + rect { "event"; + desc { "default" + color: 0 0 0 0; } } } + programs { + EFL_UI_CLICKABLE_PART_BIND("event") + } + } } diff --git a/src/examples/elementary/homescreen/homescreen.c b/src/examples/elementary/homescreen/homescreen.c index c1f8db1b53..f59d730ee4 100644 --- a/src/examples/elementary/homescreen/homescreen.c +++ b/src/examples/elementary/homescreen/homescreen.c @@ -13,24 +13,25 @@ typedef struct Efl_Event_Cb cb; } Icon; +#define P "/usr/share/icons/hicolor/128x128/apps/" static Icon workspace1[] = { - { EINA_POSITION2D(0, 0), "Chrome", "/usr/share/icons/hicolor/128x128/apps/chromium.png", NULL}, - { EINA_POSITION2D(0, 1), "bla", "ic2", NULL}, + { EINA_POSITION2D(0, 0), "Chrome", P"chromium.png", NULL}, + { EINA_POSITION2D(0, 1), "Cups", P"cups.png", NULL}, { EINA_POSITION2D(2, 0), NULL, NULL, NULL}, }; static Icon workspace2[] = { - { EINA_POSITION2D(0, 3), "bla", "ic", NULL}, - { EINA_POSITION2D(1, 3), "bla", "ic", NULL}, - { EINA_POSITION2D(2, 3), "bla", "ic", NULL}, - { EINA_POSITION2D(3, 3), "bla", "ic", NULL}, - { EINA_POSITION2D(4, 3), "bla", "ic", NULL}, - { EINA_POSITION2D(0, 4), "bla", "ic", NULL}, - { EINA_POSITION2D(1, 4), "bla", "ic", NULL}, - { EINA_POSITION2D(2, 4), "bla", "ic", NULL}, - { EINA_POSITION2D(3, 4), "bla", "ic", NULL}, - { EINA_POSITION2D(4, 4), "bla", "ic", NULL}, + { EINA_POSITION2D(0, 3), "Cadence", P"cadence.png", NULL}, + { EINA_POSITION2D(1, 3), "Emacs", P"emacs.png", NULL}, + { EINA_POSITION2D(2, 3), "etui", P"etui.png", NULL}, + { EINA_POSITION2D(3, 3), "CAD", P"librecad.png", NULL}, + { EINA_POSITION2D(4, 3), "Libreoffice", P"libreoffice-base.png", NULL}, + { EINA_POSITION2D(0, 4), "Riot", P"riot.png", NULL}, + { EINA_POSITION2D(1, 4), "Tex", P"texstudio.png", NULL}, + { EINA_POSITION2D(2, 4), "Telegram", P"telegram.png", NULL}, + { EINA_POSITION2D(3, 4), "Vlc", P"vlc.png", NULL}, + { EINA_POSITION2D(4, 4), "Mono", P"monodevelop.png", NULL}, { EINA_POSITION2D(2, 0), NULL, NULL, NULL}, }; @@ -166,6 +167,8 @@ _home_screen_cb(void *data, const Efl_Event *cb) { Efl_Canvas_Rectangle *rect; + printf("asdfasdfasdf\n"); + rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, compositor); efl_gfx_entity_size_set(rect, EINA_SIZE2D(720*SCALE+15, 1280*SCALE)); efl_gfx_entity_position_set(rect, EINA_POSITION2D(0, 1280*SCALE)); @@ -176,7 +179,7 @@ _home_screen_cb(void *data, const Efl_Event *cb) EAPI_MAIN void efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { - Eo *win, *over_container, *desktop; + Eo *win, *over_container, *desktop, *background; efl_ui_theme_extension_add(efl_ui_theme_default_get(), "/home/marcel/git/efl/build/src/examples/elementary/homescreen/button_theme.edj"); @@ -190,5 +193,8 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl_pack_end(compositor, desktop); efl_gfx_entity_size_set(compositor, EINA_SIZE2D(720*SCALE, 1280*SCALE)); + background = efl_add(EFL_UI_LAYOUT_CLASS, win); + efl_file_simple_load(background, "/home/marcel/git/efl/src/examples/elementary/homescreen/Lantern_Cluster.edj", "e/desktop/background"); + efl_content_set(win, background); } EFL_MAIN() |