raster pushed a commit to branch master.

commit 87d585bd07fb76f535e1102bbd7c1240d0bccbba
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sat Apr 6 23:30:45 2013 +0900

    show overlay with number of open tabs - keep it faded out until you
    mouseover. click to bring up tab switcher. mouse controls on tab
    switcher work now... click to select. up & down arrow work too...
---
 data/themes/default.edc | 252 ++++++++++++++++++++++++++++++++++++++++++++++--
 src/bin/main.c          |  74 +++++++++++++-
 src/bin/sel.c           | 168 +++++++++++++++++++++++++++-----
 3 files changed, 455 insertions(+), 39 deletions(-)

diff --git a/data/themes/default.edc b/data/themes/default.edc
index 5f41a53..c28def1 100644
--- a/data/themes/default.edc
+++ b/data/themes/default.edc
@@ -93,6 +93,7 @@ collections {
         image: "pm_shadow.png" COMP;
         image: "pm_overlay.png" COMP;
         image: "pm_fill.png" COMP;
+        image: "cr_glow.png" COMP;
       }
       parts {
          ////////////////////////////////////////////////////////////////////
@@ -119,14 +120,6 @@ collections {
                visible: 0;
             }
          }
-         ////////////////////////////////////////////////////////////////////
-         // actual text grid for chars, cursors, selectiond etc. goes here
-         // and has a background layered behind it inside the swallowed
-         // child edje
-         part { name: "terminology.content"; type: SWALLOW;
-            description { state: "default" 0.0;
-            }
-         }
          program {
             signal: "translucent,on"; source: "terminology";
             action: STATE_SET "translucent" 0.0;
@@ -141,6 +134,248 @@ collections {
          }
          
          ////////////////////////////////////////////////////////////////////
+         // actual text grid for chars, cursors, selectiond etc. goes here
+         // and has a background layered behind it inside the swallowed
+         // child edje
+         part { name: "terminology.content"; type: SWALLOW;
+            description { state: "default" 0.0;
+            }
+         }
+         
+         ////////////////////////////////////////////////////////////////////
+         // indicator of other tabs and control
+         part { name: "tabcount_clip"; type: RECT;
+            description { state: "default" 0.0;
+               color: 255 255 255 0;
+               visible: 0;
+            }
+            description { state: "on" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+               color: 255 255 255 255;
+            }
+         }
+         part { name: "terminology.tabcount.label"; type: TEXT; mouse_events: 
0;
+            effect: GLOW;
+            scale: 1;
+            clip_to: "tabcount_clip";
+            description { state: "default" 0.0;
+               fixed: 1 1;
+               rel1.to: "terminology.tabcount.control";
+               rel2.to: "terminology.tabcount.control";
+               rel1.relative: -0.2 0.0;
+               rel2.relative: -0.2 1.0;
+               color: 51 153 255 64;
+               color2: 51 153 255 18;
+               color3: 51 153 255 8;
+               align: 1.0 0.5;
+               text { font: "Sans"; size: 8;
+                  align: 1.0 0.5;
+                  min: 1 1;
+               }
+            }
+            description { state: "over" 0.0;
+               inherit: "default" 0.0;
+               color: 255 255 255 255;
+               color2: 51 153 255 128;
+               color3: 51 153 255 20;
+            }
+         }
+         part { name: "tabcount_glow_r0";
+            clip_to: "tabcount_clip";
+            description { state: "default" 0.0;
+               rel1.to: "tabcount_r0";
+               rel2.to: "tabcount_r0";
+               rel1.offset: -4 -4;
+               rel2.offset: 3 3;
+               image {
+                  normal: "cr_glow.png";
+                  border: 9 9 9 9;
+               }
+               color: 51 153 255 32;
+            }
+            description { state: "over" 0.0;
+               inherit: "default" 0.0;
+               color: 51 153 255 255;
+            }
+         }
+         part { name: "tabcount_glow_r1";
+            clip_to: "tabcount_clip";
+            description { state: "default" 0.0;
+               rel1.to: "tabcount_r1";
+               rel2.to: "tabcount_r1";
+               rel1.offset: -4 -4;
+               rel2.offset: 3 3;
+               image {
+                  normal: "cr_glow.png";
+                  border: 9 9 9 9;
+               }
+               color: 51 153 255 32;
+            }
+            description { state: "over" 0.0;
+               inherit: "default" 0.0;
+               color: 51 153 255 255;
+            }
+         }
+         part { name: "tabcount_glow_r2";
+            clip_to: "tabcount_clip";
+            description { state: "default" 0.0;
+               rel1.to: "tabcount_r2";
+               rel2.to: "tabcount_r2";
+               rel1.offset: -4 -4;
+               rel2.offset: 3 3;
+               image {
+                  normal: "cr_glow.png";
+                  border: 9 9 9 9;
+               }
+               color: 51 153 255 32;
+            }
+            description { state: "over" 0.0;
+               inherit: "default" 0.0;
+               color: 51 153 255 255;
+            }
+         }
+         part { name: "tabcount_glow_r3";
+            clip_to: "tabcount_clip";
+            description { state: "default" 0.0;
+               rel1.to: "tabcount_r3";
+               rel2.to: "tabcount_r3";
+               rel1.offset: -4 -4;
+               rel2.offset: 3 3;
+               image {
+                  normal: "cr_glow.png";
+                  border: 9 9 9 9;
+               }
+               color: 51 153 255 32;
+            }
+            description { state: "over" 0.0;
+               inherit: "default" 0.0;
+               color: 51 153 255 255;
+            }
+         }
+         part { name: "tabcount_r0"; type: RECT;
+            clip_to: "tabcount_clip";
+            description { state: "default" 0.0;
+               rel1.to: "terminology.tabcount.control";
+               rel2.to: "terminology.tabcount.control";
+               rel1.relative: 0.05 0.05;
+               rel2.relative: 0.45 0.45;
+               color: 255 255 255 32;
+            }
+            description { state: "over" 0.0;
+               inherit: "default" 0.0;
+               color: 255 255 255 255;
+            }
+         }
+         part { name: "tabcount_r1"; type: RECT;
+            clip_to: "tabcount_clip";
+            description { state: "default" 0.0;
+               rel1.to: "terminology.tabcount.control";
+               rel2.to: "terminology.tabcount.control";
+               rel1.relative: 0.55 0.05;
+               rel2.relative: 0.95 0.45;
+               color: 255 255 255 32;
+            }
+            description { state: "over" 0.0;
+               inherit: "default" 0.0;
+               color: 255 255 255 255;
+            }
+         }
+         part { name: "tabcount_r2"; type: RECT;
+            clip_to: "tabcount_clip";
+            description { state: "default" 0.0;
+               rel1.to: "terminology.tabcount.control";
+               rel2.to: "terminology.tabcount.control";
+               rel1.relative: 0.05 0.55;
+               rel2.relative: 0.45 0.95;
+               color: 255 255 255 32;
+            }
+            description { state: "over" 0.0;
+               inherit: "default" 0.0;
+               color: 255 255 255 255;
+            }
+         }
+         part { name: "tabcount_r3"; type: RECT;
+            clip_to: "tabcount_clip";
+            description { state: "default" 0.0;
+               rel1.to: "terminology.tabcount.control";
+               rel2.to: "terminology.tabcount.control";
+               rel1.relative: 0.55 0.55;
+               rel2.relative: 0.95 0.95;
+               color: 255 255 255 32;
+            }
+            description { state: "over" 0.0;
+               inherit: "default" 0.0;
+               color: 255 255 255 255;
+            }
+         }
+         part { name: "terminology.tabcount.control"; type: SWALLOW;
+            clip_to: "tabcount_clip";
+            description { state: "default" 0.0;
+               fixed: 1 1;
+               rel1.relative: 1.0 0.0;
+               rel1.offset: -3 2;
+               rel2.relative: 1.0 0.0;
+               rel2.offset: -3 2;
+               align: 1.0 0.0;
+               min: 16 16;
+            }
+         }
+         part { name: "tabcount_ev"; type: RECT; repeat_events: 1;
+            clip_to: "tabcount_clip";
+            description { state: "default" 0.0;
+               fixed: 1 1;
+               rel1.to: "terminology.tabcount.control";
+               rel2.to: "terminology.tabcount.control";
+               color: 0 0 0 0;
+            }
+         }
+         program {
+            signal: "mouse,in"; source: "tabcount_ev";
+            action: STATE_SET "over" 0.0;
+            transition: DECELERATE 0.5;
+            target: "tabcount_r0";
+            target: "tabcount_r1";
+            target: "tabcount_r2";
+            target: "tabcount_r3";
+            target: "tabcount_glow_r0";
+            target: "tabcount_glow_r1";
+            target: "tabcount_glow_r2";
+            target: "tabcount_glow_r3";
+            target: "terminology.tabcount.label";
+         }
+         program {
+            signal: "mouse,out"; source: "tabcount_ev";
+            action: STATE_SET "default" 0.0;
+            transition: DECELERATE 2.0;
+            target: "tabcount_r0";
+            target: "tabcount_r1";
+            target: "tabcount_r2";
+            target: "tabcount_r3";
+            target: "tabcount_glow_r0";
+            target: "tabcount_glow_r1";
+            target: "tabcount_glow_r2";
+            target: "tabcount_glow_r3";
+            target: "terminology.tabcount.label";
+         }
+         program {
+            signal: "mouse,clicked,1"; source: "tabcount_ev";
+            action: SIGNAL_EMIT "tabcount,go" "terminology";
+         }
+         program {
+            signal: "tabcount,off"; source: "terminology";
+            action: STATE_SET "default" 0.0;
+            transition: DECELERATE 0.5;
+            target: "tabcount_clip";
+         }
+         program {
+            signal: "tabcount,on"; source: "terminology";
+            action: STATE_SET "on" 0.0;
+            transition: DECELERATE 0.5;
+            target: "tabcount_clip";
+         }
+
+         ////////////////////////////////////////////////////////////////////
          // overlayed prettiness
          part { name: "glow";
             mouse_events: 0;
@@ -170,7 +405,6 @@ collections {
             }
          }
          part { name: "glintclip"; type: RECT;
-            mouse_events: 1;
             description { state: "default" 0.0;
             }
          }
diff --git a/src/bin/main.c b/src/bin/main.c
index 056d7cc..1328241 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -53,6 +53,7 @@ struct _Term
    Evas_Object *media;
    Evas_Object *popmedia;
    Evas_Object *sel;
+   Evas_Object *tabcount_spacer;
    Eina_List   *popmedia_queue;
    int          poptype, mediatype;
    int          step_x, step_y, min_w, min_h, req_w, req_h;
@@ -102,6 +103,37 @@ _split_free(Split *sp)
    free(sp);
 }
 
+static void
+_split_tabcount_update(Split *sp)
+{
+   char buf[32];
+   int n = eina_list_count(sp->terms);
+   Eina_List *l;
+   Term *term;
+   
+   snprintf(buf, sizeof(buf), "%i", n);
+   EINA_LIST_FOREACH(sp->terms, l, term)
+     {
+        Evas_Coord w = 0, h = 0;
+             
+        if (!term->tabcount_spacer)
+          {
+             term->tabcount_spacer = 
evas_object_rectangle_add(evas_object_evas_get(term->bg));
+             evas_object_color_set(term->tabcount_spacer, 0, 0, 0, 0);
+          }
+        elm_coords_finger_size_adjust(1, &w, 1, &h);
+        evas_object_size_hint_min_set(term->tabcount_spacer, w, h);
+        edje_object_part_swallow(term->bg, "terminology.tabcount.control", 
term->tabcount_spacer);
+        if (n > 1)
+          {
+             edje_object_part_text_set(term->bg, "terminology.tabcount.label", 
buf);
+             edje_object_signal_emit(term->bg, "tabcount,on", "terminology");
+          }
+        else
+          edje_object_signal_emit(term->bg, "tabcount,off", "terminology");
+     }
+}
+
 static Split *
 _split_split_find(Split *sp, Evas_Object *term)
 {
@@ -204,6 +236,7 @@ _split_split(Split *sp, Eina_Bool horizontal)
    
    if (!sp->parent) edje_object_part_unswallow(sp->wn->base, sp->term->bg);
    main_term_bg_redo(sp2->term);
+   _split_tabcount_update(sp2);
    
    sp2 = sp->s2 = calloc(1, sizeof(Split));
    sp2->parent = sp;
@@ -216,6 +249,7 @@ _split_split(Split *sp, Eina_Bool horizontal)
    _term_resize_track_start(sp2);
    _term_focus(sp2->term);
    _term_media_update(sp2->term, config);
+   _split_tabcount_update(sp2);
    evas_object_data_set(sp2->term->term, "sizedone", sp2->term->term);
    elm_object_part_content_set(sp->panes, PANES_TOP, sp->s1->term->bg);
    elm_object_part_content_set(sp->panes, PANES_BOTTOM, sp->s2->term->bg);
@@ -291,6 +325,7 @@ main_new(Evas_Object *win, Evas_Object *term)
    _term_media_update(sp->term, config);
    evas_object_data_set(sp->term->term, "sizedone", sp->term->term);
    _term_focus_show(sp, sp->term);
+   _split_tabcount_update(sp);
 }
 
 void
