Enlightenment CVS committal Author : titan Project : e17 Module : proto
Dir : e17/proto/ephoto/src Modified Files: ephoto_viewer.c Log Message: Get the much desired zoom to fit option into cvs. =================================================================== RCS file: /cvs/e/e17/proto/ephoto/src/ephoto_viewer.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- ephoto_viewer.c 6 Oct 2006 21:50:02 -0000 1.18 +++ ephoto_viewer.c 6 Oct 2006 22:23:04 -0000 1.19 @@ -26,6 +26,7 @@ ewl_object_alignment_set(EWL_OBJECT(image_view), EWL_FLAG_ALIGN_CENTER); ewl_widget_show(image_view); + ewl_widget_configure(image_view); ewl_widget_configure(ibox); } @@ -44,13 +45,25 @@ { int ow, oh; - ewl_object_current_size_get(EWL_OBJECT(image_view), &ow, &oh); + ewl_object_current_size_get(EWL_OBJECT(image_view), &ow, &oh); ewl_image_size_set(EWL_IMAGE(image_view), ow/2, oh/2); ewl_widget_configure(ibox); } +void zoom_fit(Ewl_Widget *w, void *event, void *data) +{ + int ew, eh; + + ewl_object_current_size_get(EWL_OBJECT(ibox), &ew, &eh); + + ewl_image_proportional_set(EWL_IMAGE(image_view), FALSE); + ewl_image_size_set(EWL_IMAGE(image_view), ew-16, eh-16); + + ewl_widget_configure(ibox); +} + void original_size(Ewl_Widget *w, void *event, void *data) { const char *path; @@ -290,6 +303,16 @@ menu_item = ewl_menu_item_new(); ewl_button_image_set(EWL_BUTTON(menu_item), + PACKAGE_DATA_DIR "/images/search.png", NULL); + ewl_button_label_set(EWL_BUTTON(menu_item), gettext("Zoom To Fit")); + ewl_object_alignment_set(EWL_OBJECT(menu_item), EWL_FLAG_ALIGN_CENTER); + ewl_container_child_append(EWL_CONTAINER(menu), menu_item); + ewl_callback_append(menu_item, EWL_CALLBACK_CLICKED, zoom_fit, NULL); + ewl_object_fill_policy_set(EWL_OBJECT(menu_item), EWL_FLAG_FILL_ALL); + ewl_widget_show(menu_item); + + menu_item = ewl_menu_item_new(); + ewl_button_image_set(EWL_BUTTON(menu_item), PACKAGE_DATA_DIR "/images/search.png", NULL); ewl_button_label_set(EWL_BUTTON(menu_item), gettext("Zoom 1:1")); ewl_object_alignment_set(EWL_OBJECT(menu_item), EWL_FLAG_ALIGN_CENTER); @@ -390,6 +413,16 @@ ewl_callback_append(button, EWL_CALLBACK_CLICKED, zoom_out, image_view); ewl_widget_show(button); + button = ewl_button_new(); + ewl_button_image_set(EWL_BUTTON(button), + PACKAGE_DATA_DIR "/images/search.png", NULL); + ewl_button_label_set(EWL_BUTTON(button), "Fit"); + ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK); + ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_CENTER); + ewl_container_child_append(EWL_CONTAINER(hbox), button); + ewl_callback_append(button, EWL_CALLBACK_CLICKED, zoom_fit, image_view); + ewl_widget_show(button); + button = ewl_button_new(); ewl_button_image_set(EWL_BUTTON(button), PACKAGE_DATA_DIR "/images/search.png", NULL); ------------------------------------------------------------------------- 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.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs