This patch allows to show a hidden shelf on mouse click instead of mouse
over. You can select the mode with radio buttons.

Greets,
Brian 'morlenxus' Miculcy
? e_utils.patch
? shelf.patch
Index: e_config.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.244
diff -u -r1.244 e_config.c
--- e_config.c  29 May 2007 11:25:53 -0000      1.244
+++ e_config.c  30 May 2007 13:15:34 -0000
@@ -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;
    
Index: e_config.h
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.156
diff -u -r1.156 e_config.h
--- e_config.h  29 May 2007 11:25:53 -0000      1.156
+++ e_config.h  30 May 2007 13:15:34 -0000
@@ -54,7 +54,7 @@
 /* increment this whenever a new set of config values are added but the users
  * config doesn't need to be wiped - simply new values need to be put in
  */
-#define E_CONFIG_FILE_GENERATION 0x0118
+#define E_CONFIG_FILE_GENERATION 0x0119
 #define E_CONFIG_FILE_VERSION    ((E_CONFIG_FILE_EPOCH << 16) | 
E_CONFIG_FILE_GENERATION)
 
 #define E_EVAS_ENGINE_DEFAULT      0
@@ -407,6 +407,7 @@
    int           size;
    int           overlap;
    int          autohide;
+   int          autohide_show_action;
    float        hide_timeout;
    float        hide_duration;
 };
Index: e_int_shelf_config.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_int_shelf_config.c,v
retrieving revision 1.28
diff -u -r1.28 e_int_shelf_config.c
--- e_int_shelf_config.c        23 Apr 2007 17:21:38 -0000      1.28
+++ e_int_shelf_config.c        30 May 2007 13:15:34 -0000
@@ -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)
@@ -494,6 +497,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);
    ob = e_widget_slider_add(evas, 1, 0, _("%.1f seconds"), 0.2, 6.0, 0.2, 0, 
&(cfdata->hide_timeout), NULL, 100);
Index: e_shelf.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_shelf.c,v
retrieving revision 1.67
diff -u -r1.67 e_shelf.c
--- e_shelf.c   10 May 2007 08:49:14 -0000      1.67
+++ e_shelf.c   30 May 2007 13:15:34 -0000
@@ -1143,28 +1143,32 @@
 {
    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;
-       
-       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);
-       e_menu_activate_mouse(mn,
-                             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);
-     }
+      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);
+         e_menu_activate_mouse(mn,
+                                                                  
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);
+         break;
+      }
 }
 
 static void
@@ -1174,7 +1178,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-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to