@@ -426,6 +461,7 @@ _split_merge(Split *spp, Split *sp, const char *slot)
           }
         else
           edje_object_part_swallow(spp->wn->base, "terminology.content", o);
+        _split_tabcount_update(sp);
      }
    else
      {
@@ -569,6 +605,7 @@ main_close(Evas_Object *win, Evas_Object *term)
           }
         if (!sp->wn->terms) evas_object_del(sp->wn->win);
      }
+   _split_tabcount_update(sp);
 }
 
 static Term *
@@ -1212,6 +1249,16 @@ _sel_go(Split *sp, Term *term)
 }
 
 static void
+_cb_tabcount_go(void *data, Evas_Object *obj __UNUSED__, const char *sig 
__UNUSED__, const char *src __UNUSED__)
+{
+   Term *term = data;
+   Split *sp;
+   
+   sp = _split_find(term->wn->win, term->term);
+   _sel_go(sp, term);
+}
+
+static void
 _cb_prev(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
 {
    Term *term = data;
@@ -1792,6 +1839,11 @@ main_term_free(Term *term)
    term->base = NULL;
    evas_object_del(term->bg);
    term->bg = NULL;
+   if (term->tabcount_spacer)
+     {
+        evas_object_del(term->tabcount_spacer);
+        term->tabcount_spacer = NULL;
+     }
    if (term->config) config_del(term->config);
    term->config = NULL;
    free(term);
@@ -1802,6 +1854,11 @@ main_term_bg_redo(Term *term)
 {
    Evas_Object *o;
 
+   if (term->tabcount_spacer)
+     {
+        evas_object_del(term->tabcount_spacer);
+        term->tabcount_spacer = NULL;
+     }
    evas_object_del(term->base);
    evas_object_del(term->bg);
    
@@ -1830,9 +1887,11 @@ main_term_bg_redo(Term *term)
         edje_object_signal_emit(term->base, "translucent,off", "terminology");
      }
    
-   edje_object_signal_callback_add(term->bg, "popmedia,done", "terminology",
-                                   _cb_popmedia_done, term);
    termio_theme_set(term->term, term->bg);
+   edje_object_signal_callback_add(term->bg, "popmedia,done", "terminology",
+                                   _cb_popmedia_done, term); 
+   edje_object_signal_callback_add(term->bg, "tabcount,go", "terminology",
+                                   _cb_tabcount_go, term);
    edje_object_part_swallow(term->base, "terminology.content", term->term);
    edje_object_part_swallow(term->bg, "terminology.content", term->base);
    if (term->popmedia)
@@ -1932,15 +1991,18 @@ main_term_new(Win *wn, Config *config, const char *cmd,
         edje_object_signal_emit(term->base, "translucent,off", "terminology");
      }
    
-   edje_object_signal_callback_add(term->bg, "popmedia,done", "terminology",
-                                   _cb_popmedia_done, term);
-
    term->term = o = termio_add(wn->win, config, cmd, login_shell, cd,
                                size_w, size_h);
    colors_term_init(termio_textgrid_get(term->term), term->bg);
 
    termio_win_set(o, wn->win);
    termio_theme_set(o, term->bg);
+   
+   edje_object_signal_callback_add(term->bg, "popmedia,done", "terminology",
+                                   _cb_popmedia_done, term);
+   edje_object_signal_callback_add(term->bg, "tabcount,go", "terminology",
+                                   _cb_tabcount_go, term);
+
    evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
@@ -2232,6 +2294,7 @@ main_ipc_new(Ipc_Instance *inst)
    sp->term = term;
    sp->terms = eina_list_append(sp->terms, sp->term);
    _term_resize_track_start(sp);
+   _split_tabcount_update(sp);
    
    main_trans_update(config);
    main_media_update(config);
@@ -2707,6 +2770,7 @@ remote:
    sp->term = term;
    sp->terms = eina_list_append(sp->terms, sp->term);
    _term_resize_track_start(sp);
+   _split_tabcount_update(sp);
    
    main_trans_update(config);
    main_media_update(config);
diff --git a/src/bin/sel.c b/src/bin/sel.c
index f926a57..50cff2a 100644
--- a/src/bin/sel.c
+++ b/src/bin/sel.c
@@ -35,6 +35,7 @@ struct _Sel
    Eina_Bool exit_on_sel : 1;
    Eina_Bool exit_now : 1;
    Eina_Bool pending_sel : 1;
+   Eina_Bool use_px : 1;
 };
 
 struct _Entry
@@ -50,7 +51,7 @@ static Evas_Smart *_smart = NULL;
 static Evas_Smart_Class _parent_sc = EVAS_SMART_CLASS_INIT_NULL;
 
 static void _smart_calculate(Evas_Object *obj);
-
+static void _transit(Evas_Object *obj, double tim);
 
 static void
 _mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, 
void *event)
@@ -80,7 +81,66 @@ _mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object 
*obj __UNUSED__, void *
    dy = abs(ev->canvas.y - sd->down.y);
    if ((dx <= elm_config_finger_size_get()) &&
        (dy <= elm_config_finger_size_get()))
-     evas_object_smart_callback_call(data, "clicked", NULL);
+     {
+        Eina_List *l;
+        Entry *en;
+        Evas_Coord x, y, ox, oy, ow, oh;
+        
+        x = ev->canvas.x;
+        y = ev->canvas.y;
+        EINA_LIST_FOREACH(sd->items, l, en)
+          {
+             evas_object_geometry_get(en->bg, &ox, &oy, &ow, &oh);
+             if (ELM_RECTS_INTERSECT(ox, oy, ow, oh, x, y, 1, 1))
+               {
+                  sel_entry_selected_set(data, en->obj, EINA_FALSE);
+                  sd->select_me = EINA_TRUE;
+                  sd->exit_me = EINA_FALSE;
+                  if (sd->autozoom_timeout)
+                    {
+                       ecore_timer_del(sd->autozoom_timeout);
+                       sd->autozoom_timeout = NULL;
+                    }
+                  evas_object_smart_callback_call(data, "ending", NULL);
+                  sel_zoom(data, 1.0);
+                  return;
+               }
+          }
+        evas_object_smart_callback_call(data, "clicked", NULL);
+     }
+}
+
+static void
+_mouse_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, 
void *event)
+{
+   Evas_Event_Mouse_Move *ev = event;
+   Sel *sd = evas_object_smart_data_get(data);
+   if (!sd) return;
+   Evas_Coord x = 0, y = 0, w = 0, h = 0, sw, sh;
+   int iw, ih;
+   
+   if ((sd->exit_me) || (sd->exit_now) || (sd->select_me)) return;
+   iw = sqrt(eina_list_count(sd->items));
+   if (iw < 1) iw = 1;
+   ih = (eina_list_count(sd->items) + (iw - 1)) / iw;
+   if (ih < 1) ih = 1;
+   evas_object_geometry_get(data, &x, &y, &w, &h);
+   sw = w * sd->zoom;
+   sh = h * sd->zoom;
+   if (!sd->down.down)
+     {
+        if ((w > 0) && (h > 0))
+          {
+             _transit(data, 0.5);
+             sd->px1 = ((ev->cur.canvas.x - x) * ((iw - 1) * sw)) / w;
+             sd->py1 = ((ev->cur.canvas.y - y) * ((ih - 1) * sh)) / h;
+             sd->use_px = EINA_TRUE;
+          }
+     }
+   else
+     {
+        // XXX: drag to scroll
+     }
 }
 
 static Eina_Bool
