Enlightenment CVS committal

Author  : titan
Project : e17
Module  : apps/ephoto

Dir     : e17/apps/ephoto/src/bin


Modified Files:
        ephoto_main.c ephoto_normal_view.c 


Log Message:
Add a slider for resizing the thumbnails!

===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_main.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- ephoto_main.c       31 May 2007 06:02:36 -0000      1.39
+++ ephoto_main.c       31 May 2007 07:11:28 -0000      1.40
@@ -297,7 +297,8 @@
                {
                        thumb = add_image(em->fbox, imagef, 1, 
                                                freebox_image_clicked, NULL);
-                       ewl_image_constrain_set(EWL_IMAGE(thumb), 81);
+                       ewl_image_constrain_set(EWL_IMAGE(thumb), 
+                                       
ewl_range_value_get(EWL_RANGE(em->fthumb_size))); 
                        ewl_object_alignment_set(EWL_OBJECT(thumb), 
                                                        EWL_FLAG_ALIGN_CENTER);
                        ewl_widget_name_set(thumb, imagef);
@@ -355,7 +356,9 @@
                {
                        thumb = add_image(em->fbox, imagef, 1, 
                                                freebox_image_clicked, NULL);
-                       ewl_image_constrain_set(EWL_IMAGE(thumb), 81);
+                       ewl_image_size_set(EWL_IMAGE(thumb), 
+                                       
ewl_range_value_get(EWL_RANGE(em->fthumb_size)), 
+                                       
ewl_range_value_get(EWL_RANGE(em->fthumb_size)));
                                ewl_object_alignment_set(EWL_OBJECT(thumb), 
                                                        EWL_FLAG_ALIGN_CENTER);
                        ewl_widget_name_set(thumb, imagef);
===================================================================
RCS file: /cvs/e/e17/apps/ephoto/src/bin/ephoto_normal_view.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- ephoto_normal_view.c        31 May 2007 06:02:36 -0000      1.14
+++ ephoto_normal_view.c        31 May 2007 07:11:28 -0000      1.15
@@ -1,7 +1,25 @@
 #include "ephoto.h"
 
+static void change_size(Ewl_Widget *w, void *event, void *data);
 static void iterate(char *point2);
 
+/*Change the thumb size*/
+static void change_size(Ewl_Widget *w, void *event, void *data)
+{
+       Ewl_Widget *child;
+
+       ewl_container_child_iterate_begin(EWL_CONTAINER(em->fbox));
+
+       while ((child = ewl_container_child_next(EWL_CONTAINER(em->fbox))))
+       {
+               ewl_image_constrain_set(EWL_IMAGE(child), 
+                               
ewl_range_value_get(EWL_RANGE(em->fthumb_size)));
+               ewl_widget_reparent(child);
+       }
+
+       return;
+}
+
 /*Add the normal view*/
 Ewl_Widget *add_normal_view(Ewl_Widget *c)
 {
@@ -20,6 +38,15 @@
         ewl_object_fill_policy_set(EWL_OBJECT(em->fbox), EWL_FLAG_FILL_ALL);
         ewl_container_child_append(EWL_CONTAINER(sp), em->fbox);
         ewl_widget_show(em->fbox);
+
+       em->fthumb_size = ewl_hseeker_new();
+       ewl_range_minimum_value_set(EWL_RANGE(em->fthumb_size), 8);
+       ewl_range_maximum_value_set(EWL_RANGE(em->fthumb_size), 128);
+       ewl_range_step_set(EWL_RANGE(em->fthumb_size), 8);
+       ewl_range_value_set(EWL_RANGE(em->fthumb_size), 64);
+       ewl_container_child_append(EWL_CONTAINER(em->fbox_vbox), 
em->fthumb_size);
+       ewl_callback_append(em->fthumb_size, EWL_CALLBACK_VALUE_CHANGED, 
change_size, NULL);
+       ewl_widget_show(em->fthumb_size);
 
        return em->fbox_vbox;
 }



-------------------------------------------------------------------------
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-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to