Enlightenment CVS committal Author : rephorm Project : e17 Module : apps/elicit
Dir : e17/apps/elicit/src Modified Files: shots.c swatches.c Log Message: act saner when deleting swatches/shots from the end of the list =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/elicit/src/shots.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- shots.c 14 May 2004 14:23:44 -0000 1.4 +++ shots.c 14 May 2004 14:38:47 -0000 1.5 @@ -254,6 +254,8 @@ { Elicit *el; Elicit_Shot *sh; + Evas_Coord h; + int offset; el = evas_object_data_get(o, "elicit"); sh = evas_object_data_get(o, "shot"); @@ -262,6 +264,16 @@ elicit_shot_free(sh); el->shots.length = esmart_container_elements_length_get(el->shots.cont); + + evas_object_geometry_get(el->shots.cont, NULL, NULL, NULL, &h); + offset = esmart_container_scroll_offset_get(el->shots.cont); + if (offset < h - el->shots.length - 10 && el->shots.length > h) + { + esmart_container_scroll_offset_set(el->shots.cont, + h - el->shots.length - 10); + } + _elicit_shots_update_scroll_bar(el); + elicit_shots_save(el); } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/elicit/src/swatches.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- swatches.c 14 May 2004 14:23:44 -0000 1.4 +++ swatches.c 14 May 2004 14:38:47 -0000 1.5 @@ -231,6 +231,8 @@ { Elicit *el; Elicit_Swatch *sw; + Evas_Coord h; + int offset; el = evas_object_data_get(o, "elicit"); sw = evas_object_data_get(o, "swatch"); @@ -240,7 +242,15 @@ el->swatches.length = esmart_container_elements_length_get(el->swatches.cont); - /* FIXME if end of list is above bottom of cont, scroll to end */ + evas_object_geometry_get(el->swatches.cont, NULL, NULL, NULL, &h); + offset = esmart_container_scroll_offset_get(el->swatches.cont); + if (offset < h - el->swatches.length - 10 && el->swatches.length > h) + { + esmart_container_scroll_offset_set(el->swatches.cont, + h - el->swatches.length - 10); + } + _elicit_swatches_update_scroll_bar(el); + elicit_swatches_save(el); } ------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs