|
From: <enl...@so...> - 2001-02-15 23:26:50
|
Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src
Modified Files:
icons.c view.c
Log Message:
just for fun.. mouse wheel will scroll the icons around... :)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/icons.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- icons.c 2001/02/12 18:58:51 1.4
+++ icons.c 2001/02/15 23:27:34 1.5
@@ -52,3 +52,25 @@
e_icon_unrealize(E_Icon *icon)
{
}
+
+void
+e_icon_update(E_Icon *icon)
+{
+ int fx, fy;
+ int iw, ih;
+ double tw, th;
+
+ if (!icon->changed) return;
+ evas_get_geometry(icon->view->evas, icon->obj.filename, NULL, NULL, &tw, &th);
+ evas_get_image_size(icon->view->evas, icon->obj.icon, & iw, &ih);
+ fx = icon->x + ((iw - tw) / 2);
+ fy = icon->y + ih;
+ evas_move(icon->view->evas, icon->obj.icon, icon->x, icon->y);
+ evas_move(icon->view->evas, icon->obj.filename, fx, fy);
+ icon->changed = 0;
+ if (icon->view)
+ {
+ icon->view->changed = 1;
+ }
+ icon->changed = 0;
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/view.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- view.c 2001/02/15 23:12:54 1.8
+++ view.c 2001/02/15 23:27:34 1.9
@@ -41,7 +41,11 @@
{
E_View *v;
- v = l->data;
+ v = l->data;
+ if (e->win == v->win.main)
+ {
+ e_view_scroll(v, 0, - (e->z * 10));
+ }
}
}
@@ -537,7 +541,6 @@
v->dir = e_file_real(dir);
/* start monitoring new dir */
v->monitor_id = efsd_start_monitor(e_fs_get_connection(), v->dir);
- printf("%i %s\n", v->monitor_id, v->dir);
v->is_listing = 1;
v->changed = 1;
}
@@ -545,6 +548,17 @@
void
e_view_scroll(E_View *v, int dx, int dy)
{
+ Evas_List l;
+
+ for (l = v->icons; l; l = l->next)
+ {
+ E_Icon *icon;
+
+ icon = l->data;
+ icon->x += dx;
+ icon->y += dy;
+ icon->changed = 1;
+ }
v->changed = 1;
}
@@ -555,6 +569,7 @@
icon->view = v;
e_icon_realize(icon);
v->changed = 1;
+ v->icons = evas_list_append(v->icons, icon);
}
void
@@ -565,6 +580,7 @@
icon->view = NULL;
icon->changed = 1;
v->changed = 1;
+ v->icons = evas_list_remove(v->icons, icon);
}
void
@@ -628,8 +644,17 @@
void
e_view_update(E_View *v)
{
+ Evas_List l;
+
if (!v->changed) return;
+ for (l = v->icons; l; l = l->next)
+ {
+ E_Icon *icon;
+
+ icon = l->data;
+ e_icon_update(icon);
+ }
if (v->options.back_pixmap)
{
Imlib_Updates up;
|