@@ -152,6 +212,58 @@ _key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object 
*obj __UNUSED__, void *
         sd->exit_now = EINA_FALSE;
         _autozoom(data);
      }
+   else if (!strcmp(ev->keyname, "Up"))
+     {
+        EINA_LIST_FOREACH(sd->items, l, en)
+          {
+             if (en->selected)
+               {
+                  Evas_Coord x = 0, y = 0, w = 0, h = 0, sgx, sgy;
+                  
+                  evas_object_geometry_get(en->bg, &x, &y, &w, &h);
+                  sgx = x + (w / 2);
+                  sgy = y - (h / 2);
+                  EINA_LIST_FOREACH(sd->items, l, en)
+                    {
+                       evas_object_geometry_get(en->bg, &x, &y, &w, &h);
+                       if (ELM_RECTS_INTERSECT(x, y, w, h, sgx, sgy, 1, 1))
+                         {
+                            sel_entry_selected_set(obj, en->obj, EINA_FALSE);
+                            break;
+                         }
+                    }
+                  break;
+               }
+          }
+        sd->exit_now = EINA_FALSE;
+        _autozoom(data);
+     }
+   else if (!strcmp(ev->keyname, "Down"))
+     {
+        EINA_LIST_FOREACH(sd->items, l, en)
+          {
+             if (en->selected)
+               {
+                  Evas_Coord x = 0, y = 0, w = 0, h = 0, sgx, sgy;
+                  
+                  evas_object_geometry_get(en->bg, &x, &y, &w, &h);
+                  sgx = x + (w / 2);
+                  sgy = y + h + (h / 2);
+                  EINA_LIST_FOREACH(sd->items, l, en)
+                    {
+                       evas_object_geometry_get(en->bg, &x, &y, &w, &h);
+                       if (ELM_RECTS_INTERSECT(x, y, w, h, sgx, sgy, 1, 1))
+                         {
+                            sel_entry_selected_set(obj, en->obj, EINA_FALSE);
+                            break;
+                         }
+                    }
+                  break;
+               }
+          }
+        sd->exit_now = EINA_FALSE;
+        _autozoom(data);
+     }
    else if ((!strcmp(ev->keyname, "Return")) ||
             (!strcmp(ev->keyname, "KP_Enter")) ||
             (!strcmp(ev->keyname, "space")))
