Re: [E-devel] e_menu Keyboard Navigation using First Characters

2006-10-01 Thread Metrics
Small change in the last patch I sent. To finalise this ongoing thread,
the e_menu_prev_next.patch and then menu_keys.patch, both of which are
attached.

metrics

Index: src/bin/e_menu.c
===
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_menu.c,v
retrieving revision 1.68
diff -u -r1.68 e_menu.c
--- src/bin/e_menu.c9 Sep 2006 07:00:14 -   1.68
+++ src/bin/e_menu.c27 Sep 2006 04:14:31 -
@@ -60,6 +60,7 @@
 static void _e_menu_activate_nth  (int n);
 static E_Menu *_e_menu_active_get (void);
 static E_Menu_Item *_e_menu_item_active_get   (void);
+static Evas_List * _e_menu_list_item_active_get   (void);
 static int  _e_menu_outside_bounds_get(int xdir, int ydir);
 static void _e_menu_scroll_by (int dx, int dy);
 static void _e_menu_mouse_autoscroll_check(void);
@@ -521,6 +522,7 @@
mi = E_OBJECT_ALLOC(E_Menu_Item, E_MENU_ITEM_TYPE, _e_menu_item_free);
mi-menu = m;
mi-menu-items = evas_list_append(mi-menu-items, mi);
+   mi-list_position = evas_list_last(mi-menu-items);
return mi;
 }
 
@@ -1926,118 +1928,68 @@
 static void
 _e_menu_item_activate_next(void)
 {
-   E_Menu *m;
+   E_Menu_Item *mi;
+   Evas_List *ll;
 
-   /* FIXME: inefficient. should track active item */
-   m = _e_menu_active_get();
-   if (m)
+   ll = _e_menu_list_item_active_get();
+   mi = _e_menu_item_active_get();
+   if (ll  mi) 
  {
-   Evas_List *ll;
-   
-   for (ll = m-items; ll; ll = ll-next)
- {
-E_Menu_Item *mi;
-
+   /* Look at the next item and then cycle until we're not on
+* a separator. */
+   if (!(ll-next)) 
+ ll = mi-menu-items;
+   else
+  ll = ll-next;
+   mi = ll-data;
+   while (mi-separator)
+ { 
+if (!(ll-next)) 
+  ll = mi-menu-items;
+else
+  ll = ll-next;
 mi = ll-data;
-if (mi-active) 
-  {
- if (ll-next)
-   {
-  ll = ll-next;
-  mi = ll-data;
-  while ((mi-separator)  (ll-next))
-{
-   ll = ll-next;
-   mi = ll-data;
-}
-  if ((mi-separator)  (!ll-next))
-{
-   ll = m-items;
-   mi = ll-data;
-   while ((mi-separator)  (ll-next))
- {
-ll = ll-next;
-mi = ll-data;
- }
-}
-  e_menu_item_active_set(mi, 1);
-  _e_menu_item_ensure_onscreen(mi);
-   }
- else
-   {
-  ll = m-items;
-  mi = ll-data;
-  while ((mi-separator)  (ll-next))
-{
-   ll = ll-next;
-   mi = ll-data;
-}
-  e_menu_item_active_set(mi, 1);
-  _e_menu_item_ensure_onscreen(mi);
-   }
- return;
-  }
  }
+
+   e_menu_item_active_set(mi, 1);
+   _e_menu_item_ensure_onscreen(mi);
+   return;
  }
+
_e_menu_activate_first();
 }
 
 static void
 _e_menu_item_activate_previous(void)
 {
-   E_Menu *m;
+   E_Menu_Item *mi;
+   Evas_List *ll;
 
-   /* FIXME: inefficient. should track active item */
-   m = _e_menu_active_get();
-   if (m)
+   ll = _e_menu_list_item_active_get();
+   mi = _e_menu_item_active_get();
+   if (ll  mi) 
  {
-   Evas_List *ll;
-   
-   for (ll = m-items; ll; ll = ll-next)
- {
-E_Menu_Item *mi;
-
+   /* Look at the prev item and then cycle until we're not on
+* a separator. */
+   if (!(ll-prev)) 
+ ll = evas_list_last(ll);
+   else
+  ll = ll-prev;
+   mi = ll-data;
+   while (mi-separator)
+ { 
+if (!(ll-prev)) 
+  ll = evas_list_last(ll);
+else
+  ll = ll-prev;
 mi = ll-data;
-if (mi-active) 
-  {
- if (ll-prev)
-   {
-  ll = ll-prev;
-  mi = ll-data;
-  while ((mi-separator)  (ll-prev))
-{
-   ll = ll-prev;
-   mi = ll-data;
-}
-  if ((mi-separator)  (!ll-prev))
-{
-   ll = m-items;
-   mi = ll-data;
-   while 

[E-devel] [PATCH] Theme Config Dialog Box

2006-10-01 Thread Metrics
The attached patch provides some sort of solution for the problem where
you delete the currently active theme in the theme config dialog box.
This is obviously a dumb thing to do, but can result in lots of screen
corruption where you can't actually pick a new theme. The patch simply
activates the next theme possible in the list.

Its not pretty because to activate another theme a restart is required,
but its neater than display corruption.

Another option would be to put in some form of pre-delete callback to
stop the deletion happening in the first place.

metrics
Index: src/bin/e_int_config_theme.c
===
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_int_config_theme.c,v
retrieving revision 1.39
diff -u -r1.39 e_int_config_theme.c
--- src/bin/e_int_config_theme.c24 Sep 2006 00:48:14 -  1.39
+++ src/bin/e_int_config_theme.c1 Oct 2006 13:43:47 -
@@ -229,10 +229,18 @@
E_Config_Dialog_Data *cfdata;
Evas_List *sel, *all, *n;
E_Fm2_Icon_Info *ici, *ic;
+   E_Config_Theme *ctheme;
+   E_Action *a;
+   int active_theme_deleted = 0;

cfdata = data;
if (!cfdata-theme) return;
if (!cfdata-o_fm) return;
+   ctheme = e_theme_config_get(theme);
+   if (ctheme  ctheme-file  cfdata-theme 
+!strcmp(ctheme-file, cfdata-theme))
+ active_theme_deleted = 1;
+ 
 
all = e_fm2_all_list_get(cfdata-o_fm);
if (!all) return;
@@ -258,6 +266,17 @@
evas_list_free(n);

evas_object_smart_callback_call(cfdata-o_fm, selection_change, cfdata);
+
+   /* Check if the theme we just deleted is the current theme. */
+   if (active_theme_deleted  cfdata-theme)
+ {
+   /* Actually take our cfdata settings and apply them in real life */
+   e_theme_config_set(theme, cfdata-theme);
+   e_config_save_queue();
+
+   a = e_action_find(restart);
+   if ((a)  (a-func.go)) a-func.go(NULL, NULL);
+ }
 }
 
 static void
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Enlightenment CVS committal

2006-10-01 Thread [EMAIL PROTECTED]

 Author  : raster
 Project : e17
 Module  : libs/evas
 
 Dir : e17/libs/evas/src/modules/loaders/eet

 Modified Files:  evas_image_load_eet.c 
 
 Log Message:
 
 fix eet load of premul images - need to check they are not bad :)
 

Ummm... How about adding a 'premul' flag to eet images, which
would be set/read accordingly...

   jose.



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel