Enlightenment CVS committal

Author  : devilhorns
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_config.c e_int_shelf_config.c e_shelf.c 


Log Message:
Small patch from morlenxus to provide option that will allow an auto-hide
shelf to "unhide" via mouse_in or mouse_click.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.244
retrieving revision 1.245
diff -u -3 -r1.244 -r1.245
--- e_config.c  29 May 2007 11:25:53 -0000      1.244
+++ e_config.c  10 Jun 2007 11:01:41 -0000      1.245
@@ -126,6 +126,7 @@
    E_CONFIG_VAL(D, T, size, INT);
    E_CONFIG_VAL(D, T, overlap, INT);
    E_CONFIG_VAL(D, T, autohide, INT);
+   E_CONFIG_VAL(D, T, autohide_show_action, INT);
    E_CONFIG_VAL(D, T, hide_timeout, FLOAT);
    E_CONFIG_VAL(D, T, hide_duration, FLOAT);
    
@@ -1173,7 +1174,7 @@
      {
        E_Config_Shelf *cf_es;
        
-#define CFG_SHELF(_name, _con, _zone, _pop, _lay, _orient, _fita, _fits, 
_style, _size, _overlap, _autohide, _hide_timeout, _hide_duration) \
+#define CFG_SHELF(_name, _con, _zone, _pop, _lay, _orient, _fita, _fits, 
_style, _size, _overlap, _autohide, _autohide_show_action, _hide_timeout, 
_hide_duration) \
    cf_es = E_NEW(E_Config_Shelf, 1); \
    cf_es->name = evas_stringshare_add(_name); \
    cf_es->container = _con; \
@@ -1187,32 +1188,33 @@
    cf_es->size = _size; \
    cf_es->overlap = _overlap; \
    cf_es->autohide = _autohide; \
+   cf_es->autohide_show_action = _autohide_show_action; \
    cf_es->hide_timeout = _hide_timeout; \
    cf_es->hide_duration = _hide_duration; \
    e_config->shelves = evas_list_append(e_config->shelves, cf_es)
        /* shelves for 4 zones on head 0 by default */
        CFG_SHELF("shelf", 0, 0,
                  1, 200, E_GADCON_ORIENT_BOTTOM,
-                 1, 0, "default", 40, 0, 0, 1.0, 1.0);
+                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
        CFG_SHELF("shelf", 0, 1,
                  1, 200, E_GADCON_ORIENT_BOTTOM,
-                 1, 0, "default", 40, 0, 0, 1.0, 1.0);
+                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
        CFG_SHELF("shelf", 0, 2,
                  1, 200, E_GADCON_ORIENT_BOTTOM,
-                 1, 0, "default", 40, 0, 0, 1.0, 1.0);
+                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
        CFG_SHELF("shelf", 0, 3,
                  1, 200, E_GADCON_ORIENT_BOTTOM,
-                 1, 0, "default", 40, 0, 0, 1.0, 1.0);
+                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
        /* shelves for heada 1, 2, and 3 by default */
        CFG_SHELF("shelf", 1, 0,
                  1, 200, E_GADCON_ORIENT_BOTTOM,
-                 1, 0, "default", 40, 0, 0, 1.0, 1.0);
+                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
        CFG_SHELF("shelf", 2, 0,
                  1, 200, E_GADCON_ORIENT_BOTTOM,
-                 1, 0, "default", 40, 0, 0, 1.0, 1.0);
+                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
        CFG_SHELF("shelf", 3, 0,
                  1, 200, E_GADCON_ORIENT_BOTTOM,
-                 1, 0, "default", 40, 0, 0, 1.0, 1.0);
+                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
      }
    IFCFGEND;
    
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_shelf_config.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- e_int_shelf_config.c        23 Apr 2007 17:21:38 -0000      1.28
+++ e_int_shelf_config.c        10 Jun 2007 11:01:41 -0000      1.29
@@ -36,6 +36,7 @@
    int layering;
    int overlapping;
    int autohiding;
+   int autohiding_show_action;
    double hide_timeout;
    double hide_duration;
 };
@@ -119,6 +120,7 @@
    cfdata->size = cfdata->escfg->size;
    cfdata->overlapping = cfdata->escfg->overlap;
    cfdata->autohiding = cfdata->escfg->autohide;
+   cfdata->autohiding_show_action = cfdata->escfg->autohide_show_action;
    cfdata->hide_timeout = cfdata->escfg->hide_timeout;
    cfdata->hide_duration = cfdata->escfg->hide_duration;
    if (cfdata->size <= 24)
@@ -344,6 +346,7 @@
    cfdata->escfg->overlap = cfdata->overlapping;
 
    cfdata->escfg->autohide = cfdata->autohiding;
+   cfdata->escfg->autohide_show_action = cfdata->autohiding_show_action;
    cfdata->escfg->hide_timeout = cfdata->hide_timeout;
    cfdata->escfg->hide_duration = cfdata->hide_duration;
    if (cfdata->escfg->autohide && !cfdata->es->hidden)
@@ -493,6 +496,11 @@
    
    of = e_widget_framelist_add(evas, _("Autohide"), 0);
    ob = e_widget_check_add(evas, _("Auto-hide the shelf"), 
&(cfdata->autohiding));
+   e_widget_framelist_object_append(of, ob);
+   rg = e_widget_radio_group_new(&(cfdata->autohiding_show_action));
+   ob = e_widget_radio_add(evas, _("Show on mouse in"), 0, rg);
+   e_widget_framelist_object_append(of, ob);
+   ob = e_widget_radio_add(evas, _("Show on mouse click"), 1, rg);
    e_widget_framelist_object_append(of, ob);
    ob = e_widget_label_add(evas, _("Hide timeout"));
    e_widget_framelist_object_append(of, ob);
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_shelf.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -3 -r1.67 -r1.68
--- e_shelf.c   10 May 2007 08:49:14 -0000      1.67
+++ e_shelf.c   10 Jun 2007 11:01:41 -0000      1.68
@@ -179,17 +179,15 @@
    snprintf(buf, sizeof(buf), "%i", es->id);
    es->gadcon = e_gadcon_swallowed_new(es->name, buf, es->o_base, 
"e.swallow.content");
    e_gadcon_min_size_request_callback_set(es->gadcon,
-                                         _e_shelf_gadcon_min_size_request,
-                                         es);
+                                         _e_shelf_gadcon_min_size_request, es);
 
    e_gadcon_size_request_callback_set(es->gadcon,
-                                     _e_shelf_gadcon_size_request,
-                                     es);
+                                     _e_shelf_gadcon_size_request, es);
    e_gadcon_frame_request_callback_set(es->gadcon,
-                                      _e_shelf_gadcon_frame_request,
-                                      es);
+                                      _e_shelf_gadcon_frame_request, es);
    e_gadcon_orient(es->gadcon, E_GADCON_ORIENT_TOP);
-   snprintf(buf, sizeof(buf), "e,state,orientation,%s", 
_e_shelf_orient_string_get(es));
+   snprintf(buf, sizeof(buf), "e,state,orientation,%s", 
+           _e_shelf_orient_string_get(es));
    edje_object_signal_emit(es->o_base, buf, "e");
    edje_object_message_signal_process(es->o_base);
    e_gadcon_zone_set(es->gadcon, zone);
@@ -203,8 +201,7 @@
    else
      e_gadcon_dnd_window_set(es->gadcon, zone->container->event_win);
    e_gadcon_util_menu_attach_func_set(es->gadcon,
-                                     _e_shelf_cb_menu_items_append,
-                                     es);
+                                     _e_shelf_cb_menu_items_append, es);
    
    shelves = evas_list_append(shelves, es);
    shelves = evas_list_sort(shelves, -1, _e_shelf_cb_id_sort);
@@ -1143,18 +1140,21 @@
 {
    Evas_Event_Mouse_Down *ev;
    E_Shelf *es;
+   E_Menu *mn;
+   int cx, cy, cw, ch;
    
    es = data;
    ev = event_info;
-   if (ev->button == 3)
+   switch (ev->button)
      {
-        E_Menu *mn;
-       int cx, cy, cw, ch;
-       
+      case 1:
+       if (es->cfg->autohide_show_action) e_shelf_toggle (es, 1);
+       break;
+      case 3:
        mn = e_menu_new();
        e_menu_post_deactivate_callback_set(mn, _e_shelf_cb_menu_post, es);
        es->menu = mn;
-
+       
        _e_shelf_menu_append(es, mn);
        
        e_gadcon_canvas_zone_geometry_get(es->gadcon, &cx, &cy, &cw, &ch);
@@ -1162,8 +1162,8 @@
                              e_util_zone_current_get(e_manager_current_get()),
                              cx + ev->output.x, cy + ev->output.y, 1, 1,
                              E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
-       e_util_evas_fake_mouse_up_later(es->gadcon->evas, 
-                                       ev->button);
+       e_util_evas_fake_mouse_up_later(es->gadcon->evas, ev->button);
+       break;
      }
 }
 
@@ -1174,7 +1174,7 @@
 
    es = data;
    edje_object_signal_emit(es->o_base, "e,state,focused", "e");
-   e_shelf_toggle(es, 1);
+   if (!es->cfg->autohide_show_action) e_shelf_toggle (es, 1);
 }
 
 static void 



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to