when going back to categories list, scroll to the category we were just in

get rid of some warnings


SVN revision: 30269
devs/princeamd/enlightenment-0.17-elive
rephorm 16 years ago committed by rephorm
parent a7bbf46762
commit aa355036c4
  1. 20
      src/bin/e_ilist.c
  2. 1
      src/bin/e_ilist.h
  3. 4
      src/bin/e_int_config_apps.c
  4. 4
      src/bin/e_widget_framelist.c
  5. 4
      src/bin/e_widget_framelist.h
  6. 20
      src/bin/e_widget_ilist.c
  7. 1
      src/bin/e_widget_ilist.h

@ -1,3 +1,6 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
#define SMART_NAME "e_ilist"
@ -403,6 +406,23 @@ e_ilist_nth_is_header(Evas_Object *obj, int n)
return 0;
}
EAPI void
e_ilist_nth_geometry_get(Evas_Object *obj, int n, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{
E_Ilist_Item *si;
int error;
API_ENTRY return;
if (!sd->items) return;
si = evas_list_nth(sd->items, n);
if (!si) return;
evas_object_geometry_get(si->o_base, x, y, w, h);
*x -= sd->x;
*y -= sd->y;
}
EAPI void
e_ilist_icon_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
{

@ -44,6 +44,7 @@ EAPI void e_ilist_nth_label_set (Evas_Object *obj, int n, const
EAPI Evas_Object *e_ilist_nth_icon_get (Evas_Object *obj, int n);
EAPI void e_ilist_nth_icon_set (Evas_Object *obj, int n, Evas_Object *icon);
EAPI int e_ilist_nth_is_header (Evas_Object *obj, int n);
EAPI void e_ilist_nth_geometry_get (Evas_Object *obj, int n, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
EAPI void e_ilist_icon_size_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h);
EAPI Evas_List *e_ilist_items_get (Evas_Object *obj);
EAPI void e_ilist_multi_select (Evas_Object *obj, int n);

@ -44,6 +44,7 @@ struct _E_Config_Dialog_Data
Evas_Object *o_add, *o_del, *o_categories;
Ecore_List *apps;
const char *category;
int category_n;
char *fav, *app;
};
@ -491,6 +492,7 @@ _category_cb_selected(void *data)
cfdata = data;
cfdata->category_n = e_widget_ilist_selected_get(cfdata->o_apps);
if (cfdata->category) ecore_string_release(cfdata->category);
cfdata->category = ecore_string_instance(cfdata->app);
_fill_apps(cfdata);
@ -525,6 +527,8 @@ _cb_categories(void *data, void *data2)
if (cfdata->category) ecore_string_release(cfdata->category);
cfdata->category = NULL;
_fill_categories(cfdata);
e_widget_ilist_nth_show(cfdata->o_apps, cfdata->category_n, 1);
cfdata->category_n = 0;
}
static void

@ -16,7 +16,7 @@ static void _e_wid_disable_hook(Evas_Object *obj);
/* externally accessible functions */
EAPI Evas_Object *
e_widget_framelist_add(Evas *evas, char *label, int horiz)
e_widget_framelist_add(Evas *evas, const char *label, int horiz)
{
Evas_Object *obj, *o;
E_Widget_Data *wd;
@ -88,7 +88,7 @@ e_widget_framelist_content_align_set(Evas_Object *obj, double halign, double val
}
EAPI void
e_widget_framelist_label_set(Evas_Object *obj, char *label)
e_widget_framelist_label_set(Evas_Object *obj, const char *label)
{
E_Widget_Data *wd;

@ -6,10 +6,10 @@
#ifndef E_WIDGET_FRAMELIST_H
#define E_WIDGET_FRAMELIST_H
EAPI Evas_Object *e_widget_framelist_add(Evas *evas, char *label, int horiz);
EAPI Evas_Object *e_widget_framelist_add(Evas *evas, const char *label, int horiz);
EAPI void e_widget_framelist_object_append(Evas_Object *obj, Evas_Object *sobj);
EAPI void e_widget_framelist_content_align_set(Evas_Object *obj, double halign, double valign);
EAPI void e_widget_framelist_label_set(Evas_Object *obj, char *label);
EAPI void e_widget_framelist_label_set(Evas_Object *obj, const char *label);
#endif
#endif

@ -242,6 +242,26 @@ e_widget_ilist_nth_data_get(Evas_Object *obj, int n)
return wcb->data;
}
/**
* Show the nth element of an ilist
* @param obj the ilist
* @param n the number of the element to show
* @param top if true, place this item at the top, otherwise scroll just
* enough to show the element (from the current position).
*/
EAPI void
e_widget_ilist_nth_show(Evas_Object *obj, int n, int top)
{
E_Widget_Data *wd;
Evas_Coord x, y, w, h;
wd = e_widget_data_get(obj);
e_ilist_nth_geometry_get(wd->o_ilist, n, &x, &y, &w, &h);
if (top)
e_scrollframe_child_pos_set(wd->o_scrollframe, x, y);
else
e_scrollframe_child_region_show(wd->o_scrollframe, x, y, w, h);
}
EAPI void
e_widget_ilist_selected_set(Evas_Object *obj, int n)
{

@ -22,6 +22,7 @@ EAPI const char *e_widget_ilist_nth_label_get(Evas_Object *obj, int n);
EAPI void e_widget_ilist_nth_icon_set(Evas_Object *obj, int n, Evas_Object *icon);
EAPI Evas_Object *e_widget_ilist_nth_icon_get(Evas_Object *obj, int n);
EAPI void *e_widget_ilist_nth_data_get(Evas_Object *obj, int n);
EAPI void e_widget_ilist_nth_show(Evas_Object *obj, int n, int top);
EAPI void e_widget_ilist_selected_set(Evas_Object *obj, int n);
EAPI int e_widget_ilist_selected_get(Evas_Object *obj);
EAPI const char *e_widget_ilist_selected_label_get(Evas_Object *obj);

Loading…
Cancel
Save