@@ -185,7 +297,6 @@ _key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object 
*obj __UNUSED__, void *
         evas_object_smart_callback_call(data, "ending", NULL);
         sel_zoom(data, 1.0);
      }
-   // XXX: handle up/down
 }
 
 static void
@@ -205,34 +316,37 @@ _layout(Evas_Object *obj)
    w = ow * sd->zoom;
    h = oh * sd->zoom;
    x = y = 0;
-   EINA_LIST_FOREACH(sd->items, l, en)
+   if (!sd->use_px)
      {
-        if (en->selected_before)
-          {
-             sd->px0 = (x * w);
-             sd->py0 = (y * h);
-          }
-        if ((sd->exit_on_sel) && (!sd->exit_now))
+        EINA_LIST_FOREACH(sd->items, l, en)
           {
              if (en->selected_before)
                {
-                  sd->px1 = (x * w);
-                  sd->py1 = (y * h);
+                  sd->px0 = (x * w);
+                  sd->py0 = (y * h);
                }
-          }
-        else
-          {
-             if (en->selected)
+             if ((sd->exit_on_sel) && (!sd->exit_now))
                {
-                  sd->px1 = (x * w);
-                  sd->py1 = (y * h);
+                  if (en->selected_before)
+                    {
+                       sd->px1 = (x * w);
+                       sd->py1 = (y * h);
+                    }
+               }
+             else
+               {
+                  if (en->selected)
+                    {
+                       sd->px1 = (x * w);
+                       sd->py1 = (y * h);
+                    }
+               }
+             x++;
+             if (x >= iw)
+               {
+                  x = 0;
+                  y++;
                }
-          }
-        x++;
-        if (x >= iw)
-          {
-             x = 0;
-             y++;
           }
      }
 
@@ -462,7 +576,6 @@ _smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
    evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
    if ((ow == w) && (oh == h)) return;
    evas_object_smart_changed(obj);
-   evas_object_resize(sd->clip, ow, oh);
 }
 
 static void
@@ -477,6 +590,8 @@ _smart_calculate(Evas_Object *obj)
    sd->h = oh;
    evas_object_move(sd->clip, ox, oy);
    evas_object_resize(sd->clip, ow, oh);
+   evas_object_move(sd->o_event, ox, oy);
+   evas_object_resize(sd->o_event, ow, oh);
    _layout(obj);
 }
 
@@ -530,6 +645,8 @@ sel_add(Evas_Object *parent)
                                   _mouse_down_cb, obj);
    evas_object_event_callback_add(sd->o_event, EVAS_CALLBACK_MOUSE_UP,
                                   _mouse_up_cb, obj);
+   evas_object_event_callback_add(sd->o_event, EVAS_CALLBACK_MOUSE_MOVE,
+                                  _mouse_move_cb, obj);
    evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN,
                                   _key_down_cb, obj);
    sd->zoom = 1.0;
@@ -634,6 +751,7 @@ sel_entry_selected_set(Evas_Object *obj, Evas_Object 
*entry, Eina_Bool keep_befo
           }
         if (!keep_before) en->selected_before = EINA_FALSE;
      }
+   sd->use_px = EINA_FALSE;
    _transit(obj, 0.5);
 }
 

-- 

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html

Reply via email to