summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-07-11 12:09:00 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-07-11 12:09:00 +0000
commit187443ad747b36bd4d31c14bd0762a2fa8ea0c30 (patch)
tree151df556525f11e0b3ef9acb8a9df9624bf7f61f /src/bin
parent9ef6a138c5290e7caf69846fa9a0dfe99f13c6b6 (diff)
terminology: use edje for selection.
NOTE: I am ot really able to use GIMP/Inkscape, so plain rectangle for the moment. Patch welcome. SVN revision: 73570
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/termio.c99
1 files changed, 38 insertions, 61 deletions
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 91146d7..72375e3 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -27,7 +27,7 @@ struct _Termio
27 Evas_Object *obj; 27 Evas_Object *obj;
28 } grid; 28 } grid;
29 struct { 29 struct {
30 Evas_Object *obj, *selo1, *selo2, *selo3; 30 Evas_Object *obj, *selo_top, *selo_bottom, *selo_theme;
31 int x, y; 31 int x, y;
32 struct { 32 struct {
33 int x, y; 33 int x, y;
@@ -722,51 +722,29 @@ _smart_apply(Evas_Object *obj)
722 t = start_y; start_y = end_y; end_y = t; 722 t = start_y; start_y = end_y; end_y = t;
723 } 723 }
724 724
725 if (end_y > start_y) 725 evas_object_size_hint_min_set(sd->cur.selo_top,
726 { 726 start_x * sd->font.chw,
727 evas_object_move(sd->cur.selo1, 727 sd->font.chh);
728 ox + (start_x * sd->font.chw), 728 evas_object_size_hint_max_set(sd->cur.selo_top,
729 oy + ((start_y + sd->scroll) * sd->font.chh)); 729 start_x * sd->font.chw,
730 evas_object_resize(sd->cur.selo1, 730 sd->font.chh);
731 (sd->grid.w - start_x) * sd->font.chw, 731 evas_object_size_hint_min_set(sd->cur.selo_bottom,
732 sd->font.chh); 732 (sd->grid.w - end_x) * sd->font.chw,
733 evas_object_show(sd->cur.selo1); 733 sd->font.chh);
734 734 evas_object_size_hint_max_set(sd->cur.selo_bottom,
735 evas_object_move(sd->cur.selo3, 735 (sd->grid.w - end_x) * sd->font.chw,
736 ox, oy + ((end_y + sd->scroll) * sd->font.chh)); 736 sd->font.chh);
737 evas_object_resize(sd->cur.selo3, 737 evas_object_move(sd->cur.selo_theme,
738 (end_x + 1) * sd->font.chw, 738 ox,
739 sd->font.chh); 739 oy + ((start_y + sd->scroll) * sd->font.chh));
740 evas_object_show(sd->cur.selo3); 740 evas_object_resize(sd->cur.selo_theme,
741 } 741 (sd->grid.w + 1) * sd->font.chw,
742 else 742 (end_y + 1 - start_y + sd->scroll) * sd->font.chh);
743 { 743 evas_object_show(sd->cur.selo_theme);
744 evas_object_move(sd->cur.selo1,
745 ox + (start_x * sd->font.chw),
746 oy + ((start_y + sd->scroll) * sd->font.chh));
747 evas_object_resize(sd->cur.selo1,
748 (end_x - start_x + 1) * sd->font.chw,
749 sd->font.chh);
750 evas_object_show(sd->cur.selo1);
751 evas_object_hide(sd->cur.selo3);
752 }
753 if (end_y > (start_y + 1))
754 {
755 evas_object_move(sd->cur.selo2,
756 ox, oy + ((start_y + 1 + sd->scroll) * sd->font.chh));
757 evas_object_resize(sd->cur.selo2,
758 sd->grid.w * sd->font.chw,
759 (end_y - start_y - 1) * sd->font.chh);
760 evas_object_show(sd->cur.selo2);
761 }
762 else
763 evas_object_hide(sd->cur.selo2);
764 } 744 }
765 else 745 else
766 { 746 {
767 evas_object_hide(sd->cur.selo1); 747 evas_object_hide(sd->cur.selo_theme);
768 evas_object_hide(sd->cur.selo2);
769 evas_object_hide(sd->cur.selo3);
770 } 748 }
771 _smart_mouseover_apply(obj); 749 _smart_mouseover_apply(obj);
772} 750}
@@ -1794,6 +1772,11 @@ _termio_config_set(Evas_Object *obj, Config *config)
1794 theme_auto_reload_enable(sd->cur.obj); 1772 theme_auto_reload_enable(sd->cur.obj);
1795 evas_object_resize(sd->cur.obj, sd->font.chw, sd->font.chh); 1773 evas_object_resize(sd->cur.obj, sd->font.chw, sd->font.chh);
1796 evas_object_show(sd->cur.obj); 1774 evas_object_show(sd->cur.obj);
1775
1776 theme_apply(sd->cur.selo_theme, config, "terminology/selection");
1777 theme_auto_reload_enable(sd->cur.selo_theme);
1778 edje_object_part_swallow(sd->cur.selo_theme, "terminology.top_left", sd->cur.selo_top);
1779 edje_object_part_swallow(sd->cur.selo_theme, "terminology.bottom_right", sd->cur.selo_bottom);
1797} 1780}
1798 1781
1799static void 1782static void
@@ -1946,22 +1929,15 @@ _smart_add(Evas_Object *obj)
1946 o = evas_object_rectangle_add(evas_object_evas_get(obj)); 1929 o = evas_object_rectangle_add(evas_object_evas_get(obj));
1947 evas_object_pass_events_set(o, EINA_TRUE); 1930 evas_object_pass_events_set(o, EINA_TRUE);
1948 evas_object_propagate_events_set(o, EINA_FALSE); 1931 evas_object_propagate_events_set(o, EINA_FALSE);
1949 evas_object_smart_member_add(o, obj); 1932 sd->cur.selo_top = o;
1950 sd->cur.selo1 = o;
1951 evas_object_color_set(o, 64, 64, 64, 64);
1952 o = evas_object_rectangle_add(evas_object_evas_get(obj));
1953 evas_object_pass_events_set(o, EINA_TRUE);
1954 evas_object_propagate_events_set(o, EINA_FALSE);
1955 evas_object_smart_member_add(o, obj);
1956 sd->cur.selo2 = o;
1957 evas_object_color_set(o, 64, 64, 64, 64);
1958 o = evas_object_rectangle_add(evas_object_evas_get(obj)); 1933 o = evas_object_rectangle_add(evas_object_evas_get(obj));
1959 evas_object_pass_events_set(o, EINA_TRUE); 1934 evas_object_pass_events_set(o, EINA_TRUE);
1960 evas_object_propagate_events_set(o, EINA_FALSE); 1935 evas_object_propagate_events_set(o, EINA_FALSE);
1936 sd->cur.selo_bottom = o;
1937 o = edje_object_add(evas_object_evas_get(obj));
1961 evas_object_smart_member_add(o, obj); 1938 evas_object_smart_member_add(o, obj);
1962 sd->cur.selo3 = o; 1939 sd->cur.selo_theme = o;
1963 evas_object_color_set(o, 64, 64, 64, 64); 1940
1964
1965 o = edje_object_add(evas_object_evas_get(obj)); 1941 o = edje_object_add(evas_object_evas_get(obj));
1966 evas_object_pass_events_set(o, EINA_TRUE); 1942 evas_object_pass_events_set(o, EINA_TRUE);
1967 evas_object_propagate_events_set(o, EINA_FALSE); 1943 evas_object_propagate_events_set(o, EINA_FALSE);
@@ -1971,6 +1947,7 @@ _smart_add(Evas_Object *obj)
1971 evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE, _cursor_cb_move, obj); 1947 evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE, _cursor_cb_move, obj);
1972 1948
1973 o = evas_object_rectangle_add(evas_object_evas_get(obj)); 1949 o = evas_object_rectangle_add(evas_object_evas_get(obj));
1950 evas_object_repeat_events_set(o, EINA_TRUE);
1974 evas_object_smart_member_add(o, obj); 1951 evas_object_smart_member_add(o, obj);
1975 sd->event = o; 1952 sd->event = o;
1976 evas_object_color_set(o, 0, 0, 0, 0); 1953 evas_object_color_set(o, 0, 0, 0, 0);
@@ -2068,9 +2045,9 @@ _smart_del(Evas_Object *obj)
2068 } 2045 }
2069 if (sd->cur.obj) evas_object_del(sd->cur.obj); 2046 if (sd->cur.obj) evas_object_del(sd->cur.obj);
2070 if (sd->event) evas_object_del(sd->event); 2047 if (sd->event) evas_object_del(sd->event);
2071 if (sd->cur.selo1) evas_object_del(sd->cur.selo1); 2048 if (sd->cur.selo_top) evas_object_del(sd->cur.selo_top);
2072 if (sd->cur.selo2) evas_object_del(sd->cur.selo2); 2049 if (sd->cur.selo_bottom) evas_object_del(sd->cur.selo_bottom);
2073 if (sd->cur.selo3) evas_object_del(sd->cur.selo3); 2050 if (sd->cur.selo_theme) evas_object_del(sd->cur.selo_theme);
2074 if (sd->anim) ecore_animator_del(sd->anim); 2051 if (sd->anim) ecore_animator_del(sd->anim);
2075 if (sd->delayed_size_timer) ecore_timer_del(sd->delayed_size_timer); 2052 if (sd->delayed_size_timer) ecore_timer_del(sd->delayed_size_timer);
2076 if (sd->link_do_timer) ecore_timer_del(sd->link_do_timer); 2053 if (sd->link_do_timer) ecore_timer_del(sd->link_do_timer);
@@ -2082,9 +2059,9 @@ _smart_del(Evas_Object *obj)
2082 EINA_LIST_FREE(sd->seq, str) eina_stringshare_del(str); 2059 EINA_LIST_FREE(sd->seq, str) eina_stringshare_del(str);
2083 sd->cur.obj = NULL; 2060 sd->cur.obj = NULL;
2084 sd->event = NULL; 2061 sd->event = NULL;
2085 sd->cur.selo1 = NULL; 2062 sd->cur.selo_top = NULL;
2086 sd->cur.selo2 = NULL; 2063 sd->cur.selo_bottom = NULL;
2087 sd->cur.selo3 = NULL; 2064 sd->cur.selo_theme = NULL;
2088 sd->anim = NULL; 2065 sd->anim = NULL;
2089 sd->delayed_size_timer = NULL; 2066 sd->delayed_size_timer = NULL;
2090 sd->font.name = NULL; 2067 sd->font.name = NULL;